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::SingleList< Element > Class Template Reference

Represent a single chained list. More...

#include <single-list.h>

Public Member Functions

 SingleList ()
 Constructor.
 
 SingleList (SingleList const &toCopy)
 Copy constructor.
 
 SingleList (SingleList &&toCopy)
 Move constructor.
 
 ~SingleList ()
 Destructor.
 
void clear ()
 Erase all the terms.
 
void deleteAfter (NodeList< Element > *it)
 Erase all the terms after it, set it->_next to 0. More...
 
NodeList< Element > * getBegin () const
 Return an iterator to the first element. More...
 
NodeList< Element > * getBeforeBegin ()
 Return an iterator before the first element. More...
 
bool empty () const
 Test if the list is empty. More...
 
int getNbTerms () const
 Get the number of terms. More...
 
Term< Element > const & front () const
 Get the first term of the list. More...
 
NodeList< Element > * emplaceBegin (Element coefficient, int numMonomial)
 Construct a term in place at the beginning of the list. More...
 
NodeList< Element > * emplaceAfter (NodeList< Element > *it, Element coefficient, int numMonomial)
 Construct a term in place after the node pointed by it. More...
 
NodeList< Element > * emplaceOn (NodeList< Element > *it, Element coefficient, int numMonomial)
 Construct a term in place after the node pointed by it. More...
 
NodeList< Element > * insertBegin (Term< Element > const &term)
 Construct a term in place at the beginning of the list. More...
 
NodeList< Element > * insertAfter (NodeList< Element > *it, Term< Element > const &term)
 Construct a term in place after the node pointed by it. More...
 
void printList (ostream &stream) const
 Print the list.
 
NodeList< Element > * popFront ()
 Remove the first element. More...
 
SingleListoperator= (SingleList const &toCopy)
 Overload the operator =. More...
 
SingleListoperator= (SingleList &&toCopy)
 Overload the operator =. More...
 

Private Attributes

NodeList< Element > * _list
 
NodeList< Element > * _beforeBegin
 
int _nbTerms
 

Detailed Description

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

Represent a single chained list.

Definition at line 117 of file single-list.h.

Member Function Documentation

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

Erase all the terms after it, set it->_next to 0.

Parameters
itPointer on a node.
template<typename Element >
NodeList<Element>* F4::SingleList< Element >::emplaceAfter ( NodeList< Element > *  it,
Element  coefficient,
int  numMonomial 
)

Construct a term in place after the node pointed by it.

Parameters
itPointer on a node.
coefficientCoefficient of the term.
numMonomialNumber of the monomial of the term.
Returns
Pointer on the created node.
template<typename Element >
NodeList<Element>* F4::SingleList< Element >::emplaceBegin ( Element  coefficient,
int  numMonomial 
)

Construct a term in place at the beginning of the list.

Parameters
coefficientCoefficient of the term.
numMonomialNumber of the monomial of the term.
Returns
Pointer on the created node.
template<typename Element >
NodeList<Element>* F4::SingleList< Element >::emplaceOn ( NodeList< Element > *  it,
Element  coefficient,
int  numMonomial 
)

Construct a term in place after the node pointed by it.

Parameters
itPointer on a node.
coefficientCoefficient of the term.
numMonomialNumber of the monomial of the term.
Returns
Pointer on the created node.
template<typename Element >
bool F4::SingleList< Element >::empty ( ) const

Test if the list is empty.

Returns
true if the list is empty.
false otherwise.
template<typename Element >
Term<Element> const& F4::SingleList< Element >::front ( ) const

Get the first term of the list.

Returns
First term of the list.
template<typename Element >
NodeList<Element>* F4::SingleList< Element >::getBeforeBegin ( )

Return an iterator before the first element.

Returns
Pointer before the first node.
template<typename Element >
NodeList<Element>* F4::SingleList< Element >::getBegin ( ) const

Return an iterator to the first element.

Returns
Pointer on the first node.
template<typename Element >
int F4::SingleList< Element >::getNbTerms ( ) const

Get the number of terms.

Returns
Number of terms.
template<typename Element >
NodeList<Element>* F4::SingleList< Element >::insertAfter ( NodeList< Element > *  it,
Term< Element > const &  term 
)

Construct a term in place after the node pointed by it.

Parameters
itPointer on a node.
termTerm to insert.
Returns
Pointer on the created node.
template<typename Element >
NodeList<Element>* F4::SingleList< Element >::insertBegin ( Term< Element > const &  term)

Construct a term in place at the beginning of the list.

Parameters
termTerm to insert.
Returns
Pointer on the created node.
template<typename Element >
SingleList& F4::SingleList< Element >::operator= ( SingleList< Element > const &  toCopy)

Overload the operator =.

Parameters
toCopyList to copy.
Returns
Reference on this.
template<typename Element >
SingleList& F4::SingleList< Element >::operator= ( SingleList< Element > &&  toCopy)

Overload the operator =.

Parameters
toCopyList to move.
Returns
Reference on this.
template<typename Element >
NodeList<Element>* F4::SingleList< Element >::popFront ( )

Remove the first element.

Returns
Pointer on the new first node.

Member Data Documentation

template<typename Element >
NodeList<Element>* F4::SingleList< Element >::_beforeBegin
private

Before the head of the list.

Definition at line 264 of file single-list.h.

template<typename Element >
NodeList<Element>* F4::SingleList< Element >::_list
private

Head of the list.

Definition at line 263 of file single-list.h.

template<typename Element >
int F4::SingleList< Element >::_nbTerms
private

Number of terms of the list.

Definition at line 265 of file single-list.h.


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