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

Least Squares Curve Fitting. More...

Public Member Functions

 LeastSquares ()=delete
 Constructor.
 

Static Public Member Functions

template<typename DerivedX , typename DerivedY >
static Eigen::VectorX< Scalar > calcCoefficients (const Eigen::MatrixBase< DerivedX > &x, const Eigen::MatrixBase< DerivedY > &y, size_t polynomialDegree=2)
 Calculates the polynomial coefficients in order a0 + a1 * x + a2 * x^2 + ...
 

Detailed Description

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

Least Squares Curve Fitting.

Template Parameters
ScalarData type to store

Member Function Documentation

◆ calcCoefficients()

template<typename Scalar >
template<typename DerivedX , typename DerivedY >
static Eigen::VectorX< Scalar > NAV::LeastSquares< Scalar >::calcCoefficients ( const Eigen::MatrixBase< DerivedX > & x,
const Eigen::MatrixBase< DerivedY > & y,
size_t polynomialDegree = 2 )
inlinestatic

Calculates the polynomial coefficients in order a0 + a1 * x + a2 * x^2 + ...

Parameters
[in]xX data to fit
[in]yY data to fit
[in]polynomialDegreePolynomial degree to fit

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