POLYNOMIAL_1D Class Reference

1-dimensional simple polynomial. More...

#include <mi32/polynomial.h>

List of all members.

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)

Detailed Description

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.


Constructor & Destructor Documentation

POLYNOMIAL_1D::POLYNOMIAL_1D (  ) 

Default constructor.

POLYNOMIAL_1D::~POLYNOMIAL_1D (  ) 

Destructor.


Member Function Documentation

ERRVALUE POLYNOMIAL_1D::AddSample ( double  x,
double  value 
)

Add sample for polynomial computation.

Parameters:
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.

Parameters:
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.

Parameters:
order Polynomial order, maximum of 15
ERRVALUE POLYNOMIAL_1D::SetCoefficients ( unsigned  order,
const double *  Coeff 
)

Directly set polynomial coefficients.

Parameters:
order Polynomial order, maximum of 15
Coeff Coefficient array of size (order + 1)

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

Generated on Sun Oct 7 21:33:43 2012 for TNTsdk 2012 by  doxygen 1.6.1