22 #ifndef _nmrBernsteinPolynomial_h
23 #define _nmrBernsteinPolynomial_h
74 #ifdef CISST_COMPILER_IS_MSVC
76 #pragma warning(disable:4996)
77 #endif // ifdef CISST_COMPILER_IS_MSVC
90 :
BaseType(numVariables, degree, degree)
92 , PowerBasis(numVariables, degree, numVariables - 1)
95 #if INCLUDE_DEPRECATED_POLYNOMIAL_CODE
96 VariablePowers = &PowerBasis;
97 #endif // INCLUDE_DEPRECATED_POLYNOMIAL_CODE
100 #if INCLUDE_DEPRECATED_POLYNOMIAL_CODE
109 PowerBasis.SetVariables(values);
115 virtual void CISST_DEPRECATED SetVariable(VariableIndexType varIndex, VariableType value)
117 PowerBasis.SetVariable(varIndex, value);
121 virtual bool CISST_DEPRECATED CanSetVariable(VariableIndexType varIndex)
const
123 return ( (0 <= varIndex) &&
125 (varIndex != GetImplicitVarIndex()) );
131 return PowerBasis.GetImplicitVariable();
137 return PowerBasis.GetImplicitVarIndex();
143 PowerBasis.SetImplicitVarIndex(newIndex);
145 #ifdef CISST_COMPILER_IS_MSVC
147 #endif // ifdef CISST_COMPILER_IS_MSVC
148 #endif // INCLUDE_DEPRECATED_POLYNOMIAL_CODE
153 CoefficientType coefficient);
157 virtual InsertStatus
SetCoefficient(TermIteratorType & where, CoefficientType coefficient);
164 {
return GetTermCoefficient(where); }
166 {
return GetTermCoefficient(where); }
171 virtual void RemoveTerm(TermIteratorType & where);
177 virtual void Clear();
184 virtual ValueType
EvaluateBasis(
const TermConstIteratorType & where,
186 virtual ValueType
EvaluateBasis(
const TermIteratorType & where,
193 virtual void SerializeTermInfo(std::ostream & output,
const TermConstIteratorType & termIterator)
const;
209 virtual void AddConstant(CoefficientType shiftAmount);
217 CoefficientType shiftAmount)
const;
254 #if INCLUDE_DEPRECATED_POLYNOMIAL_CODE
256 #endif // INCLUDE_DEPRECATED_POLYNOMIAL_CODE
261 #endif // _nmrBernsteinPolynomial_h
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
TermContainerType::iterator TermIteratorType
Definition: nmrPolynomialContainer.h:74
const nmrPolynomialTermPowerIndex::MultinomialCoefficientType & GetMultinomialCoefficient(const TermIteratorType &where) const
Definition: nmrBernsteinPolynomial.h:220
virtual void AddConstant(CoefficientType shiftAmount)=0
const CoefficientType & GetTermCoefficient(const TermConstIteratorType &where) const
Definition: nmrBernsteinPolynomial.h:239
const CoefficientType & GetTermCoefficient(const TermIteratorType &where) const
Definition: nmrBernsteinPolynomial.h:244
#define CISST_DEPRECATED
Definition: cmnPortability.h:310
VariableIndexType GetNumVariables() const
Definition: nmrPolynomialBase.h:69
virtual void SerializeTermInfo(std::ostream &output, const TermConstIteratorType &termIterator) const =0
Definition: nmrBernsteinPolynomial.h:66
virtual void DeserializeTermInfo(std::istream &input, TermIteratorType &termIterator)=0
nmrPolynomialTermPowerIndex::PowerType PowerType
Definition: nmrPolynomialBase.h:58
TermContainerType::const_iterator TermConstIteratorType
Definition: nmrPolynomialContainer.h:75
virtual void AddConstantToCoefficients(CoefficientType coefficients[], CoefficientType shiftAmount) const =0
virtual ValueType EvaluateBasis(const TermConstIteratorType &where, const nmrMultiVariablePowerBasis &variables) const =0
virtual InsertStatus SetCoefficient(const nmrPolynomialTermPowerIndex &where, CoefficientType coefficient)=0
nmrPolynomialTermPowerIndex::MultinomialCoefficientType & RefMultinomialCoefficient(const TermIteratorType &where)
Definition: nmrBernsteinPolynomial.h:234
virtual CoefficientType GetCoefficient(const TermConstIteratorType &where) const
Definition: nmrBernsteinPolynomial.h:163
virtual CoefficientType GetCoefficient(const TermIteratorType &where) const
Definition: nmrBernsteinPolynomial.h:165
BarycentricBasis(VariableIndexType numVariables, PowerType maxPower, VariableIndexType implicitVarIndex=-1)
Definition: nmrDynAllocPolynomialContainer.h:28
double CoefficientType
Definition: nmrPolynomialBase.h:56
nmrPolynomialTermPowerIndex::VariableIndexType VariableIndexType
Definition: nmrPolynomialBase.h:57
nmrBernsteinPolynomial(VariableIndexType numVariables, PowerType degree)
Definition: nmrBernsteinPolynomial.h:89
virtual CoefficientType GetCoefficient(const TermConstIteratorType &where) const =0
virtual void Clear()
Definition: nmrPolynomialContainer.h:291
unsigned long MultinomialCoefficientType
Definition: nmrPolynomialTermPowerIndex.h:101
Definition: nmrMultiVariablePowerBasis.h:37
std::pair< nmrPolynomialBase::CoefficientType, nmrPolynomialTermPowerIndex::MultinomialCoefficientType > BernsteinTermInfo
Definition: nmrBernsteinPolynomial.h:72
virtual void RemoveTerm(const nmrPolynomialTermPowerIndex &where)
Definition: nmrPolynomialContainer.h:276
Represents the power index of a single term in a multi-variable polynomial.
Definition: nmrPolynomialTermPowerIndex.h:89
CoefficientType & RefTermCoefficient(const TermIteratorType &where)
Definition: nmrBernsteinPolynomial.h:249
nmrDynAllocPolynomialContainer BaseType
Definition: nmrBernsteinPolynomial.h:69
const nmrPolynomialTermPowerIndex::MultinomialCoefficientType & GetMultinomialCoefficient(const TermConstIteratorType &where) const
Definition: nmrBernsteinPolynomial.h:226
#define INCLUDE_DEPRECATED_POLYNOMIAL_CODE
Definition: nmrPolynomialBase.h:37