![]() |
0.4.1
|
Polynomial Curve Fitting. More...
Public Types | |
enum class | Strategy : uint8_t { IncrementalLeastSquares , LeastSquares , HouseholderQR , BDCSVD , COD , COUNT } |
Possible Fit strategies. More... | |
Public Member Functions | |
Polynomial< Scalar > | calcPolynomial () const |
Calculates the polynomial. | |
const ScrollingBuffer< std::pair< Scalar, Scalar > > & | data () const |
Gets the underlying buffer. | |
bool | empty () const |
Checks if the container has no elements. | |
PolynomialRegressor (size_t polynomialDegree, size_t windowSize, Strategy strategy=Strategy::HouseholderQR) | |
Constructor. | |
void | push_back (const Scalar &x, const Scalar &y) |
Add a data point to the polynomial. | |
void | push_back (const std::pair< Scalar, Scalar > &dataPoint) |
Add a data point to the polynomial. | |
void | reset () |
Reset the polynomial coefficients and saved data. | |
void | setPolynomialDegree (size_t polynomialDegree) |
Set the Polynomial Degree and resets the data. | |
void | setStrategy (Strategy strategy) |
Set the strategy for the fit and resets the data. | |
void | setWindowSize (size_t windowSize) |
Sets the amount of points used for the fit (sliding window) | |
bool | windowSizeReached () const |
Checks if the amount of data points equals the window size. | |
Private Member Functions | |
void | pop_front () |
Removes the first data point from the polynomial fit (sliding window) | |
Private Attributes | |
ScrollingBuffer< std::pair< Scalar, Scalar > > | _data |
Values added to the fit. | |
IncrementalLeastSquares< Scalar > | _incrementalLSQ |
Incremental LSQ Regressor. | |
size_t | _polyDegree |
Polynomial degree to fit. | |
Strategy | _strategy |
Strategy to use to fit the polynomial. | |
size_t | _windowSize |
Amount of points to store. | |
Polynomial Curve Fitting.
Scalar | Data type to store |
Definition at line 38 of file PolynomialRegressor.hpp.
|
strong |
Possible Fit strategies.
Definition at line 42 of file PolynomialRegressor.hpp.
|
inline |
Constructor.
[in] | polynomialDegree | Degree of the polynomial to fit |
[in] | windowSize | Amount of points to use for the fit (sliding window) |
[in] | strategy | Strategy to use |
Definition at line 56 of file PolynomialRegressor.hpp.
|
inlinenodiscard |
Calculates the polynomial.
Definition at line 143 of file PolynomialRegressor.hpp.
|
inlinenodiscard |
Gets the underlying buffer.
Definition at line 199 of file PolynomialRegressor.hpp.
|
inlinenodiscard |
Checks if the container has no elements.
Definition at line 196 of file PolynomialRegressor.hpp.
|
inlineprivate |
Removes the first data point from the polynomial fit (sliding window)
Definition at line 214 of file PolynomialRegressor.hpp.
|
inline |
Add a data point to the polynomial.
[in] | x | X Value |
[in] | y | Y Value |
Definition at line 111 of file PolynomialRegressor.hpp.
|
inline |
Add a data point to the polynomial.
[in] | dataPoint | Data point |
Definition at line 103 of file PolynomialRegressor.hpp.
|
inline |
Reset the polynomial coefficients and saved data.
Definition at line 136 of file PolynomialRegressor.hpp.
|
inline |
Set the Polynomial Degree and resets the data.
[in] | polynomialDegree | Degree of the polynomial to fit |
Definition at line 81 of file PolynomialRegressor.hpp.
|
inline |
Set the strategy for the fit and resets the data.
strategy | Strategy to use for fitting data |
Definition at line 93 of file PolynomialRegressor.hpp.
|
inline |
Sets the amount of points used for the fit (sliding window)
[in] | windowSize | Amount of points to use for the fit |
Definition at line 65 of file PolynomialRegressor.hpp.
|
inlinenodiscard |
Checks if the amount of data points equals the window size.
Definition at line 190 of file PolynomialRegressor.hpp.
|
private |
Values added to the fit.
Definition at line 209 of file PolynomialRegressor.hpp.
|
private |
Incremental LSQ Regressor.
Definition at line 211 of file PolynomialRegressor.hpp.
|
private |
Polynomial degree to fit.
Definition at line 205 of file PolynomialRegressor.hpp.
|
private |
Strategy to use to fit the polynomial.
Definition at line 203 of file PolynomialRegressor.hpp.
|
private |
Amount of points to store.
Definition at line 207 of file PolynomialRegressor.hpp.