cisst-saw
Loading...
Searching...
No Matches
nmrMultiVariablePowerBasis Class Referenceabstract

#include <nmrMultiVariablePowerBasis.h>

Inheritance diagram for nmrMultiVariablePowerBasis:
nmrMultiVariablePowerBasis::BarycentricBasis nmrMultiVariablePowerBasis::StandardPowerBasis

Classes

class  StandardPowerBasis
class  BarycentricBasis

Public Types

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

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

Protected Types

typedef vctDynamicMatrix< VariableTypeBasisContainerType

Protected Member Functions

void PrivateSetVariable (VariableIndexType varIndex, VariableType value)

Protected Attributes

BasisContainerType BasisContainer

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

◆ BasisContainerType

◆ PowerType

◆ ValueType

◆ VariableIndexType

◆ VariableType

Constructor & Destructor Documentation

◆ nmrMultiVariablePowerBasis()

nmrMultiVariablePowerBasis::nmrMultiVariablePowerBasis ( VariableIndexType numVariables,
PowerType maxPower )
inline

◆ ~nmrMultiVariablePowerBasis()

virtual nmrMultiVariablePowerBasis::~nmrMultiVariablePowerBasis ( )
inlinevirtual

Member Function Documentation

◆ CanSetVariable()

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().

Implemented in nmrMultiVariablePowerBasis::BarycentricBasis, and nmrMultiVariablePowerBasis::StandardPowerBasis.

◆ EvaluatePowerProduct()

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.

◆ GetMaxDegree()

PowerType nmrMultiVariablePowerBasis::GetMaxDegree ( ) const
inline

◆ GetNumVariables()

VariableIndexType nmrMultiVariablePowerBasis::GetNumVariables ( ) const
inline

◆ GetSumOfVariables()

VariableType nmrMultiVariablePowerBasis::GetSumOfVariables ( ) const
inline

Return the sum of all the variables

◆ GetVariable()

VariableType nmrMultiVariablePowerBasis::GetVariable ( VariableIndexType variableIndex) const
inline

◆ GetVariablePower()

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

Return a specific power of a specific variable

◆ GetVariables()

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

Retrieve the values of the variables at the current point

◆ Initialize()

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.

◆ PrivateSetVariable()

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

Actually set the value of a variable by index

◆ SetVariable()

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

◆ SetVariables()

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

Implemented in nmrMultiVariablePowerBasis::BarycentricBasis, and nmrMultiVariablePowerBasis::StandardPowerBasis.

Member Data Documentation

◆ BasisContainer

BasisContainerType nmrMultiVariablePowerBasis::BasisContainer
protected

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