GiNaCRA
0.6.4
|
A class for a multivariate polynomial providing everything what a GiNaC expression of type polynomial is and, in addition, stores the variables of the polynomial (in lexicographic order) as well as the leading term in the variable with the maximal degree. More...
#include <MultivariatePolynomial.h>
Public Member Functions | |
MultivariatePolynomial () | |
Constructs a multivariate polynomial consisting of the standard variable defined in constants.h. | |
MultivariatePolynomial (const MultivariatePolynomial< monomialOrdering > &p) | |
Constructs a multivariate polynomial as copy of another one. | |
MultivariatePolynomial (const ex &p, const vector< symbol > &l) throw ( invalid_argument ) | |
Constructs a multivariate polynomial using graded degree lexicographic monomial ordering. | |
const vector< symbol > | Variables () const |
Selects the list of variables of the polynomial (ordered lexicographicly, not by degree!). | |
const symbol | Variable () const |
const list< ex > | CoefficientExs () const |
Selects the list of polynomial coefficients of this polynomial in the order by the constructor. | |
const list< ex > | MonomialExs () const |
Selects the list of monomials of this polynomial in the order by the constructor. | |
const bool | operator== (const MultivariatePolynomial< monomialOrdering > &) const |
const bool | operator!= (const MultivariatePolynomial< monomialOrdering > &) const |
const MultivariatePolynomial < monomialOrdering > & | operator= (const MultivariatePolynomial< monomialOrdering > &) |
const MultivariatePolynomial < monomialOrdering > & | operator= (const ex &) |
MultivariatePolynomial < monomialOrdering > | diff (const symbol &s, unsigned nth=1) const |
MultivariatePolynomial < monomialOrdering > | diff (const vector< symbol >::const_iterator i, unsigned nth=1) const |
MultivariatePolynomial < monomialOrdering > | trunc (const symbol &s) const |
Removes the leading term w.r.t. | |
MultivariatePolynomial < monomialOrdering > | trunc () const |
Removes the leading term. | |
const MultivariatePolynomial < monomialOrdering > | divideByLcoeff () const |
Normalizes the polynomial e.g. | |
int | degree (const symbol &s) const |
int | degree () const |
int | ldegree (const symbol &s) const |
The low-degree is the smallest exponent at the main variable occuring. | |
int | ldegree () const |
The low-degree is the smallest exponent at the main variable occuring. | |
int | tdegree () const |
The total degree of the polynomial is the maximum sum of degrees of each monomial. | |
int | tdegree (const symbol &s) const |
The total degree of the polynomial w.r.t. | |
const ex | lterm () const |
const ex | lcoeff () const |
const ex | coeff (const symbol &s, const unsigned int &n) const |
const ex | lcoeff (const symbol &s) const |
const ex | coeff (const ex &monomial) const throw ( invalid_argument ) |
const ex | lmon () const |
bool | isZero () const |
Returns true if the univariate polynomial is the zero polynomial, otherwise false. | |
bool | isConstant () const |
Returns true if the polynomial is constant in the given variables, otherwise false. | |
const MultivariatePolynomial < monomialOrdering > | reduction (const MultivariatePolynomial< monomialOrdering > &g, const ex &m) const throw ( invalid_argument ) |
Computes the reduction of this polynomial w.r.t. | |
const MultivariatePolynomial < monomialOrdering > | normalForm (const list< MultivariatePolynomial< monomialOrdering > > &gb) const throw ( invalid_argument ) |
Computes the normalform of this polynomial modulo gb. | |
const MultivariatePolynomial < monomialOrdering > | add (const MultivariatePolynomial< monomialOrdering > &o) const throw ( invalid_argument ) |
Adds two multivariate polynomials and returns a reference to their sum, allocated on the heap. | |
const MultivariatePolynomial < monomialOrdering > | minus () const |
Returns the negative value, allocated on the heap. | |
const MultivariatePolynomial < monomialOrdering > | mul (const MultivariatePolynomial< monomialOrdering > &o) const throw ( invalid_argument ) |
Multiplies two multivariate polynomials and returns a reference to their product, allocated on the heap. | |
const MultivariatePolynomial < monomialOrdering > | pow (const unsigned e) const throw ( invalid_argument ) |
Multiplies two multivariate polynomials and returns a reference to their product, allocated on the heap. | |
void | print (const print_context &c, unsigned level=0) const |
const vector< symbol > | mergeVariables (vector< symbol > l) const |
Merges this with the given symbol list into a new symbol list. | |
Protected Member Functions | |
const bool | isEqual (const MultivariatePolynomial< monomialOrdering > &o) const |
Private Member Functions | |
const symbol | determineVariable () const |
const std::map< ex, ex, monomialOrdering > | determineTermExs () const |
Private Attributes | |
vector< symbol > | mVariables |
symbol | mVariable |
std::map< ex, ex, monomialOrdering > | mTermExs |
Friends | |
class | MultivariateTerm |
class | MultivariateMonomial |
class | MultivariateCoefficient |
A class for a multivariate polynomial providing everything what a GiNaC expression of type polynomial is and, in addition, stores the variables of the polynomial (in lexicographic order) as well as the leading term in the variable with the maximal degree.
Notation is following http://www.possibility.com/Cpp/CppCodingStandard.html.
Definition at line 48 of file MultivariatePolynomial.h.
GiNaCRA::MultivariatePolynomial< monomialOrdering >::MultivariatePolynomial | ( | ) |
Constructs a multivariate polynomial consisting of the standard variable defined in constants.h.
GiNaCRA::MultivariatePolynomial< monomialOrdering >::MultivariatePolynomial | ( | const MultivariatePolynomial< monomialOrdering > & | p | ) |
Constructs a multivariate polynomial as copy of another one.
p | multivariate polynomial |
GiNaCRA::MultivariatePolynomial< monomialOrdering >::MultivariatePolynomial | ( | const ex & | p, |
const vector< symbol > & | l | ||
) | throw ( invalid_argument ) |
Constructs a multivariate polynomial using graded degree lexicographic monomial ordering.
p | polynomial |
l | list of the variables of the polynomial p |
const MultivariatePolynomial<monomialOrdering> GiNaCRA::MultivariatePolynomial< monomialOrdering >::add | ( | const MultivariatePolynomial< monomialOrdering > & | o | ) | const throw ( invalid_argument ) |
Adds two multivariate polynomials and returns a reference to their sum, allocated on the heap.
o |
const ex GiNaCRA::MultivariatePolynomial< monomialOrdering >::coeff | ( | const symbol & | s, |
const unsigned int & | n | ||
) | const |
n | the exponent |
s | the main symbol |
const ex GiNaCRA::MultivariatePolynomial< monomialOrdering >::coeff | ( | const ex & | monomial | ) | const throw ( invalid_argument ) |
invalid_argument | in case the given monomial is not a monomial of this polynomial |
const list<ex> GiNaCRA::MultivariatePolynomial< monomialOrdering >::CoefficientExs | ( | ) | const |
Selects the list of polynomial coefficients of this polynomial in the order by the constructor.
int GiNaCRA::MultivariatePolynomial< monomialOrdering >::degree | ( | const symbol & | s | ) | const |
s |
Referenced by GiNaCRA::MultivariatePolynomialFactory::searchMonomialsUnderTheStaircase().
int GiNaCRA::MultivariatePolynomial< monomialOrdering >::degree | ( | ) | const |
const std::map<ex, ex, monomialOrdering> GiNaCRA::MultivariatePolynomial< monomialOrdering >::determineTermExs | ( | ) | const [private] |
const symbol GiNaCRA::MultivariatePolynomial< monomialOrdering >::determineVariable | ( | ) | const [private] |
MultivariatePolynomial<monomialOrdering> GiNaCRA::MultivariatePolynomial< monomialOrdering >::diff | ( | const symbol & | s, |
unsigned | nth = 1 |
||
) | const |
s | symbol |
nth |
Referenced by GiNaCRA::MultivariatePolynomialFactory::specialGroebnerBasis().
MultivariatePolynomial<monomialOrdering> GiNaCRA::MultivariatePolynomial< monomialOrdering >::diff | ( | const vector< symbol >::const_iterator | i, |
unsigned | nth = 1 |
||
) | const |
i | iterator pointing to the symbol (in the list of symbols of this MultivariatePolynomial) |
nth |
const MultivariatePolynomial<monomialOrdering> GiNaCRA::MultivariatePolynomial< monomialOrdering >::divideByLcoeff | ( | ) | const |
Normalizes the polynomial e.g.
if P = c*(x^2+y^2) in D[x,y] it returns 1*(x^2+y^2).
bool GiNaCRA::MultivariatePolynomial< monomialOrdering >::isConstant | ( | ) | const |
Returns true if the polynomial is constant in the given variables, otherwise false.
const bool GiNaCRA::MultivariatePolynomial< monomialOrdering >::isEqual | ( | const MultivariatePolynomial< monomialOrdering > & | o | ) | const [inline, protected] |
o |
bool GiNaCRA::MultivariatePolynomial< monomialOrdering >::isZero | ( | ) | const |
Returns true if the univariate polynomial is the zero polynomial, otherwise false.
const ex GiNaCRA::MultivariatePolynomial< monomialOrdering >::lcoeff | ( | ) | const |
const ex GiNaCRA::MultivariatePolynomial< monomialOrdering >::lcoeff | ( | const symbol & | s | ) | const |
s | the variable |
int GiNaCRA::MultivariatePolynomial< monomialOrdering >::ldegree | ( | const symbol & | s | ) | const |
The low-degree is the smallest exponent at the main variable occuring.
s |
int GiNaCRA::MultivariatePolynomial< monomialOrdering >::ldegree | ( | ) | const |
The low-degree is the smallest exponent at the main variable occuring.
const ex GiNaCRA::MultivariatePolynomial< monomialOrdering >::lmon | ( | ) | const |
const ex GiNaCRA::MultivariatePolynomial< monomialOrdering >::lterm | ( | ) | const |
const vector<symbol> GiNaCRA::MultivariatePolynomial< monomialOrdering >::mergeVariables | ( | vector< symbol > | l | ) | const |
Merges this with the given symbol list into a new symbol list.
const MultivariatePolynomial<monomialOrdering> GiNaCRA::MultivariatePolynomial< monomialOrdering >::minus | ( | ) | const |
Returns the negative value, allocated on the heap.
const list<ex> GiNaCRA::MultivariatePolynomial< monomialOrdering >::MonomialExs | ( | ) | const |
Selects the list of monomials of this polynomial in the order by the constructor.
const MultivariatePolynomial<monomialOrdering> GiNaCRA::MultivariatePolynomial< monomialOrdering >::mul | ( | const MultivariatePolynomial< monomialOrdering > & | o | ) | const throw ( invalid_argument ) |
Multiplies two multivariate polynomials and returns a reference to their product, allocated on the heap.
o |
const MultivariatePolynomial<monomialOrdering> GiNaCRA::MultivariatePolynomial< monomialOrdering >::normalForm | ( | const list< MultivariatePolynomial< monomialOrdering > > & | gb | ) | const throw ( invalid_argument ) |
Computes the normalform of this polynomial modulo gb.
gb | special Groebner basis of the respective ideal |
const bool GiNaCRA::MultivariatePolynomial< monomialOrdering >::operator!= | ( | const MultivariatePolynomial< monomialOrdering > & | ) | const |
const MultivariatePolynomial<monomialOrdering>& GiNaCRA::MultivariatePolynomial< monomialOrdering >::operator= | ( | const MultivariatePolynomial< monomialOrdering > & | ) |
const MultivariatePolynomial<monomialOrdering>& GiNaCRA::MultivariatePolynomial< monomialOrdering >::operator= | ( | const ex & | ) |
const bool GiNaCRA::MultivariatePolynomial< monomialOrdering >::operator== | ( | const MultivariatePolynomial< monomialOrdering > & | ) | const |
const MultivariatePolynomial<monomialOrdering> GiNaCRA::MultivariatePolynomial< monomialOrdering >::pow | ( | const unsigned | e | ) | const throw ( invalid_argument ) |
Multiplies two multivariate polynomials and returns a reference to their product, allocated on the heap.
e | exponent |
void GiNaCRA::MultivariatePolynomial< monomialOrdering >::print | ( | const print_context & | c, |
unsigned | level = 0 |
||
) | const |
Reimplemented in GiNaCRA::MultivariateTerm< monomialOrdering >.
const MultivariatePolynomial<monomialOrdering> GiNaCRA::MultivariatePolynomial< monomialOrdering >::reduction | ( | const MultivariatePolynomial< monomialOrdering > & | g, |
const ex & | m | ||
) | const throw ( invalid_argument ) |
Computes the reduction of this polynomial w.r.t.
its monomial m by another polynomial q. This method performs a basic reduction step in computing normal forms modulo a given Groebner basis.
g | basis polynomial |
m | monomial of this polynomial w.r.t. which the reduction should take place |
invalid_argument | in case m is not a monomial of this polynomial |
Referenced by GiNaCRA::MultivariatePolynomialFactory::specialGroebnerBasis().
int GiNaCRA::MultivariatePolynomial< monomialOrdering >::tdegree | ( | ) | const |
The total degree of the polynomial is the maximum sum of degrees of each monomial.
Reimplemented in GiNaCRA::MultivariateTerm< monomialOrdering >.
Referenced by GiNaCRA::MultivariatePolynomialFactory::synthesizeSpecialGroebnerBasisDegrees().
int GiNaCRA::MultivariatePolynomial< monomialOrdering >::tdegree | ( | const symbol & | s | ) | const |
The total degree of the polynomial w.r.t.
the variable s is the maximum sum of degrees of each monomial containing the variable s.
s | variable |
MultivariatePolynomial<monomialOrdering> GiNaCRA::MultivariatePolynomial< monomialOrdering >::trunc | ( | const symbol & | s | ) | const |
Removes the leading term w.r.t.
one variable.
s | the variable |
MultivariatePolynomial<monomialOrdering> GiNaCRA::MultivariatePolynomial< monomialOrdering >::trunc | ( | ) | const |
Removes the leading term.
const symbol GiNaCRA::MultivariatePolynomial< monomialOrdering >::Variable | ( | ) | const |
const vector<symbol> GiNaCRA::MultivariatePolynomial< monomialOrdering >::Variables | ( | ) | const |
Selects the list of variables of the polynomial (ordered lexicographicly, not by degree!).
Referenced by GiNaCRA::MultivariatePolynomialFactory::searchMonomialsUnderTheStaircase(), and GiNaCRA::MultivariatePolynomialFactory::synthesizeSpecialGroebnerBasisDegrees().
friend class MultivariateCoefficient [friend] |
Definition at line 56 of file MultivariatePolynomial.h.
friend class MultivariateMonomial [friend] |
Definition at line 54 of file MultivariatePolynomial.h.
friend class MultivariateTerm [friend] |
Definition at line 52 of file MultivariatePolynomial.h.
std::map<ex, ex, monomialOrdering> GiNaCRA::MultivariatePolynomial< monomialOrdering >::mTermExs [private] |
Definition at line 331 of file MultivariatePolynomial.h.
symbol GiNaCRA::MultivariatePolynomial< monomialOrdering >::mVariable [private] |
Definition at line 330 of file MultivariatePolynomial.h.
vector<symbol> GiNaCRA::MultivariatePolynomial< monomialOrdering >::mVariables [private] |
Definition at line 329 of file MultivariatePolynomial.h.