mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-07 07:50:32 +00:00
Simplify move assignment operator
This commit is contained in:
parent
76a14a86f0
commit
95ece1e6d4
@ -52,21 +52,7 @@ Exponential_Smoother::~Exponential_Smoother() = default;
|
|||||||
|
|
||||||
|
|
||||||
// Move assignment operator
|
// Move assignment operator
|
||||||
Exponential_Smoother& Exponential_Smoother::operator=(Exponential_Smoother&& other)
|
Exponential_Smoother& Exponential_Smoother::operator=(Exponential_Smoother&& other) = default;
|
||||||
{
|
|
||||||
if (this != &other)
|
|
||||||
{
|
|
||||||
this->alpha_ = other.alpha_;
|
|
||||||
this->old_value_ = other.old_value_;
|
|
||||||
this->one_minus_alpha_ = 1.0 - other.alpha_;
|
|
||||||
this->samples_for_initialization_ = other.samples_for_initialization_;
|
|
||||||
this->initializing_ = other.initializing_;
|
|
||||||
this->init_counter_ = other.init_counter_;
|
|
||||||
this->min_value_ = other.min_value_;
|
|
||||||
this->offset_ = other.offset_;
|
|
||||||
}
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Exponential_Smoother::set_alpha(float alpha)
|
void Exponential_Smoother::set_alpha(float alpha)
|
||||||
|
@ -47,10 +47,10 @@
|
|||||||
class Exponential_Smoother
|
class Exponential_Smoother
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Exponential_Smoother(); //!< Constructor
|
Exponential_Smoother(); //!< Constructor
|
||||||
~Exponential_Smoother(); //!< Destructor
|
~Exponential_Smoother(); //!< Destructor
|
||||||
void set_alpha(float alpha); //!< 0 < alpha < 1. The higher, the most responsive, but more variance. Default value: 0.001
|
void set_alpha(float alpha); //!< 0 < alpha < 1. The higher, the most responsive, but more variance. Default value: 0.001
|
||||||
void set_samples_for_initialization(int num_samples); //!< Number of samples averaged for initialization. Default value: 200
|
void set_samples_for_initialization(int num_samples); //!< Number of samples averaged for initialization. Default value: 200
|
||||||
void reset();
|
void reset();
|
||||||
void set_min_value(float value);
|
void set_min_value(float value);
|
||||||
void set_offset(float offset);
|
void set_offset(float offset);
|
||||||
|
@ -72,22 +72,7 @@ Tracking_loop_filter::~Tracking_loop_filter() = default;
|
|||||||
|
|
||||||
|
|
||||||
// Move assignment operator
|
// Move assignment operator
|
||||||
Tracking_loop_filter& Tracking_loop_filter::operator=(Tracking_loop_filter&& other)
|
Tracking_loop_filter& Tracking_loop_filter::operator=(Tracking_loop_filter&& other) = default;
|
||||||
{
|
|
||||||
if (this != &other)
|
|
||||||
{
|
|
||||||
this->d_inputs = other.d_inputs;
|
|
||||||
this->d_outputs = other.d_outputs;
|
|
||||||
this->d_input_coefficients = other.d_input_coefficients;
|
|
||||||
this->d_output_coefficients = other.d_output_coefficients;
|
|
||||||
this->d_loop_order = other.d_loop_order;
|
|
||||||
this->d_current_index = other.d_current_index;
|
|
||||||
this->d_include_last_integrator = other.d_include_last_integrator;
|
|
||||||
this->d_noise_bandwidth = other.d_noise_bandwidth;
|
|
||||||
this->d_update_interval = other.d_update_interval;
|
|
||||||
}
|
|
||||||
return *this;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
float Tracking_loop_filter::apply(float current_input)
|
float Tracking_loop_filter::apply(float current_input)
|
||||||
|
Loading…
Reference in New Issue
Block a user