|
| nmrStandardPolynomial (VariableIndexType numVariables, PowerType minDegree, PowerType maxDegree) |
|
virtual | ~nmrStandardPolynomial () |
|
virtual InsertStatus | SetCoefficient (const nmrPolynomialTermPowerIndex &where, CoefficientType coefficient) |
|
virtual InsertStatus | SetCoefficient (TermIteratorType &where, CoefficientType coefficient) |
|
virtual CoefficientType | GetCoefficient (const nmrPolynomialTermPowerIndex &where) const |
|
virtual CoefficientType | GetCoefficient (const TermConstIteratorType &where) const |
|
virtual CoefficientType | GetCoefficient (const TermIteratorType &where) const |
|
virtual void | RemoveTerm (TermIteratorType &where) |
|
virtual void | Clear () |
|
virtual ValueType | EvaluateBasis (const nmrPolynomialTermPowerIndex &where, const nmrMultiVariablePowerBasis &variables) const |
|
virtual ValueType | EvaluateBasis (const TermConstIteratorType &where, const nmrMultiVariablePowerBasis &variables) const |
|
virtual ValueType | EvaluateBasis (const TermIteratorType &where, const nmrMultiVariablePowerBasis &variables) const |
|
virtual void | SerializeTermInfo (std::ostream &output, const TermConstIteratorType &termIterator) const |
|
virtual void | DeserializeTermInfo (std::istream &input, TermIteratorType &termIterator) |
|
virtual void | AddConstant (CoefficientType shiftAmount) |
|
virtual void | AddConstantToCoefficients (CoefficientType coefficients[], CoefficientType shiftAmount) const |
|
| nmrDynAllocPolynomialContainer (unsigned int numVariables, unsigned int minDegree, unsigned int maxDegree) |
|
| nmrPolynomialContainer (VariableIndexType numVariables, PowerType minDegree, PowerType maxDegree) |
|
virtual | ~nmrPolynomialContainer () |
|
virtual TermCounterType | GetNumberOfTerms () const |
|
virtual bool | IsEmpty () const |
|
virtual void | SetMinDegree (PowerType newMin) throw (std::runtime_error) |
|
virtual void | SetMaxDegree (PowerType newMax) throw (std::runtime_error) |
|
virtual void | FillAllTerms () |
|
virtual bool | IncludesIndex (const nmrPolynomialTermPowerIndex &target) const |
|
virtual TermCounterType | GetIndexPosition (const nmrPolynomialTermPowerIndex &term) const |
|
TermIteratorType | GetTermIteratorForPosition (TermCounterType position) |
|
TermIteratorType | FirstTermIterator () |
|
TermConstIteratorType | FirstTermIterator () const |
|
TermIteratorType | EndTermIterator () |
|
TermConstIteratorType | EndTermIterator () const |
|
TermIteratorType | FindTerm (const nmrPolynomialTermPowerIndex &target) |
|
TermConstIteratorType | FindTerm (const nmrPolynomialTermPowerIndex &target) const |
|
virtual void | RemoveTerm (const nmrPolynomialTermPowerIndex &where) |
|
virtual void | CollectCoefficients (CoefficientType target[]) const |
|
virtual void | RestoreCoefficients (const CoefficientType source[]) |
|
const nmrPolynomialTermPowerIndex & | GetTermPowerIndex (const TermConstIteratorType &where) const |
|
const nmrPolynomialTermPowerIndex & | GetTermPowerIndex (const TermIteratorType &where) const |
|
ValueType | EvaluateTerm (const TermConstIteratorType &where) const |
|
ValueType | EvaluateTerm (const TermIteratorType &where) const |
|
ValueType | EvaluateTerm (const TermConstIteratorType &where, const nmrMultiVariablePowerBasis &variables) const |
|
ValueType | EvaluateTerm (const TermIteratorType &where, const nmrMultiVariablePowerBasis &variables) const |
|
virtual ValueType | Evaluate (const nmrMultiVariablePowerBasis &variables) const |
|
virtual void | EvaluateBasisVector (const nmrMultiVariablePowerBasis &variables, ValueType termBaseValues[]) const |
|
virtual ValueType | EvaluateForCoefficients (const nmrMultiVariablePowerBasis &variables, const CoefficientType coefficients[]) const |
|
virtual void | Scale (CoefficientType scaleFactor) |
|
virtual void | SerializeRaw (std::ostream &output) const |
|
virtual void | DeserializeRaw (std::istream &input) |
|
| nmrPolynomialBase (VariableIndexType numVariables, PowerType minDegree, PowerType maxDegree) |
|
virtual | ~nmrPolynomialBase () |
|
VariableIndexType | GetNumVariables () const |
|
PowerType | GetMinDegree () const |
|
PowerType | GetMaxDegree () const |
|
TermCounterType | GetMaxNumberOfTerms () const |
|
bool | CanIncludeIndex (const nmrPolynomialTermPowerIndex &term) const |
|
virtual CoefficientType | GetCoefficient (const nmrPolynomialTermPowerIndex &CMN_UNUSED(where)) const |
|
ValueType | EvaluateTerm (const nmrPolynomialTermPowerIndex &where, const nmrMultiVariablePowerBasis &variables) const |
|
ValueType | EvaluateTerm (const nmrPolynomialTermPowerIndex &where, const nmrMultiVariablePowerBasis &variables, CoefficientType coefficient) const |
|
void CISST_DEPRECATED | ScaleCoefficients (CoefficientType coefficients[], CoefficientType scaleFactor) const |
|
class nmrStandardPolynomial represents a polynomial in standard (power) basis. Each term consists of a power index and a coefficient. The structure of nmrStandardPolynomial is based on nmrPolynomialContainer, and it implements the required methods in a straightforward way.
Note: some methods include assertions. To avoid including the <assert.h> header file by all the files that use polynomials, I put these methods, and some which were more than one-liners, in the .cpp file. But in every practical way, nmrStandardPolynomial could be implemented completely as inline.
Note: We use dynamic allocation for the term information (Coefficient), which is separate from the STL provided dynamic allocation for the container elements. We store the pointer to the dynamically allocated term info in the container. Therefore:
- We had to override the base-class's RemoveTerm() and Clear() methods.
- Do not even try to make a copy of a nmrBernsteinPolynomial using copy-ctor or operator= (yeah, like you would). Just for safety, we declare these operations protected, and do not provide implementation.
- A better solution may be to define a common base type for TermInfo, and have it declare a virtual dtor. Go for it, if you have time.