GiNaCRA
0.6.4
|
A class for a multivariate monomial providing a degree-based representation. More...
#include <MultivariateMonomialMR.h>
Public Member Functions | |
MultivariateMonomialMR () | |
MultivariateMonomialMR (unsigned nrVars) | |
Preallocates space for . | |
MultivariateMonomialMR (unsigned varIndex, int exponent) | |
Creates a monomial over a single variable;. | |
MultivariateMonomialMR (vui_cIt vecBegin, vui_cIt vecEnd) | |
A vector of pairs with indices and matching exponents. | |
unsigned | tdeg () const |
bool | constant () const |
GiNaC::ex | toEx () const |
Static Public Member Functions | |
static const MultivariateMonomialMR | lcm (const MultivariateMonomialMR &m1, const MultivariateMonomialMR &m2) |
Computes the least common multiple of the two parameters. | |
static bool | LexCompare (const MultivariateMonomialMR &m1, const MultivariateMonomialMR &m2) |
static bool | GrLexCompare (const MultivariateMonomialMR &m1, const MultivariateMonomialMR &m2) |
static bool | GrRevLexCompare (const MultivariateMonomialMR &m1, const MultivariateMonomialMR &m2) |
Private Attributes | |
std::vector< std::pair < unsigned, unsigned > > | mExponents |
maps the variable x_k to the exponent | |
unsigned | mTotDeg |
we need the total degree that often that we better save it. | |
Friends | |
class | MultivariateTermMR |
const MultivariateMonomialMR | operator* (const MultivariateMonomialMR &m1, const MultivariateMonomialMR &m2) |
const MultivariateMonomialMR | operator/ (const MultivariateMonomialMR &nom, const MultivariateMonomialMR &denom) |
bool | operator!= (const MultivariateMonomialMR &lhs, const MultivariateMonomialMR &rhs) |
bool | operator== (const MultivariateMonomialMR &lhs, const MultivariateMonomialMR &rhs) |
std::ostream & | operator<< (std::ostream &os, const MultivariateMonomialMR &rhs) |
A class for a multivariate monomial providing a degree-based representation.
Notation is following http://www.possibility.com/Cpp/CppCodingStandard.html.
Definition at line 51 of file MultivariateMonomialMR.h.
Definition at line 55 of file MultivariateMonomialMR.cpp.
GiNaCRA::MultivariateMonomialMR::MultivariateMonomialMR | ( | unsigned | nrVars | ) |
Preallocates space for .
. vars.
nrVars |
Definition at line 60 of file MultivariateMonomialMR.cpp.
References mExponents.
GiNaCRA::MultivariateMonomialMR::MultivariateMonomialMR | ( | unsigned | varIndex, |
int | exponent | ||
) |
Creates a monomial over a single variable;.
varIndex | the index of the variable in the global list. |
exponent | the exponent |
Definition at line 67 of file MultivariateMonomialMR.cpp.
References mTotDeg.
GiNaCRA::MultivariateMonomialMR::MultivariateMonomialMR | ( | vui_cIt | vecBegin, |
vui_cIt | vecEnd | ||
) |
A vector of pairs with indices and matching exponents.
It is assumed that each variable occurs only once.
vecBegin | |
vecEnd |
Definition at line 73 of file MultivariateMonomialMR.cpp.
References GiNaCRA::compare_first(), mExponents, mTotDeg, and GiNaCRA::sort_first().
bool GiNaCRA::MultivariateMonomialMR::constant | ( | ) | const [inline] |
Definition at line 87 of file MultivariateMonomialMR.h.
References tdeg().
bool GiNaCRA::MultivariateMonomialMR::GrLexCompare | ( | const MultivariateMonomialMR & | m1, |
const MultivariateMonomialMR & | m2 | ||
) | [static] |
m1 | |
m2 |
Definition at line 211 of file MultivariateMonomialMR.cpp.
References LexCompare(), and tdeg().
Referenced by GiNaCRA::MonomMRCompare::MonomMRCompare().
bool GiNaCRA::MultivariateMonomialMR::GrRevLexCompare | ( | const MultivariateMonomialMR & | m1, |
const MultivariateMonomialMR & | m2 | ||
) | [static] |
m1 | |
m2 |
Definition at line 222 of file MultivariateMonomialMR.cpp.
References LexCompare(), and tdeg().
const MultivariateMonomialMR GiNaCRA::MultivariateMonomialMR::lcm | ( | const MultivariateMonomialMR & | m1, |
const MultivariateMonomialMR & | m2 | ||
) | [static] |
Computes the least common multiple of the two parameters.
m1 | |
m2 |
Definition at line 91 of file MultivariateMonomialMR.cpp.
References mExponents, and tdeg().
bool GiNaCRA::MultivariateMonomialMR::LexCompare | ( | const MultivariateMonomialMR & | m1, |
const MultivariateMonomialMR & | m2 | ||
) | [static] |
m1 | |
m2 |
Definition at line 177 of file MultivariateMonomialMR.cpp.
References mExponents, and tdeg().
Referenced by GrLexCompare(), and GrRevLexCompare().
unsigned GiNaCRA::MultivariateMonomialMR::tdeg | ( | ) | const [inline] |
Definition at line 82 of file MultivariateMonomialMR.h.
References mTotDeg.
Referenced by constant(), GiNaCRA::MultivariateTermMR::divby(), GrLexCompare(), GrRevLexCompare(), lcm(), GiNaCRA::MultivariateTermMR::lcmdivt(), and LexCompare().
GiNaC::ex GiNaCRA::MultivariateMonomialMR::toEx | ( | ) | const |
Reimplemented in GiNaCRA::MultivariateTermMR.
Definition at line 81 of file MultivariateMonomialMR.cpp.
References GiNaCRA::VariableListPool::getVariableSymbol(), and mExponents.
Referenced by GiNaCRA::MultivariateTermMR::toEx().
friend class MultivariateTermMR [friend] |
Definition at line 54 of file MultivariateMonomialMR.h.
bool operator!= | ( | const MultivariateMonomialMR & | lhs, |
const MultivariateMonomialMR & | rhs | ||
) | [friend] |
Definition at line 162 of file MultivariateMonomialMR.cpp.
const MultivariateMonomialMR operator* | ( | const MultivariateMonomialMR & | m1, |
const MultivariateMonomialMR & | m2 | ||
) | [friend] |
Definition at line 233 of file MultivariateMonomialMR.cpp.
const MultivariateMonomialMR operator/ | ( | const MultivariateMonomialMR & | nom, |
const MultivariateMonomialMR & | denom | ||
) | [friend] |
std::ostream& operator<< | ( | std::ostream & | os, |
const MultivariateMonomialMR & | rhs | ||
) | [friend] |
Definition at line 167 of file MultivariateMonomialMR.cpp.
bool operator== | ( | const MultivariateMonomialMR & | lhs, |
const MultivariateMonomialMR & | rhs | ||
) | [friend] |
Definition at line 155 of file MultivariateMonomialMR.cpp.
std::vector<std::pair<unsigned, unsigned> > GiNaCRA::MultivariateMonomialMR::mExponents [private] |
maps the variable x_k to the exponent
Definition at line 145 of file MultivariateMonomialMR.h.
Referenced by GiNaCRA::MultivariateTermMR::divby(), GiNaCRA::MultivariateTermMR::dividable(), GiNaCRA::MultivariateTermMR::hasEqualExponents(), lcm(), GiNaCRA::MultivariateTermMR::lcmdivt(), LexCompare(), MultivariateMonomialMR(), GiNaCRA::operator*(), GiNaCRA::operator<<(), GiNaCRA::operator==(), and toEx().
unsigned GiNaCRA::MultivariateMonomialMR::mTotDeg [private] |
we need the total degree that often that we better save it.
Definition at line 147 of file MultivariateMonomialMR.h.
Referenced by GiNaCRA::MultivariateTermMR::divby(), GiNaCRA::MultivariateTermMR::dividable(), GiNaCRA::MultivariateTermMR::hasEqualExponents(), MultivariateMonomialMR(), GiNaCRA::operator*(), GiNaCRA::operator==(), and tdeg().