![]() |
0.5.1
|
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. | |
Private Attributes | |
| size_t | _polyDegree |
| Polynomial degree to fit. | |
| Eigen::VectorX< Scalar > | _summedPowersX |
| Sum{x^2}. (DEGREE + 1) * 2 - 1 values. | |
| Eigen::VectorX< Scalar > | _summedPowersXTimesY |
| Sum{x^2 * y}. DEGREE + 1 values. | |
Incremental Least Squares Curve Fitting.
| Scalar | Data type to store |
Definition at line 29 of file IncrementalLeastSquares.hpp.
|
inlineexplicit |
Constructor.
| [in] | polynomialDegree | Degree of the polynomial to fit |
Definition at line 34 of file IncrementalLeastSquares.hpp.
|
inline |
Add a data point to the polynomial.
| [in] | x | X Value |
| [in] | y | Y Value |
Definition at line 51 of file IncrementalLeastSquares.hpp.
|
inlinenodiscard |
Calculates the polynomial coefficients in order a0 + a1 * x + a2 * x^2 + ...
Definition at line 96 of file IncrementalLeastSquares.hpp.
|
inline |
Removes a data point from the polynomial fit.
| [in] | x | X Value |
| [in] | y | Y Value |
Definition at line 71 of file IncrementalLeastSquares.hpp.
|
inline |
Reset the saved data.
Definition at line 89 of file IncrementalLeastSquares.hpp.
|
inline |
Set the Polynomial Degree.
| [in] | polynomialDegree | Degree of the polynomial to fit |
Definition at line 41 of file IncrementalLeastSquares.hpp.
|
private |
Polynomial degree to fit.
Definition at line 113 of file IncrementalLeastSquares.hpp.
|
private |
Sum{x^2}. (DEGREE + 1) * 2 - 1 values.
Definition at line 114 of file IncrementalLeastSquares.hpp.
|
private |
Sum{x^2 * y}. DEGREE + 1 values.
Definition at line 115 of file IncrementalLeastSquares.hpp.