DGtal 2.0.0
|
Aim: Specialization of MPolynomial for degree 0. More...
#include <DGtal/math/MPolynomial.h>
Public Types | |
typedef TRing | Ring |
typedef TAlloc | Alloc |
typedef MPolynomial< n - 1, Ring, Alloc > | MPolyNM1 |
typedef IVector< MPolyNM1, typename std::allocator_traits< Alloc >::template rebind_alloc< MPolyNM1 >,(n > 1) > | Storage |
typedef Storage::Size | Size |
Public Member Functions | |
MPolynomial (const Ring &v=0, const Alloc &allocator=Alloc()) | |
MPolynomial (const Alloc &allocator) | |
bool | isZero () const |
operator const Ring & () const | |
MPolynomial & | operator= (const Ring &v) |
Ring | operator() () const |
MPolynomial | operator* (const Ring &v) const |
MPolynomial | operator/ (const Ring &v) const |
MPolynomial | operator+ (const Ring &v) const |
MPolynomial | operator- (const Ring &v) const |
MPolynomial | operator- () const |
MPolynomial & | operator*= (const Ring &v) |
MPolynomial & | operator/= (const Ring &v) |
MPolynomial & | operator+= (const Ring &v) |
MPolynomial & | operator-= (const Ring &v) |
bool | operator== (const Ring &v) const |
bool | operator!= (const Ring &v) const |
void | selfDisplay (std::ostream &s, int) const |
void | swap (MPolynomial &p) |
Alloc | getAllocator () const |
void | normalize () |
int | degree () const |
const MPolyNM1 & | leading () const |
MPolyNM1 & | operator[] (Size i) |
bool | isValid () const |
Private Attributes | |
Alloc | myAllocator |
Ring | myValue |
Static Private Attributes | |
static MPolyNM1 | myZeroPolynomial |
The zero polynomial of n-1 variables for a n-multivariate polynomial. |
Friends | |
class | MPolynomialDerivativeComputer |
class | MPolynomialEvaluator |
class | MPolynomialEvaluatorImpl |
void | euclidDiv (const MPolynomial< 1, TRing, TAlloc > &f, const MPolynomial< 1, TRing, TAlloc > &g, MPolynomial< 1, TRing, TAlloc > &q, MPolynomial< 1, TRing, TAlloc > &r) |
Aim: Specialization of MPolynomial for degree 0.
Description of template class 'MPolynomial'
Stores a polynomial of degree 0, i.e. a scalar of type T. We assume that the type T is not "too" complex, otherwise this class will be partially not very effective.
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.
Definition at line 507 of file MPolynomial.h.
typedef TAlloc DGtal::MPolynomial< 0, TRing, TAlloc >::Alloc |
Definition at line 511 of file MPolynomial.h.
typedef MPolynomial< n - 1, Ring, Alloc > DGtal::MPolynomial< n, TRing, TAlloc >::MPolyNM1 |
Definition at line 991 of file MPolynomial.h.
typedef TRing DGtal::MPolynomial< 0, TRing, TAlloc >::Ring |
Definition at line 510 of file MPolynomial.h.
typedef Storage::Size DGtal::MPolynomial< n, TRing, TAlloc >::Size |
Definition at line 1001 of file MPolynomial.h.
typedef IVector< MPolyNM1, typename std::allocator_traits<Alloc>::template rebind_alloc<MPolyNM1>, (n > 1) > DGtal::MPolynomial< n, TRing, TAlloc >::Storage |
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 1000 of file MPolynomial.h.
|
inline |
Constructor (default, or from ring value). Creates the constant polynomial v.
v | any value in the ring. |
allocator | an allocator for the polynomial. |
Definition at line 526 of file MPolynomial.h.
References myAllocator, and myValue.
Referenced by operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-(), operator-=(), operator/(), operator/=(), operator=(), and swap().
|
inline |
Allocator constructor. Creates the constant polynomial 0, where 0 is the default value of the ring.
allocator | an allocator for the polynomial. |
Definition at line 537 of file MPolynomial.h.
References myAllocator, and myValue.
|
inline |
Definition at line 1124 of file MPolynomial.h.
|
inline |
Definition at line 712 of file MPolynomial.h.
References myAllocator.
bool DGtal::MPolynomial< n, TRing, TAlloc >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
|
inline |
Definition at line 544 of file MPolynomial.h.
References myValue.
|
inline |
Definition at line 1134 of file MPolynomial.h.
|
inline |
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 1030 of file MPolynomial.h.
|
inline |
Const cast operator to Ring value. Returns the coefficient value of this constant polynomial.
Definition at line 553 of file MPolynomial.h.
References myValue.
|
inline |
Difference operator.
v | any value in the ring. |
Definition at line 686 of file MPolynomial.h.
References myValue.
|
inline |
Evaluation operator for the polynomial.
Definition at line 573 of file MPolynomial.h.
References myValue.
|
inline |
Multiplication by value v.
v | any value in the ring. |
Definition at line 583 of file MPolynomial.h.
References DGtal::MPolynomial< n, TRing, TAlloc >::MPolynomial(), MPolynomial(), and myValue.
|
inline |
Self-multiplication by value v.
v | any value in the ring. |
Definition at line 632 of file MPolynomial.h.
References MPolynomial(), and myValue.
|
inline |
Addition by value v.
v | any value in the ring. |
Definition at line 603 of file MPolynomial.h.
References DGtal::MPolynomial< n, TRing, TAlloc >::MPolynomial(), MPolynomial(), and myValue.
|
inline |
Self-addition by value v.
v | any value in the ring. |
Definition at line 654 of file MPolynomial.h.
References MPolynomial(), and myValue.
|
inline |
Unary minus operator.
Definition at line 622 of file MPolynomial.h.
References DGtal::MPolynomial< n, TRing, TAlloc >::MPolynomial(), MPolynomial(), and myValue.
|
inline |
Subtraction by value v.
v | any value in the ring. |
Definition at line 613 of file MPolynomial.h.
References DGtal::MPolynomial< n, TRing, TAlloc >::MPolynomial(), MPolynomial(), and myValue.
|
inline |
Self-subtraction by value v.
v | any value in the ring. |
Definition at line 665 of file MPolynomial.h.
References MPolynomial(), and myValue.
|
inline |
Division by value v.
v | any value in the ring. |
Definition at line 593 of file MPolynomial.h.
References DGtal::MPolynomial< n, TRing, TAlloc >::MPolynomial(), MPolynomial(), and myValue.
|
inline |
Self-division by value v.
v | any value in the ring. |
Definition at line 643 of file MPolynomial.h.
References MPolynomial(), and myValue.
|
inline |
Assigment from coefficient in the ring.
v | any value in the ring. |
Definition at line 563 of file MPolynomial.h.
References MPolynomial(), and myValue.
|
inline |
Equality operator.
v | any value in the ring. |
Definition at line 676 of file MPolynomial.h.
References myValue.
|
inline |
Definition at line 1152 of file MPolynomial.h.
|
inline |
Outputs itself in the stream s.
s | any stream |
Definition at line 695 of file MPolynomial.h.
References myValue.
|
inline |
Swaps two polynomials.
p | any zero-degree polynomial. |
Definition at line 704 of file MPolynomial.h.
References MPolynomial(), DGtal::MPolynomial< n, TRing, TAlloc >::myValue, and myValue.
|
friend |
Forward declaration, to be able to declare this as a friend.
|
friend |
Definition at line 974 of file MPolynomial.h.
|
friend |
Definition at line 983 of file MPolynomial.h.
|
friend |
Definition at line 986 of file MPolynomial.h.
|
private |
Definition at line 514 of file MPolynomial.h.
Referenced by getAllocator(), MPolynomial(), and MPolynomial().
|
private |
Definition at line 515 of file MPolynomial.h.
Referenced by isZero(), MPolynomial(), MPolynomial(), operator const Ring &(), operator!=(), operator()(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-(), operator-=(), operator/(), operator/=(), operator=(), operator==(), selfDisplay(), and swap().
|
staticprivate |
The zero polynomial of n-1 variables for a n-multivariate polynomial.
Definition at line 1006 of file MPolynomial.h.