1-dimensional simple polynomial. More...
#include <mi32/polynomial.h>
Public Member Functions | |
| POLYNOMIAL_1D () | |
| ~POLYNOMIAL_1D () | |
| ERRVALUE | AddSample (double x, double value) |
| ERRVALUE | Compute () |
| double | Evaluate (double x) const |
| const DOUBLE_ARRAY< double > & | GetCoefficients () const |
| ERRVALUE | Initialize (unsigned order) |
| ERRVALUE | SetCoefficients (unsigned order, const double *Coeff) |
1-dimensional simple polynomial.
Polynomial is of the form: c[0] + c[1]*x + c[2]*x^2 + ... + c[order]*x^order. After construction must call Initialize() or SetCoefficients() before using other methods.
| POLYNOMIAL_1D::POLYNOMIAL_1D | ( | ) |
Default constructor.
| POLYNOMIAL_1D::~POLYNOMIAL_1D | ( | ) |
Destructor.
| ERRVALUE POLYNOMIAL_1D::AddSample | ( | double | x, | |
| double | value | |||
| ) |
Add sample for polynomial computation.
| x | Sample position | |
| value | Sample value |
| ERRVALUE POLYNOMIAL_1D::Compute | ( | ) |
Compute polynomial fitted to previously added samples.
| double POLYNOMIAL_1D::Evaluate | ( | double | x | ) | const |
Evaluate polynomial at specified position.
| x | Position to evaluate at |
| const DOUBLE_ARRAY<double>& POLYNOMIAL_1D::GetCoefficients | ( | ) | const [inline] |
Get polynomial coefficients.
Coefficient index is same as power for position when evaluating. Eg. value = c[0] + c[1]*x + c[2]*x^2 + ... + c[order]*x^order.
| ERRVALUE POLYNOMIAL_1D::Initialize | ( | unsigned | order | ) |
Initialize.
| order | Polynomial order, maximum of 15 |
| ERRVALUE POLYNOMIAL_1D::SetCoefficients | ( | unsigned | order, | |
| const double * | Coeff | |||
| ) |
Directly set polynomial coefficients.
| order | Polynomial order, maximum of 15 | |
| Coeff | Coefficient array of size (order + 1) |
1.6.1