GiNaCRA  0.6.4
GiNaCRA::UnivariatePolynomialSet Class Reference

This class encapsulates a set of UnivariatePolynomials and its helping methods. More...

#include <UnivariatePolynomialSet.h>

Public Member Functions

 UnivariatePolynomialSet ()
 Creates an empty set.
template<class InputIterator >
 UnivariatePolynomialSet (InputIterator first, InputIterator last)
 Creates a set initialized with the contents between first (inclusively) and last (exclusively).
const bool isConstant (symbol &x) const
 Checks whether the whole set is constant in x.
const symbol variable () const
 Return the main variable which all Polynomials share in this set.
pair
< UnivariatePolynomialSet::iterator,
bool > 
insert (const UnivariatePolynomial &x) throw ( invalid_argument )
 Inserts an element x into the set.
template<class InputIterator >
void insert (InputIterator first, InputIterator last) throw ( invalid_argument )
 Insert the elements between the iterators into the set.
void removeNumbers ()
 Removes all constant elements without parameters.
const UnivariatePolynomialSet makePrimitive ()
 Replaces all polynomials by its primitive part.

Detailed Description

This class encapsulates a set of UnivariatePolynomials and its helping methods.

It is important to now that the class is based on the functionality of std::unordered_set but it ensures that only UnivariatePolynomials of the same main variable are inserted.

Author:
Joachim Redies
Ulrich Loup
Since:
2011-10-03
Version:
2012-01-20

Definition at line 65 of file UnivariatePolynomialSet.h.


Constructor & Destructor Documentation

Creates an empty set.

Definition at line 77 of file UnivariatePolynomialSet.h.

Referenced by makePrimitive().

template<class InputIterator >
GiNaCRA::UnivariatePolynomialSet::UnivariatePolynomialSet ( InputIterator  first,
InputIterator  last 
) [inline]

Creates a set initialized with the contents between first (inclusively) and last (exclusively).

Parameters:
first
last

Definition at line 85 of file UnivariatePolynomialSet.h.


Member Function Documentation

pair< UnivariatePolynomialSet::iterator, bool > GiNaCRA::UnivariatePolynomialSet::insert ( const UnivariatePolynomial x) throw ( invalid_argument )

Inserts an element x into the set.

Throws an exception if the main variable does not fit to the main variables already in the set.

Parameters:
xthe element to insert
Returns:
an iterator to the element and true if it has been inserted and false it has been there before.

Definition at line 60 of file UnivariatePolynomialSet.cpp.

Referenced by GiNaCRA::CAD::addPolynomials(), GiNaCRA::CAD::CAD(), makePrimitive(), and GiNaCRA::CAD::truncation().

template<class InputIterator >
void GiNaCRA::UnivariatePolynomialSet::insert ( InputIterator  first,
InputIterator  last 
) throw ( invalid_argument )

Insert the elements between the iterators into the set.

Throws an exception if only of the inserted polynomials has a different main variable then the main variable of the polynomials already in the set.

Parameters:
firstiterator marking the beginning of the elements to insert
lastiterator marking the end of the elements to insert

Definition at line 68 of file UnivariatePolynomialSet.cpp.

const bool GiNaCRA::UnivariatePolynomialSet::isConstant ( symbol &  x) const

Checks whether the whole set is constant in x.

Parameters:
xthe variable to check for
Returns:
true if the set is constant otherwise false.

Definition at line 41 of file UnivariatePolynomialSet.cpp.

Replaces all polynomials by its primitive part.

Returns:
this set where all polynomials are replaced by their primitive part

Definition at line 84 of file UnivariatePolynomialSet.cpp.

References insert(), and UnivariatePolynomialSet().

Referenced by GiNaCRA::CAD::eliminationSet().

Removes all constant elements without parameters.

Definition at line 74 of file UnivariatePolynomialSet.cpp.

Referenced by GiNaCRA::CAD::eliminationSet().

Return the main variable which all Polynomials share in this set.

Returns:
the main variable

Definition at line 51 of file UnivariatePolynomialSet.cpp.


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