mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-14 04:00:34 +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
|
||||
Exponential_Smoother& Exponential_Smoother::operator=(Exponential_Smoother&& other)
|
||||
{
|
||||
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;
|
||||
}
|
||||
Exponential_Smoother& Exponential_Smoother::operator=(Exponential_Smoother&& other) = default;
|
||||
|
||||
|
||||
void Exponential_Smoother::set_alpha(float alpha)
|
||||
|
@ -47,10 +47,10 @@
|
||||
class Exponential_Smoother
|
||||
{
|
||||
public:
|
||||
Exponential_Smoother(); //!< Constructor
|
||||
~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_samples_for_initialization(int num_samples); //!< Number of samples averaged for initialization. Default value: 200
|
||||
Exponential_Smoother(); //!< Constructor
|
||||
~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_samples_for_initialization(int num_samples); //!< Number of samples averaged for initialization. Default value: 200
|
||||
void reset();
|
||||
void set_min_value(float value);
|
||||
void set_offset(float offset);
|
||||
|
@ -72,22 +72,7 @@ Tracking_loop_filter::~Tracking_loop_filter() = default;
|
||||
|
||||
|
||||
// Move assignment operator
|
||||
Tracking_loop_filter& Tracking_loop_filter::operator=(Tracking_loop_filter&& other)
|
||||
{
|
||||
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;
|
||||
}
|
||||
Tracking_loop_filter& Tracking_loop_filter::operator=(Tracking_loop_filter&& other) = default;
|
||||
|
||||
|
||||
float Tracking_loop_filter::apply(float current_input)
|
||||
|
Loading…
Reference in New Issue
Block a user