Public Member Functions |
void | normalize () |
| MPolynomial (const Alloc &allocator=Alloc()) |
| MPolynomial (const Ring &v, const Alloc &allocator=Alloc()) |
| MPolynomial (const MPolyNM1 &pdm1, const Alloc &allocator=Alloc()) |
template<typename Ring2 , typename Alloc2 > |
| MPolynomial (const MPolynomial< n, Ring2, Alloc2 > &p, const Alloc &allocator=Alloc()) |
template<typename Ring2 , typename Alloc2 > |
MPolynomial & | operator= (const MPolynomial< n, Ring2, Alloc2 > &p) |
void | swap (MPolynomial &p) |
Alloc | getAllocator () const |
int | degree () const |
const MPolyNM1 & | leading () const |
bool | isZero () const |
MPolyNM1 & | operator[] (Size i) |
const MPolyNM1 & | operator[] (Size i) const |
MPolynomialEvaluator< n, Ring,
Alloc, Ring > | operator() (const Ring &x) const |
template<typename Ring2 > |
MPolynomialEvaluator< n, Ring,
Alloc, Ring2 > | operator() (const Ring2 &x) const |
MPolynomial | operator* (const Ring &v) const |
MPolynomial | operator/ (const Ring &v) const |
MPolynomial & | operator*= (const MPolynomial &p) |
MPolynomial & | operator*= (const Ring &v) |
MPolynomial & | operator/= (const Ring &v) |
MPolynomial | operator- () const |
MPolynomial | operator+ (const MPolynomial &q) const |
MPolynomial | operator- (const MPolynomial &q) const |
MPolynomial & | operator+= (const MPolynomial &q) |
MPolynomial & | operator-= (const MPolynomial &q) |
MPolynomial | operator+ (const MPolyNM1 &q) const |
MPolynomial | operator- (const MPolyNM1 &q) const |
MPolynomial | operator+ (const Ring &v) const |
MPolynomial | operator- (const Ring &v) const |
MPolynomial & | operator+= (const MPolyNM1 &q) |
MPolynomial & | operator-= (const MPolyNM1 &q) |
MPolynomial & | operator+= (const Ring &v) |
MPolynomial & | operator-= (const Ring &v) |
MPolynomial | operator* (const MPolynomial &p) const |
bool | operator== (const MPolynomial &q) const |
bool | operator!= (const MPolynomial &q) const |
bool | operator== (const Ring &v) const |
bool | operator!= (const Ring &v) const |
void | selfDisplay (std::ostream &s, int N=n) const |
bool | isValid () const |
template<int n, typename TRing, class TAlloc>
class DGtal::MPolynomial< n, TRing, TAlloc >
Aim: Represents a multivariate polynomial, i.e. an element of \( K[X_0, ..., X_{n-1}] \), where K is some ring or field.
Description of template class 'MPolynomial'
Monomials are products of power of variables, like xy^2z^3. Polynomials in n variables are constructed recursively with polynomials in n - 1 variables.
There is a specialization for polynomials with no indeterminates, i.e. constants.
- See also:
- dgtal_multivariate_polynomial
- Template Parameters:
-
n | the number of variables or indeterminates. |
TRing | the type chosen for the polynomial, defines also the type of the coefficents (generally int, float or double). |
TAlloc | is an allocator for TRing, for example std::allocator<TRing>; this is also the default parameter. Usually this parameter does not needs to be changed. |
This class is a backport from Spielwiese.
- Author:
- Felix Fontein (
felix.nosp@m.@fon.nosp@m.tein..nosp@m.de
), University of Zurich, Switzerland
- Examples:
- math/polynomial-derivative.cpp, and math/polynomial2-derivative.cpp.
Definition at line 955 of file MPolynomial.h.
template<int n, typename TRing, class TAlloc>
The type for the vector storing polynomials coefficients. For 0 or 1 variables, uses a standard vector, for more variables, uses a specific vector of pointers to polynomials, with adequate allocators. This is for efficiency purposes.
Definition at line 986 of file MPolynomial.h.
template<int n, typename TRing, class TAlloc>
template<typename Ring2 , typename Alloc2 >
Casts a polynomial of type MPolynomial<n, Ring2, Alloc2> to a polynomial of type MPolynomial<n, Ring, Alloc>.
Definition at line 1061 of file MPolynomial.h.
template<int n, typename TRing, class TAlloc>
Adjusts the size of myValue that the leading term and degree can be computed trivially. This must be called only after calls to the non-const operator[], in which the degree of the polynomial has potentially been changed.
Definition at line 1016 of file MPolynomial.h.
Referenced by DGtal::MPolynomialDerivativeComputer< 0, n, Ring, Alloc >::computeDerivative(), DGtal::MPolynomialDerivativeComputer< N, n, Ring, Alloc >::computeDerivative(), DGtal::euclidDiv(), DGtal::Xe_kComputer< n, Ring, Alloc >::get(), DGtal::MPolynomial< 3, Ring >::MPolynomial(), DGtal::MPolynomial< 3, Ring >::operator*(), DGtal::MPolynomial< 3, Ring >::operator+(), DGtal::MPolynomial< 3, Ring >::operator+=(), DGtal::MPolynomial< 3, Ring >::operator-(), DGtal::MPolynomial< 3, Ring >::operator-=(), and DGtal::MPolynomial< 3, Ring >::operator=().
{
while ( dp1 )
{
--dp1;
else
break;
}
}
template<int n, typename TRing, class TAlloc>
template<typename Ring2 , typename Alloc2 >
Copies a polynomial of type MPolynomial<n, Ring2, Alloc2> to this polynomial (of type MPolynomial<n, Ring, Alloc>).
Definition at line 1077 of file MPolynomial.h.
template<int n, typename TRing, class TAlloc>
The vector storing polynomials coefficients. For 0 or 1 variables, uses a standard vector, for more variables, uses a specific vector of pointers to polynomials, with adequate allocators. This is for efficiency purposes.
Definition at line 999 of file MPolynomial.h.
Referenced by DGtal::MPolynomialDerivativeComputer< 0, n, Ring, Alloc >::computeDerivative(), DGtal::MPolynomialDerivativeComputer< N, n, Ring, Alloc >::computeDerivative(), DGtal::MPolynomial< 3, Ring >::degree(), DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::evaluate(), DGtal::MPolynomial< 3, Ring >::getAllocator(), DGtal::MPolynomial< 0, TRing, TAlloc >::isZero(), DGtal::MPolynomial< 3, Ring >::isZero(), DGtal::MPolynomial< 3, Ring >::leading(), DGtal::MPolynomial< 3, Ring >::MPolynomial(), DGtal::MPolynomial< 3, Ring >::normalize(), DGtal::MPolynomial< 0, TRing, TAlloc >::operator const Ring &(), DGtal::MPolynomialEvaluator< n, TRing, TAlloc, TX >::operator MPolyNM1(), DGtal::MPolynomialEvaluator< 1, TRing, TAlloc, TX >::operator X(), DGtal::MPolynomial< 0, TRing, TAlloc >::operator!=(), DGtal::MPolynomialEvaluatorImpl< 1, TRing, TOwner, TAlloc, TX >::EvalFun::operator()(), DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::EvalFun< XX, Fun >::operator()(), DGtal::MPolynomialEvaluatorImpl< n, TRing, TOwner, TAlloc, TX >::EvalFun2::operator()(), DGtal::MPolynomial< 0, TRing, TAlloc >::operator()(), DGtal::MPolynomial< 0, TRing, TAlloc >::operator*(), DGtal::MPolynomial< 3, Ring >::operator*(), DGtal::MPolynomial< 0, TRing, TAlloc >::operator*=(), DGtal::MPolynomial< 3, Ring >::operator*=(), DGtal::MPolynomial< 0, TRing, TAlloc >::operator+(), DGtal::MPolynomial< 3, Ring >::operator+(), DGtal::MPolynomial< 0, TRing, TAlloc >::operator+=(), DGtal::MPolynomial< 3, Ring >::operator+=(), DGtal::MPolynomial< 0, TRing, TAlloc >::operator-(), DGtal::MPolynomial< 3, Ring >::operator-(), DGtal::MPolynomial< 0, TRing, TAlloc >::operator-=(), DGtal::MPolynomial< 3, Ring >::operator-=(), DGtal::MPolynomial< 0, TRing, TAlloc >::operator/(), DGtal::MPolynomial< 3, Ring >::operator/(), DGtal::MPolynomial< 0, TRing, TAlloc >::operator/=(), DGtal::MPolynomial< 3, Ring >::operator/=(), DGtal::MPolynomial< 0, TRing, TAlloc >::operator=(), DGtal::MPolynomial< 3, Ring >::operator=(), DGtal::MPolynomial< 0, TRing, TAlloc >::operator==(), DGtal::MPolynomial< 3, Ring >::operator==(), DGtal::MPolynomial< 3, Ring >::operator[](), DGtal::MPolynomial< 0, TRing, TAlloc >::selfDisplay(), DGtal::MPolynomial< 3, Ring >::selfDisplay(), DGtal::MPolynomial< 0, TRing, TAlloc >::swap(), and DGtal::MPolynomial< 3, Ring >::swap().