casa
$Rev:20696$
|
Parameter handling for one-dimensional polynomials. More...
#include <PolynomialParam.h>
Public Member Functions | |
PolynomialParam () | |
Constructs a zero'th order polynomial, with a coeficcient of 0.0. | |
PolynomialParam (uInt order) | |
Makes a polynomial of the given order, with all coeficcients set to zero. | |
PolynomialParam (const PolynomialParam< T > &other) | |
Make this a copy of other (deep copy). | |
template<class W > | |
PolynomialParam (const PolynomialParam< W > &other) | |
PolynomialParam< T > & | operator= (const PolynomialParam< T > &other) |
~PolynomialParam () | |
Destructor. | |
Bool | operator== (const PolynomialParam< T > &other) const |
Comparisons. | |
Bool | operator!= (const PolynomialParam< T > &other) const |
virtual const String & | name () const |
Give name of function. | |
uInt | order () const |
What is the order of the polynomial, i.e. | |
T | coefficient (uInt which) const |
What is the which'th coefficient of the polynomial. | |
const Vector< T > & | coefficients () const |
Return all the coefficients as a vector. | |
void | setCoefficient (uInt which, const T value) |
Set the which'th coefficient to value. | |
void | setCoefficients (const Vector< T > &coefficients) |
Set all the coefficients at once, throw away all existing coefficients. |
Parameter handling for one-dimensional polynomials.
A 1-dimensional Polynomial's parameters.
A Polynomial
is described by a set of coefficients; its fundamental operation is evaluating itself at some "x". The number of coefficients is the order of the polynomial plus one.
Since the Polynomial
is a Function
, the derivatives can be obtained as well.
The parameter interface (see FunctionParam class), is used to provide an interface to the Fitting classes.
This class is in general used implicitly by the Polynomial
class only.
Polynomial<Float> pf(3); // Third order polynomial - coeffs 0 by default pf.setCoefficient(1, 1.0); pf[2] = 2.0; pf.setCoefficient(3, 3.0); // 3x^3 + 2x^2 + x pf(2); // == 34
Definition at line 100 of file PolynomialParam.h.
casa::PolynomialParam< T >::PolynomialParam | ( | ) |
Constructs a zero'th order polynomial, with a coeficcient of 0.0.
casa::PolynomialParam< T >::PolynomialParam | ( | uInt | order | ) | [explicit] |
Makes a polynomial of the given order, with all coeficcients set to zero.
casa::PolynomialParam< T >::PolynomialParam | ( | const PolynomialParam< T > & | other | ) |
Make this a copy of other (deep copy).
casa::PolynomialParam< T >::PolynomialParam | ( | const PolynomialParam< W > & | other | ) | [inline] |
Definition at line 114 of file PolynomialParam.h.
casa::PolynomialParam< T >::~PolynomialParam | ( | ) |
Destructor.
T casa::PolynomialParam< T >::coefficient | ( | uInt | which | ) | const [inline] |
What is the which'th coefficient of the polynomial.
For an nth degree polynomial, which varies between zero and n.
Definition at line 142 of file PolynomialParam.h.
const Vector<T>& casa::PolynomialParam< T >::coefficients | ( | ) | const |
Return all the coefficients as a vector.
virtual const String& casa::PolynomialParam< T >::name | ( | ) | const [inline, virtual] |
Give name of function.
Reimplemented from casa::Function< T, T >.
Definition at line 134 of file PolynomialParam.h.
Bool casa::PolynomialParam< T >::operator!= | ( | const PolynomialParam< T > & | other | ) | const [inline] |
Definition at line 128 of file PolynomialParam.h.
PolynomialParam<T>& casa::PolynomialParam< T >::operator= | ( | const PolynomialParam< T > & | other | ) |
Bool casa::PolynomialParam< T >::operator== | ( | const PolynomialParam< T > & | other | ) | const [inline] |
Comparisons.
Polynomials are equal if they are the same order
Definition at line 126 of file PolynomialParam.h.
uInt casa::PolynomialParam< T >::order | ( | ) | const [inline] |
What is the order of the polynomial, i.e.
maximum exponent of "x".
Definition at line 138 of file PolynomialParam.h.
Referenced by casa::PolynomialParam< AutoDiff< Float > >::coefficient(), and casa::PolynomialParam< AutoDiff< Float > >::setCoefficient().
void casa::PolynomialParam< T >::setCoefficient | ( | uInt | which, |
const T | value | ||
) | [inline] |
Set the which'th coefficient to value.
Definition at line 149 of file PolynomialParam.h.
void casa::PolynomialParam< T >::setCoefficients | ( | const Vector< T > & | coefficients | ) |
Set all the coefficients at once, throw away all existing coefficients.