casa
$Rev:20696$
|
Parameter handling for odd polynomials. More...
#include <OddPolynomialParam.h>
Public Member Functions | |
OddPolynomialParam () | |
Constructs a first order polynomial, with a coeficcient of 0.0. | |
OddPolynomialParam (uInt order) | |
Makes a polynomial of the given order, with all coeficcients set to zero. | |
OddPolynomialParam (const OddPolynomialParam< T > &other) | |
Make this a copy of other (deep copy). | |
template<class W > | |
OddPolynomialParam (const OddPolynomialParam< W > &other) | |
OddPolynomialParam< T > & | operator= (const OddPolynomialParam< T > &other) |
~OddPolynomialParam () | |
Destructor. | |
Bool | operator== (const OddPolynomialParam< T > &other) const |
Comparisons. | |
Bool | operator!= (const OddPolynomialParam< 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 odd polynomials.
A 1-dimensional OddPolynomial's parameters.
An OddPolynomial
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 OddPolynomial
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 OddPolynomial
class only.
OddPolynomial<Float> pf(3); // Third order polynomial - coeffs 0 by default pf.setCoefficient(0, 1.0); pf[1] = 2.0; // 2x^3 + 1x^1 pf(2); // == 18
Definition at line 99 of file OddPolynomialParam.h.
casa::OddPolynomialParam< T >::OddPolynomialParam | ( | ) |
Constructs a first order polynomial, with a coeficcient of 0.0.
casa::OddPolynomialParam< T >::OddPolynomialParam | ( | uInt | order | ) | [explicit] |
Makes a polynomial of the given order, with all coeficcients set to zero.
casa::OddPolynomialParam< T >::OddPolynomialParam | ( | const OddPolynomialParam< T > & | other | ) |
Make this a copy of other (deep copy).
casa::OddPolynomialParam< T >::OddPolynomialParam | ( | const OddPolynomialParam< W > & | other | ) | [inline] |
Definition at line 114 of file OddPolynomialParam.h.
casa::OddPolynomialParam< T >::~OddPolynomialParam | ( | ) |
Destructor.
T casa::OddPolynomialParam< 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 142 of file OddPolynomialParam.h.
const Vector<T>& casa::OddPolynomialParam< T >::coefficients | ( | ) | const |
Return all the coefficients as a vector.
virtual const String& casa::OddPolynomialParam< T >::name | ( | ) | const [inline, virtual] |
Give name of function.
Reimplemented from casa::Function< T, T >.
Definition at line 134 of file OddPolynomialParam.h.
Bool casa::OddPolynomialParam< T >::operator!= | ( | const OddPolynomialParam< T > & | other | ) | const [inline] |
Definition at line 128 of file OddPolynomialParam.h.
OddPolynomialParam<T>& casa::OddPolynomialParam< T >::operator= | ( | const OddPolynomialParam< T > & | other | ) |
Bool casa::OddPolynomialParam< T >::operator== | ( | const OddPolynomialParam< T > & | other | ) | const [inline] |
Comparisons.
OddPolynomials are equal if they are the same order
Definition at line 126 of file OddPolynomialParam.h.
uInt casa::OddPolynomialParam< T >::order | ( | ) | const [inline] |
What is the order of the polynomial, i.e.
maximum exponent of "x".
Definition at line 138 of file OddPolynomialParam.h.
Referenced by casa::OddPolynomialParam< AutoDiff< T > >::coefficient(), and casa::OddPolynomialParam< AutoDiff< T > >::setCoefficient().
void casa::OddPolynomialParam< T >::setCoefficient | ( | uInt | which, |
const T | value | ||
) | [inline] |
Set the which'th coefficient to value.
Definition at line 149 of file OddPolynomialParam.h.
void casa::OddPolynomialParam< T >::setCoefficients | ( | const Vector< T > & | coefficients | ) |
Set all the coefficients at once, throw away all existing coefficients.