0.2.0
Loading...
Searching...
No Matches
NAV::IncrementalLeastSquares< Scalar > Class Template Reference

Incremental Least Squares Curve Fitting. More...

Public Member Functions

void addDataPoint (const Scalar &x, const Scalar &y)
 Add a data point to the polynomial.
 
Eigen::VectorX< Scalar > calcCoefficients () const
 Calculates the polynomial coefficients in order a0 + a1 * x + a2 * x^2 + ...
 
 IncrementalLeastSquares (size_t polynomialDegree)
 Constructor.
 
void removeDataPoint (const Scalar &x, const Scalar &y)
 Removes a data point from the polynomial fit.
 
void reset ()
 Reset the saved data.
 
void setPolynomialDegree (size_t polynomialDegree)
 Set the Polynomial Degree.
 

Detailed Description

template<typename Scalar>
class NAV::IncrementalLeastSquares< Scalar >

Incremental Least Squares Curve Fitting.

Template Parameters
ScalarData type to store

Constructor & Destructor Documentation

◆ IncrementalLeastSquares()

template<typename Scalar >
NAV::IncrementalLeastSquares< Scalar >::IncrementalLeastSquares ( size_t polynomialDegree)
inlineexplicit

Constructor.

Parameters
[in]polynomialDegreeDegree of the polynomial to fit

Member Function Documentation

◆ addDataPoint()

template<typename Scalar >
void NAV::IncrementalLeastSquares< Scalar >::addDataPoint ( const Scalar & x,
const Scalar & y )
inline

Add a data point to the polynomial.

Parameters
[in]xX Value
[in]yY Value

◆ removeDataPoint()

template<typename Scalar >
void NAV::IncrementalLeastSquares< Scalar >::removeDataPoint ( const Scalar & x,
const Scalar & y )
inline

Removes a data point from the polynomial fit.

Parameters
[in]xX Value
[in]yY Value

◆ setPolynomialDegree()

template<typename Scalar >
void NAV::IncrementalLeastSquares< Scalar >::setPolynomialDegree ( size_t polynomialDegree)
inline

Set the Polynomial Degree.

Parameters
[in]polynomialDegreeDegree of the polynomial to fit

The documentation for this class was generated from the following file: