casa
$Rev:20696$
|
Parameter handling for even polynomials. More...
#include <EvenPolynomialParam.h>
Public Member Functions | |
EvenPolynomialParam () | |
Constructs a zero'th order polynomial, with a coeficcient of 0.0. | |
EvenPolynomialParam (uInt order) | |
Makes a polynomial of the given order, with all coeficcients set to zero. | |
EvenPolynomialParam (const EvenPolynomialParam< T > &other) | |
Make this a copy of other (deep copy). | |
template<class W > | |
EvenPolynomialParam (const EvenPolynomialParam< W > &other) | |
EvenPolynomialParam< T > & | operator= (const EvenPolynomialParam< T > &other) |
~EvenPolynomialParam () | |
Destructor. | |
Bool | operator== (const EvenPolynomialParam< T > &other) const |
Comparisons. | |
Bool | operator!= (const EvenPolynomialParam< 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 even polynomials.
A 1-dimensional EvenPolynomial's parameters.
An EvenPolynomial
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 divided by two, plus one.
Since the EvenPolynomial
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 EvenPolynomial
class only.
EvenPolynomial<Float> pf(3); // Second order polynomial - coeffs 0 by default pf.setCoefficient(0, 1.0); pf[1] = 2.0; // 2x^2 + 1x^0 pf(2); // == 8
Definition at line 98 of file EvenPolynomialParam.h.
casa::EvenPolynomialParam< T >::EvenPolynomialParam | ( | ) |
Constructs a zero'th order polynomial, with a coeficcient of 0.0.
casa::EvenPolynomialParam< T >::EvenPolynomialParam | ( | uInt | order | ) | [explicit] |
Makes a polynomial of the given order, with all coeficcients set to zero.
casa::EvenPolynomialParam< T >::EvenPolynomialParam | ( | const EvenPolynomialParam< T > & | other | ) |
Make this a copy of other (deep copy).
casa::EvenPolynomialParam< T >::EvenPolynomialParam | ( | const EvenPolynomialParam< W > & | other | ) | [inline] |
Definition at line 113 of file EvenPolynomialParam.h.
casa::EvenPolynomialParam< T >::~EvenPolynomialParam | ( | ) |
Destructor.
T casa::EvenPolynomialParam< 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/2.
Definition at line 141 of file EvenPolynomialParam.h.
const Vector<T>& casa::EvenPolynomialParam< T >::coefficients | ( | ) | const |
Return all the coefficients as a vector.
virtual const String& casa::EvenPolynomialParam< T >::name | ( | ) | const [inline, virtual] |
Give name of function.
Reimplemented from casa::Function< T, T >.
Definition at line 133 of file EvenPolynomialParam.h.
Bool casa::EvenPolynomialParam< T >::operator!= | ( | const EvenPolynomialParam< T > & | other | ) | const [inline] |
Definition at line 127 of file EvenPolynomialParam.h.
EvenPolynomialParam<T>& casa::EvenPolynomialParam< T >::operator= | ( | const EvenPolynomialParam< T > & | other | ) |
Bool casa::EvenPolynomialParam< T >::operator== | ( | const EvenPolynomialParam< T > & | other | ) | const [inline] |
Comparisons.
EvenPolynomials are equal if they are the same order
Definition at line 125 of file EvenPolynomialParam.h.
uInt casa::EvenPolynomialParam< T >::order | ( | ) | const [inline] |
What is the order of the polynomial, i.e.
maximum exponent of "x".
Definition at line 137 of file EvenPolynomialParam.h.
Referenced by casa::EvenPolynomialParam< AutoDiff< T > >::coefficient(), and casa::EvenPolynomialParam< AutoDiff< T > >::setCoefficient().
void casa::EvenPolynomialParam< T >::setCoefficient | ( | uInt | which, |
const T | value | ||
) | [inline] |
Set the which'th coefficient to value.
Definition at line 148 of file EvenPolynomialParam.h.
void casa::EvenPolynomialParam< T >::setCoefficients | ( | const Vector< T > & | coefficients | ) |
Set all the coefficients at once, throw away all existing coefficients.