GiNaCRA
0.6.4
|
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. |
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.
Definition at line 65 of file UnivariatePolynomialSet.h.
Creates an empty set.
Definition at line 77 of file UnivariatePolynomialSet.h.
Referenced by makePrimitive().
GiNaCRA::UnivariatePolynomialSet::UnivariatePolynomialSet | ( | InputIterator | first, |
InputIterator | last | ||
) | [inline] |
Creates a set initialized with the contents between first (inclusively) and last (exclusively).
first | |
last |
Definition at line 85 of file UnivariatePolynomialSet.h.
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.
x | the element to insert |
Definition at line 60 of file UnivariatePolynomialSet.cpp.
Referenced by GiNaCRA::CAD::addPolynomials(), GiNaCRA::CAD::CAD(), makePrimitive(), and GiNaCRA::CAD::truncation().
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.
first | iterator marking the beginning of the elements to insert |
last | iterator 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.
x | the variable to check for |
Definition at line 41 of file UnivariatePolynomialSet.cpp.
Replaces all polynomials by its 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().
const symbol GiNaCRA::UnivariatePolynomialSet::variable | ( | ) | const |
Return the main variable which all Polynomials share in this set.
Definition at line 51 of file UnivariatePolynomialSet.cpp.