GiNaCRA  0.6.4
GiNaCRA::MultivariateMonomialMR Class Reference

A class for a multivariate monomial providing a degree-based representation. More...

#include <MultivariateMonomialMR.h>

Inheritance diagram for GiNaCRA::MultivariateMonomialMR:
Collaboration diagram for GiNaCRA::MultivariateMonomialMR:

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)

Detailed Description

A class for a multivariate monomial providing a degree-based representation.

Author:
Sebastian Junges
Since:
2010-11-26
Version:
2011-12-15
See also:
ISBN 0-387-94090-1 and ISBN-13: 978-3642069642

Notation is following http://www.possibility.com/Cpp/CppCodingStandard.html.

Definition at line 51 of file MultivariateMonomialMR.h.


Constructor & Destructor Documentation

Preallocates space for .

. vars.

Parameters:
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;.

Parameters:
varIndexthe index of the variable in the global list.
exponentthe exponent

Definition at line 67 of file MultivariateMonomialMR.cpp.

References mTotDeg.

A vector of pairs with indices and matching exponents.

It is assumed that each variable occurs only once.

Parameters:
vecBegin
vecEnd

Definition at line 73 of file MultivariateMonomialMR.cpp.

References GiNaCRA::compare_first(), mExponents, mTotDeg, and GiNaCRA::sort_first().


Member Function Documentation

Definition at line 87 of file MultivariateMonomialMR.h.

References tdeg().

Parameters:
m1
m2
Returns:
true iff m1 < m2

Definition at line 211 of file MultivariateMonomialMR.cpp.

References LexCompare(), and tdeg().

Referenced by GiNaCRA::MonomMRCompare::MonomMRCompare().

Parameters:
m1
m2
Returns:
true iff m1 < m2

Definition at line 222 of file MultivariateMonomialMR.cpp.

References LexCompare(), and tdeg().

Computes the least common multiple of the two parameters.

Parameters:
m1
m2
Returns:
A monomial representing the least common multiple

Definition at line 91 of file MultivariateMonomialMR.cpp.

References mExponents, and tdeg().

Parameters:
m1
m2
Returns:
true, iff 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]
Returns:
the total degree, the sum of the exponents.
Runtime complexity:
constant

Definition at line 82 of file MultivariateMonomialMR.h.

References mTotDeg.

Referenced by constant(), GiNaCRA::MultivariateTermMR::divby(), GrLexCompare(), GrRevLexCompare(), lcm(), GiNaCRA::MultivariateTermMR::lcmdivt(), and LexCompare().

Returns:
an expression representing the monomial

Reimplemented in GiNaCRA::MultivariateTermMR.

Definition at line 81 of file MultivariateMonomialMR.cpp.

References GiNaCRA::VariableListPool::getVariableSymbol(), and mExponents.

Referenced by GiNaCRA::MultivariateTermMR::toEx().


Friends And Related Function Documentation

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.


Field Documentation


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