27#ifndef _nmrPolynomialTermPowerIndex_h
28#define _nmrPolynomialTermPowerIndex_h
41#ifndef DEFINE_FORMATTED_OUTPUT
42#define DEFINE_FORMATTED_OUTPUT 0
138 if (newMax < this->
Degree) {
139 throw std::runtime_error(
"nmrPolynomialTermPowerIndex: Attempt to set max degree below current degree");
142 throw std::runtime_error(
"nmrPolynomialTermPowerIndex: Attempt to set max degree below set minimum");
149 if (newMin > this->
Degree) {
150 throw std::runtime_error(
"nmrPolynomialTermPowerIndex: Attempt to set min degree above current degree");
153 throw std::runtime_error(
"nmrPolynomialTermPowerIndex: Attempt to set max degree above set maximum");
189 return reinterpret_cast<const int *
>(
GetPowers());
292 return (this->
Compare(other) < 0);
301 return (other < *
this);
306 return (this->
Compare(other) <= 0);
311 return (other <= *
this);
389#if DEFINE_FORMATTED_OUTPUT
398 char * FormatPowers(
char * buffer,
const char * widthFormat =
"%d")
const;
402#if DEFINE_FORMATTED_OUTPUT
406 char * FormatTermIndex(
char * buffer,
const char * widthFormat =
"%d")
const;
409#if DEFINE_FORMATTED_OUTPUT
412 int CalculateFormatPowerLength(
const char * widthFormat =
"%d")
const
416 int varLength = strlen(buff) + 1;
Definition nmrPolynomialBase.h:52
std::vector< PowerType > Powers
Definition nmrPolynomialTermPowerIndex.h:445
int GetDegree() const
Definition nmrPolynomialTermPowerIndex.h:121
PowerType GetPower(VariableIndexType variable) const
Definition nmrPolynomialTermPowerIndex.h:175
unsigned long MultinomialCoefficientType
Definition nmrPolynomialTermPowerIndex.h:101
PowerType MinDegree
Definition nmrPolynomialTermPowerIndex.h:446
bool IsEnd() const
Definition nmrPolynomialTermPowerIndex.h:265
PowerType GetMaxDegree() const
Definition nmrPolynomialTermPowerIndex.h:126
nmrPolynomialTermPowerIndex(VariableIndexType numVariables=1, PowerType minDegree=0, PowerType maxDegree=4)
void SetMaxDegree(PowerType newMax) CISST_THROW(std
Definition nmrPolynomialTermPowerIndex.h:136
int Degree
Definition nmrPolynomialTermPowerIndex.h:453
int PowerType
Definition nmrPolynomialTermPowerIndex.h:98
int Compare(const nmrPolynomialTermPowerIndex &other) const
bool IsBegin() const
Definition nmrPolynomialTermPowerIndex.h:259
VariableIndexType GetNumVariables() const
Definition nmrPolynomialTermPowerIndex.h:166
MultinomialCoefficientType GetMultinomialCoefficient() const
Definition nmrPolynomialTermPowerIndex.h:343
void DeserializeRaw(std::istream &input)
static MultinomialCoefficientType EvaluateMultinomialCoefficient(VariableIndexType numIndices, PowerType chooseFrom, const PowerType indices[])
PowerType MaxDegree
Definition nmrPolynomialTermPowerIndex.h:447
nmrPolynomialTermPowerIndex(const nmrPolynomialBase &p)
void SetPower(VariableIndexType variable, PowerType power)
Definition nmrPolynomialTermPowerIndex.h:196
const int * GetPowersAsSigned() const
Definition nmrPolynomialTermPowerIndex.h:187
void SetPowers(const PowerType powers[])
Definition nmrPolynomialTermPowerIndex.h:203
void SetMinDegree(PowerType newMin) CISST_THROW(std
Definition nmrPolynomialTermPowerIndex.h:147
void SerializeRaw(std::ostream &output) const
MultinomialCoefficientType CountLowerOrderTerms() const
bool IsValid() const
Definition nmrPolynomialTermPowerIndex.h:161
void CopyPowers(const nmrPolynomialTermPowerIndex &other)
PowerType GetMinDegree() const
Definition nmrPolynomialTermPowerIndex.h:131
int VariableIndexType
Definition nmrPolynomialTermPowerIndex.h:95
MultinomialCoefficientType CountPowerCombinations() const
void SerializeIndexRaw(std::ostream &output) const
void SetDegree(PowerType degree)
MultinomialCoefficientType GetMultinomialCoefficient(PowerType d) const
Definition nmrPolynomialTermPowerIndex.h:352
void DeserializeIndexRaw(std::istream &input)
const PowerType * GetPowers() const
Definition nmrPolynomialTermPowerIndex.h:181
static MultinomialCoefficientType EvaluateMultinomialCoefficient(VariableIndexType numIndices, const PowerType indices[])
#define CISST_EXPORT
Definition cmnExportMacros.h:50
Portability across compilers and operating systems tools.
#define CISST_THROW(exceptionParameter)
Somewhat portable compilation warning message. This works with very recent versions of gcc (4....
Definition cmnPortability.h:559
bool operator==(const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &otherMatrix) const
Definition vctDynamicConstMatrixBase.h:715