cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
nmrMultiVariablePowerBasis Class Referenceabstract

#include <nmrMultiVariablePowerBasis.h>

Inheritance diagram for nmrMultiVariablePowerBasis:

Public Types

typedef double VariableType
 
typedef
nmrPolynomialTermPowerIndex::PowerType 
PowerType
 
typedef
nmrPolynomialTermPowerIndex::VariableIndexType 
VariableIndexType
 
typedef VariableType ValueType
 
typedef nmrMultiVariablePowerBasis BaseType
 
typedef nmrMultiVariablePowerBasis BaseType
 

Public Member Functions

 nmrMultiVariablePowerBasis (VariableIndexType numVariables, PowerType maxPower)
 
virtual ~nmrMultiVariablePowerBasis ()
 
void Initialize (VariableIndexType numVariables, PowerType maxPower)
 
VariableIndexType GetNumVariables () const
 
PowerType GetMaxDegree () const
 
VariableType GetVariable (VariableIndexType variableIndex) const
 
void GetVariables (VariableType vars[]) const
 
VariableType GetSumOfVariables () const
 
VariableType GetVariablePower (VariableIndexType var, PowerType power) const
 
virtual void SetVariable (VariableIndexType varIndex, VariableType value)=0
 
virtual void SetVariables (const VariableType vars[])=0
 
virtual bool CanSetVariable (VariableIndexType varIndex) const =0
 
ValueType EvaluatePowerProduct (const PowerType powers[]) const
 
 StandardPowerBasis (VariableIndexType numVariables, PowerType maxPower)
 
virtual bool CanSetVariable (VariableIndexType varIndex) const
 
virtual void SetVariable (VariableIndexType varIndex, VariableType value)
 
virtual void SetVariables (VariableType const vars[])
 
 BarycentricBasis (VariableIndexType numVariables, PowerType maxPower, VariableIndexType implicitVarIndex=-1)
 
VariableType GetImplicitVariable () const
 
VariableIndexType GetImplicitVarIndex () const
 
void SetImplicitVarIndex (VariableIndexType newIndex)
 
virtual bool CanSetVariable (VariableIndexType varIndex) const
 
virtual void SetVariable (VariableIndexType varIndex, VariableType value)
 
virtual void SetVariables (VariableType const vars[])
 

Protected Types

typedef vctDynamicMatrix
< VariableType
BasisContainerType
 

Protected Member Functions

void PrivateSetVariable (VariableIndexType varIndex, VariableType value)
 

Protected Attributes

BasisContainerType BasisContainer
 
VariableIndexType ImplicitVarIndex
 

Detailed Description

This class represents the set of variables and variable powers that is used in evaluating a polynomial. The functionality was factored out of the original location in the polynomial class, so that the polynomial can serve as a term container, and passes by const reference to functions.

The SetVariable() and SetVariables() functions are declared virtual, to support various bases, such as standard basis and barycentric basis.

Member Typedef Documentation

Constructor & Destructor Documentation

nmrMultiVariablePowerBasis::nmrMultiVariablePowerBasis ( VariableIndexType  numVariables,
PowerType  maxPower 
)
inline
virtual nmrMultiVariablePowerBasis::~nmrMultiVariablePowerBasis ( )
inlinevirtual

Member Function Documentation

nmrMultiVariablePowerBasis::BarycentricBasis ( VariableIndexType  numVariables,
PowerType  maxPower,
VariableIndexType  implicitVarIndex = -1 
)
virtual bool nmrMultiVariablePowerBasis::CanSetVariable ( VariableIndexType  varIndex) const
pure virtual

Returns true if the value of variable indicated by the index can be set using SetVariable().

virtual bool nmrMultiVariablePowerBasis::CanSetVariable ( VariableIndexType  varIndex) const
inlinevirtual
virtual bool nmrMultiVariablePowerBasis::CanSetVariable ( VariableIndexType  varIndex) const
inlinevirtual
ValueType nmrMultiVariablePowerBasis::EvaluatePowerProduct ( const PowerType  powers[]) const

This function is provided for efficiency reasons. In some cases, such as computing integrals, the user would want to avoid the overhead of instantiating a nmrPolynomialTermPowerIndex and just evaluate the product, say, based on an external table. In these case, the user can call this quick-access method. Note that this method is not safe in general, since it does not perform validity checks on the input set of powers. It is specifically made for highest runtime efficiency – do not use it with untested code.

VariableType nmrMultiVariablePowerBasis::GetImplicitVariable ( ) const
inline

return the value of the implicit variable.

VariableIndexType nmrMultiVariablePowerBasis::GetImplicitVarIndex ( ) const
inline

return the index of the implicit variable

PowerType nmrMultiVariablePowerBasis::GetMaxDegree ( ) const
inline
VariableIndexType nmrMultiVariablePowerBasis::GetNumVariables ( ) const
inline
VariableType nmrMultiVariablePowerBasis::GetSumOfVariables ( ) const
inline

Return the sum of all the variables

VariableType nmrMultiVariablePowerBasis::GetVariable ( VariableIndexType  variableIndex) const
inline
VariableType nmrMultiVariablePowerBasis::GetVariablePower ( VariableIndexType  var,
PowerType  power 
) const
inline

Return a specific power of a specific variable

void nmrMultiVariablePowerBasis::GetVariables ( VariableType  vars[]) const
inline

Retrieve the values of the variables at the current point

void nmrMultiVariablePowerBasis::Initialize ( VariableIndexType  numVariables,
PowerType  maxPower 
)

This function initializes the all independent variables to zero and the degree to the given value. It is to be called during events such as serialization.

void nmrMultiVariablePowerBasis::PrivateSetVariable ( VariableIndexType  varIndex,
VariableType  value 
)
protected

Actually set the value of a variable by index

void nmrMultiVariablePowerBasis::SetImplicitVarIndex ( VariableIndexType  newIndex)
inline

choose which of the variables is the implicit one.

virtual void nmrMultiVariablePowerBasis::SetVariable ( VariableIndexType  varIndex,
VariableType  value 
)
pure virtual

Set the value of one variable

virtual void nmrMultiVariablePowerBasis::SetVariable ( VariableIndexType  varIndex,
VariableType  value 
)
inlinevirtual
virtual void nmrMultiVariablePowerBasis::SetVariable ( VariableIndexType  varIndex,
VariableType  value 
)
virtual
virtual void nmrMultiVariablePowerBasis::SetVariables ( const VariableType  vars[])
pure virtual

Set the values of the polynomial variables to a specific n-dimensional point. This enables to pre-calculate the power basis for future evaluations. Implemented for each concrete polynomial class

virtual void nmrMultiVariablePowerBasis::SetVariables ( VariableType const  vars[])
virtual
virtual void nmrMultiVariablePowerBasis::SetVariables ( VariableType const  vars[])
virtual
nmrMultiVariablePowerBasis::StandardPowerBasis ( VariableIndexType  numVariables,
PowerType  maxPower 
)
inline

Member Data Documentation

BasisContainerType nmrMultiVariablePowerBasis::BasisContainer
protected
VariableIndexType nmrMultiVariablePowerBasis::ImplicitVarIndex
protected

The documentation for this class was generated from the following file: