#include <nmrPolynomialBase.h>
|
| nmrPolynomialBase (VariableIndexType numVariables, PowerType minDegree, PowerType maxDegree) |
|
virtual | ~nmrPolynomialBase () |
|
VariableIndexType | GetNumVariables () const |
|
PowerType | GetMinDegree () const |
|
PowerType | GetMaxDegree () const |
|
virtual TermCounterType | GetNumberOfTerms () const =0 |
|
TermCounterType | GetMaxNumberOfTerms () const |
|
virtual bool | IsEmpty () const =0 |
|
virtual void | SetMinDegree (PowerType newMin)=0 throw (std::runtime_error) |
|
virtual void | SetMaxDegree (PowerType newMax)=0 throw (std::runtime_error) |
|
virtual void | FillAllTerms ()=0 |
|
bool | CanIncludeIndex (const nmrPolynomialTermPowerIndex &term) const |
|
virtual bool | IncludesIndex (const nmrPolynomialTermPowerIndex &target) const =0 |
|
virtual TermCounterType | GetIndexPosition (const nmrPolynomialTermPowerIndex &term) const =0 |
|
virtual void | RemoveTerm (const nmrPolynomialTermPowerIndex &where)=0 |
|
virtual void | Clear ()=0 |
|
virtual InsertStatus | SetCoefficient (const nmrPolynomialTermPowerIndex &where, CoefficientType coefficient)=0 |
|
virtual CoefficientType | GetCoefficient (const nmrPolynomialTermPowerIndex &CMN_UNUSED(where)) const |
|
virtual void | CollectCoefficients (CoefficientType source[]) const =0 |
|
virtual void | RestoreCoefficients (const CoefficientType source[])=0 |
|
virtual ValueType | EvaluateBasis (const nmrPolynomialTermPowerIndex &where, const nmrMultiVariablePowerBasis &variables) const =0 |
|
ValueType | EvaluateTerm (const nmrPolynomialTermPowerIndex &where, const nmrMultiVariablePowerBasis &variables) const |
|
ValueType | EvaluateTerm (const nmrPolynomialTermPowerIndex &where, const nmrMultiVariablePowerBasis &variables, CoefficientType coefficient) const |
|
virtual void | EvaluateBasisVector (const nmrMultiVariablePowerBasis &variables, ValueType termBaseValues[]) const =0 |
|
virtual ValueType | EvaluateForCoefficients (const nmrMultiVariablePowerBasis &variables, const CoefficientType coefficients[]) const =0 |
|
virtual ValueType | Evaluate (const nmrMultiVariablePowerBasis &variables) const =0 |
|
virtual void | Scale (CoefficientType scaleFactor)=0 |
|
void CISST_DEPRECATED | ScaleCoefficients (CoefficientType coefficients[], CoefficientType scaleFactor) const |
|
virtual void | AddConstant (CoefficientType shiftAmount)=0 |
|
virtual void | AddConstantToCoefficients (CoefficientType coefficients[], CoefficientType shiftAmount) const =0 |
|
virtual void | SerializeRaw (std::ostream &output) const |
|
virtual void | DeserializeRaw (std::istream &input) |
|
Enumerator |
---|
INSERT_FAIL |
|
INSERT_NEW |
|
INSERT_REPLACE |
|
virtual nmrPolynomialBase::~nmrPolynomialBase |
( |
| ) |
|
|
inlinevirtual |
Add a constant value to this polynomial. That is, if p is a polynomial and s is a constant then the following returns true: ValueType v0 = p.Evaluate(); p.AddConstant(s); ValueType v1 = p.Evaluate(); v1 - v0 == s // up to floating point precision error
- Note
- the implementation varies between different representations of the polynomial. Specifically, terms may be added to this polynomial to support the addition of the constant.
Implemented in nmrPolynomialContainer< _TermInfo >, nmrPolynomialContainer< void * >, nmrBernsteinPolynomial, and nmrStandardPolynomial.
Modify external coefficients so that they evaluate a new polynomial shifted by a constant amount. That is, if p is a polynomial, c is an array of external coefficients, and s is a constant, the following returns true: ValueType v0 = p.EvaluateForCoefficients(c); p.AddConstantToCoefficients(c, s); ValueType v1 = p.EvaluateForCoefficients(c); v1 - v0 == s; // up to floating point precision error
- Note
- The implementation of this function may vary based on the representation of the polynomial. In particular, for a Bernstein polynomial it requires that all possible terms be present in the polynomial and in the coefficients correspondingly. For a standard polynomial, it requires that this polynomial actually contains a term of power zero.
-
The current implementations assert that this polynomial and the external coefficients meet the preconditions for the operation. That is, we do not throw an exception but rather issue an assertion error.
Implemented in nmrPolynomialContainer< _TermInfo >, nmrPolynomialContainer< void * >, nmrBernsteinPolynomial, and nmrStandardPolynomial.
virtual void nmrPolynomialBase::Clear |
( |
| ) |
|
|
pure virtual |
virtual void nmrPolynomialBase::CollectCoefficients |
( |
CoefficientType |
source[] | ) |
const |
|
pure virtual |
virtual void nmrPolynomialBase::DeserializeRaw |
( |
std::istream & |
input | ) |
|
|
virtual |
Evaluate the basis function for a term. The term is regarded as a list of powers, without any user defined coefficient. However, for different families of polynomial the set of basis functions are different. For example, Bezier polynomials have the multinomial coefficient in addition to each user defined coefficient. Implemented for each concrete polynomial class.
Implemented in nmrBernsteinPolynomial, and nmrStandardPolynomial.
Evaluate a single term at the point specified by the `variables' argument, including the basis function and the term's coefficient. This function uses the internally stored coefficient.
Evaluate a single term at the point specified by the `variables' argument, including the basis function and the term's coefficient. This function takes the coefficient as a parameter.
virtual void nmrPolynomialBase::FillAllTerms |
( |
| ) |
|
|
pure virtual |
PowerType nmrPolynomialBase::GetMaxDegree |
( |
| ) |
const |
|
inline |
PowerType nmrPolynomialBase::GetMinDegree |
( |
| ) |
const |
|
inline |
virtual bool nmrPolynomialBase::IsEmpty |
( |
| ) |
const |
|
pure virtual |
virtual void nmrPolynomialBase::RestoreCoefficients |
( |
const CoefficientType |
source[] | ) |
|
|
pure virtual |
Scale a given set of external coefficients which correspond to the terms of this polynomial. Basically, it means multiplying them all by the scale factor.
- Parameters
-
coefficients | [i/o] the external coefficients to be scales (in place). |
scaleFactor | the scaling factor. |
- Note
- this function is not declared virtual, as it seems to behave uniformly for all types of polynomial representations we use. But it may have to be declared virtual eventually. Technically, it could be declared static, but I find it too far fetched.
-
The same rules that apply to evaluating the polynomial for external coefficients apply here as well.
-
the function is declared as deprecated. Generally, using the Multiply operation on cisstVector containers of coefficients should be prefered.
virtual void nmrPolynomialBase::SerializeRaw |
( |
std::ostream & |
output | ) |
const |
|
virtual |
virtual void nmrPolynomialBase::SetMaxDegree |
( |
PowerType |
newMax | ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
pure virtual |
virtual void nmrPolynomialBase::SetMinDegree |
( |
PowerType |
newMin | ) |
|
throw | ( | std::runtime_error |
| ) | | |
|
pure virtual |
The documentation for this class was generated from the following file: