OPENF4
Library for Gröebner basis computations over finite fields.
 All Classes Namespaces Files Functions Variables Friends Pages
Public Member Functions | Private Attributes | List of all members
F4::Polynomial< Element > Class Template Reference

Represent a polynomial. More...

#include <polynomial.h>

Public Member Functions

 Polynomial ()
 Constructor.
 
 Polynomial (std::string const s)
 Constructor. More...
 
 Polynomial (Polynomial const &polynomial)
 Copy constructor. More...
 
 Polynomial (Polynomial &&polynomial)
 Move constructor. More...
 
void clear ()
 Delete all the terms.
 
void deleteAfter (NodeList< Element > *it)
 Erase all the term from it to the end of the polynomial. More...
 
void printPolynomial (std::ostream &stream) const
 Print the polynomial.
 
int getNbTerm () const
 Get the number of terms of this. More...
 
const Term< Element > & getLT () const
 Get the leading term of this. More...
 
int getLM () const
 Get the number of the leading monomial of this. More...
 
Element getLC () const
 Get the leading coefficient of this. More...
 
Element getCoefficient (int numMon) const
 Get the coefficient of the term of monomial numMon. More...
 
NodeList< Element > * getPolynomialBegin ()
 Get an iterator on the beginning of the polynomial. More...
 
NodeList< Element > * getPolynomialBeforeBegin ()
 Get an iterator before the beginning of the polynomial. More...
 
NodeList< Element > const * getPolynomialBeginConst () const
 Get a constant iterator on the beginning of the polynomial. More...
 
void deleteLT ()
 Delete the leading term of this.
 
void normalize ()
 Normalize this.
 
bool isEmpty ()
 Test if the polynomial is empty or not. More...
 
NodeList< Element > * emplaceAfter (NodeList< Element > *pos, Element coeff, int numMon)
 Add a term after pos. Beware to keep a correct order. More...
 
NodeList< Element > * emplaceOn (NodeList< Element > *pos, Element coeff, int numMon)
 Add a term after pos. Beware to keep a correct order. More...
 
Polynomialoperator= (Polynomial const &polynomial)
 Overload the operator =. More...
 
Polynomialoperator= (Polynomial &&polynomial)
 Overload the move operator =. More...
 
Polynomialoperator*= (Monomial const &monomial)
 Overload the operator *= to multiply this with a monomial. Prefer multNumMon(int numMon) if the monomial is under integer form. More...
 
Polynomialoperator*= (Element element)
 Overload the operator *= to multiply this with an Element. More...
 
Polynomialoperator*= (Term< Element > const &term)
 Overload the operator *= to multiply this with a term. More...
 

Private Attributes

SingleList< Element > _polynomial
 

Detailed Description

template<typename Element>
class F4::Polynomial< Element >

Represent a polynomial.

Definition at line 47 of file polynomial.h.

Constructor & Destructor Documentation

template<typename Element>
F4::Polynomial< Element >::Polynomial ( std::string const  s)

Constructor.

Parameters
sString representing the polynomial.
template<typename Element>
F4::Polynomial< Element >::Polynomial ( Polynomial< Element > const &  polynomial)

Copy constructor.

Parameters
polynomialPolynomial to copy.
template<typename Element>
F4::Polynomial< Element >::Polynomial ( Polynomial< Element > &&  polynomial)

Move constructor.

Parameters
polynomialPolynomial to move.

Member Function Documentation

template<typename Element>
void F4::Polynomial< Element >::deleteAfter ( NodeList< Element > *  it)

Erase all the term from it to the end of the polynomial.

Parameters
itPointer on a node.
template<typename Element>
NodeList<Element>* F4::Polynomial< Element >::emplaceAfter ( NodeList< Element > *  pos,
Element  coeff,
int  numMon 
)

Add a term after pos. Beware to keep a correct order.

Parameters
positerator, term is contructed after the position specified by pos.
coeffCoefficient of the new term.
numMonNumber of the monomial of the new term.
Returns
Iterator to the new term.
template<typename Element>
NodeList<Element>* F4::Polynomial< Element >::emplaceOn ( NodeList< Element > *  pos,
Element  coeff,
int  numMon 
)

Add a term after pos. Beware to keep a correct order.

Parameters
positerator, term is contructed after the position specified by pos.
coeffCoefficient of the new term.
numMonNumber of the monomial of the new term.
Returns
Iterator to the new term.
template<typename Element>
Element F4::Polynomial< Element >::getCoefficient ( int  numMon) const

Get the coefficient of the term of monomial numMon.

Returns
Coefficient of the term of monomial numMon.
template<typename Element>
Element F4::Polynomial< Element >::getLC ( ) const

Get the leading coefficient of this.

Precondition
_polynomial is not empty.
Returns
Leading coefficient of this.
template<typename Element>
int F4::Polynomial< Element >::getLM ( ) const

Get the number of the leading monomial of this.

Precondition
_polynomial is not empty.
Returns
Number of the leading monomial of this.
template<typename Element>
const Term<Element>& F4::Polynomial< Element >::getLT ( ) const

Get the leading term of this.

Precondition
_polynomial is not empty.
Returns
Leading term of this.
template<typename Element>
int F4::Polynomial< Element >::getNbTerm ( ) const

Get the number of terms of this.

Returns
Number of terms of this.
template<typename Element>
NodeList<Element>* F4::Polynomial< Element >::getPolynomialBeforeBegin ( )

Get an iterator before the beginning of the polynomial.

Returns
Iterator before the beginning of _polynomial.
template<typename Element>
NodeList<Element>* F4::Polynomial< Element >::getPolynomialBegin ( )

Get an iterator on the beginning of the polynomial.

Returns
Iterator on the beginning of _polynomial.
template<typename Element>
NodeList<Element> const* F4::Polynomial< Element >::getPolynomialBeginConst ( ) const

Get a constant iterator on the beginning of the polynomial.

Returns
Constant iterator on the beginning of _polynomial.
template<typename Element>
bool F4::Polynomial< Element >::isEmpty ( )

Test if the polynomial is empty or not.

Returns
true if _polynomial is empty.
false otherwise.
template<typename Element>
Polynomial& F4::Polynomial< Element >::operator*= ( Monomial const &  monomial)

Overload the operator *= to multiply this with a monomial. Prefer multNumMon(int numMon) if the monomial is under integer form.

Parameters
monMonomial.
Returns
Reference on this.
template<typename Element>
Polynomial& F4::Polynomial< Element >::operator*= ( Element  element)

Overload the operator *= to multiply this with an Element.

Parameters
elementElement.
Returns
Reference on this.
template<typename Element>
Polynomial& F4::Polynomial< Element >::operator*= ( Term< Element > const &  term)

Overload the operator *= to multiply this with a term.

Parameters
termTerm.
Returns
Reference on this.
template<typename Element>
Polynomial& F4::Polynomial< Element >::operator= ( Polynomial< Element > const &  polynomial)

Overload the operator =.

Parameters
polynomialPolynomial to copy.
Returns
Reference on this.
template<typename Element>
Polynomial& F4::Polynomial< Element >::operator= ( Polynomial< Element > &&  polynomial)

Overload the move operator =.

Parameters
polynomialPolynomial to move.
Returns
Reference on this.

Member Data Documentation

template<typename Element>
SingleList<Element> F4::Polynomial< Element >::_polynomial
private

Define a polynomial as a single chained list of Terms.

Definition at line 223 of file polynomial.h.


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