cisst-saw
Loading...
Searching...
No Matches
nmrBernsteinPolynomial.h File Reference

Go to the source code of this file.

Functions

 nmrBernsteinPolynomial (VariableIndexType numVariables, PowerType degree)
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
const nmrPolynomialTermPowerIndex::MultinomialCoefficientTypeGetMultinomialCoefficient (const TermIteratorType &where) const
const nmrPolynomialTermPowerIndex::MultinomialCoefficientTypeGetMultinomialCoefficient (const TermConstIteratorType &where) const
nmrPolynomialTermPowerIndex::MultinomialCoefficientTypeRefMultinomialCoefficient (const TermIteratorType &where)
const CoefficientType & GetTermCoefficient (const TermConstIteratorType &where) const
const CoefficientType & GetTermCoefficient (const TermIteratorType &where) const
CoefficientType & RefTermCoefficient (const TermIteratorType &where)

Function Documentation

◆ AddConstant()

virtual void AddConstant ( CoefficientType shiftAmount)
virtual

Overloaded from nmrPolynomialBase. This implementation goes over all the possible for this polynomial, reads their current coefficient (which may be zero if the term is not included so far) then adds the given shift amount. It may not be the most efficient method, but it should not be called too many times.

◆ AddConstantToCoefficients()

virtual void AddConstantToCoefficients ( CoefficientType coefficients[],
CoefficientType shiftAmount ) const
virtual

Overloaded from nmrPolynomialBase. This implementation asserts that this polynomial contains all the possible terms, and then iterates on all the terms and adds the shift amount to the corresponding external coefficient.

◆ Clear()

virtual void Clear ( )
virtual

Remove all the terms to make an empty (zero) polynomial We cannot use nmrPolynomialContainer::Clear(), since it does not reclaim the space allocated for the term. This implementation does.

◆ DeserializeTermInfo()

virtual void DeserializeTermInfo ( std::istream & input,
TermIteratorType & termIterator )
virtual

This function is overridden to allocate memory for the multinomial factor and the term coefficient, read the latter from the stream and calculate the former from the term power index. It is called from nmrPolynomialContainer::DeserializeRaw().

◆ EvaluateBasis() [1/3]

virtual ValueType EvaluateBasis ( const nmrPolynomialTermPowerIndex & where,
const nmrMultiVariablePowerBasis & variables ) const
virtual

Evaluate the basis function for a term. This DOES NOT include the term's coefficient, but DOES include the multinomial factor.

◆ EvaluateBasis() [2/3]

virtual ValueType EvaluateBasis ( const TermConstIteratorType & where,
const nmrMultiVariablePowerBasis & variables ) const
virtual

◆ EvaluateBasis() [3/3]

virtual ValueType EvaluateBasis ( const TermIteratorType & where,
const nmrMultiVariablePowerBasis & variables ) const
virtual

◆ GetCoefficient() [1/3]

virtual CoefficientType GetCoefficient ( const nmrPolynomialTermPowerIndex & where) const
virtual

Retrieve the value of the user defined coefficient for a given term.

◆ GetCoefficient() [2/3]

virtual CoefficientType GetCoefficient ( const TermConstIteratorType & where) const
virtual

Retrieve the value of the user defined coefficient for a term given by iterator.

◆ GetCoefficient() [3/3]

virtual CoefficientType GetCoefficient ( const TermIteratorType & where) const
virtual

◆ GetMultinomialCoefficient() [1/2]

const nmrPolynomialTermPowerIndex::MultinomialCoefficientType & GetMultinomialCoefficient ( const TermConstIteratorType & where) const

◆ GetMultinomialCoefficient() [2/2]

const nmrPolynomialTermPowerIndex::MultinomialCoefficientType & GetMultinomialCoefficient ( const TermIteratorType & where) const

◆ GetTermCoefficient() [1/2]

const CoefficientType & GetTermCoefficient ( const TermConstIteratorType & where) const
protected

◆ GetTermCoefficient() [2/2]

const CoefficientType & GetTermCoefficient ( const TermIteratorType & where) const
protected

◆ RefMultinomialCoefficient()

nmrPolynomialTermPowerIndex::MultinomialCoefficientType & RefMultinomialCoefficient ( const TermIteratorType & where)
protected

◆ RefTermCoefficient()

CoefficientType & RefTermCoefficient ( const TermIteratorType & where)
protected

◆ RemoveTerm()

virtual void RemoveTerm ( TermIteratorType & where)
virtual

Remove a term from the polynomial. The term is given by iterator. The function also reclaims the space allocated for the term.

◆ SerializeTermInfo()

virtual void SerializeTermInfo ( std::ostream & output,
const TermConstIteratorType & termIterator ) const
virtual

This function is overridden to store the term coefficient to the stream. It is called from nmrPolynomialContainer::SerializeRaw().

◆ SetCoefficient() [1/2]

virtual InsertStatus SetCoefficient ( const nmrPolynomialTermPowerIndex & where,
CoefficientType coefficient )
virtual

Overriding nmrPolynomial::SetCoefficient(). This implementation computes the multinomial factor for the term.

◆ SetCoefficient() [2/2]

virtual InsertStatus SetCoefficient ( TermIteratorType & where,
CoefficientType coefficient )
virtual

Set a coefficient for the given term iterator. Implemented from nmrPolynomialContainer.