DGtal 1.3.0
|
Aim: This class converts a string polynomial expression in a multivariate polynomial. More...
#include <DGtal/io/readers/MPolynomialReader.h>
Data Structures | |
struct | ExprNodeMaker |
Public Types | |
typedef TRing | Ring |
typedef TIterator | Iterator |
typedef TAlloc | Alloc |
typedef MPolynomial< n, Ring, Alloc > | Polynomial |
typedef MPolynomialGrammar< Iterator > | Grammar |
Public Member Functions | |
MPolynomialReader () | |
Iterator | read (Polynomial &p, Iterator begin, Iterator end) |
void | selfDisplay (std::ostream &out) const |
bool | isValid () const |
Data Fields | |
Grammar | gpolynomial |
Polynomial grammar. More... | |
Private Member Functions | |
Polynomial | make (const detail::power_node &pnode) |
Polynomial | make (const detail::monomial_node &mnode) |
Polynomial | make (const detail::top_node &topnode) |
Aim: This class converts a string polynomial expression in a multivariate polynomial.
Description of template class 'MPolynomialReader'
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. |
TIterator | the type chosen for iterating over characters. |
Definition at line 258 of file MPolynomialReader.h.
typedef TAlloc DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::Alloc |
Definition at line 263 of file MPolynomialReader.h.
typedef MPolynomialGrammar<Iterator> DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::Grammar |
Definition at line 265 of file MPolynomialReader.h.
typedef TIterator DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::Iterator |
Definition at line 262 of file MPolynomialReader.h.
typedef MPolynomial<n, Ring, Alloc > DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::Polynomial |
Definition at line 264 of file MPolynomialReader.h.
typedef TRing DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::Ring |
Definition at line 261 of file MPolynomialReader.h.
|
inline |
bool DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::isValid | ( | ) | const |
Checks the validity/consistency of the object.
|
inlineprivate |
Construct a monomial c * X_e1^k1 * X_e2^k2 * ... as a polynomial
Definition at line 327 of file MPolynomialReader.h.
References DGtal::detail::monomial_node::coef, DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::make(), and DGtal::detail::monomial_node::powers.
|
inlineprivate |
Construct a simple term X_e^k as a polynomial.
Definition at line 319 of file MPolynomialReader.h.
References DGtal::detail::power_node::e, and DGtal::detail::power_node::k.
Referenced by DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::make(), DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::ExprNodeMaker::operator()(), and DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::read().
|
inlineprivate |
Construct a top_node ( ... ) or ( ... )^k or expr1 (*|+|-) expr2 ... as a polynomial
Definition at line 366 of file MPolynomialReader.h.
References DGtal::detail::top_node::exp, DGtal::detail::top_node::expressions, DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::ExprNodeMaker::myP, and DGtal::detail::top_node::ops.
|
inline |
Read any string between begin and end, and builds the corresponding polynomial in p.
p | (returns) the polynomial |
begin | an iterator on the first character to parse. |
end | an iterator pointing after the last character to parse. |
Definition at line 284 of file MPolynomialReader.h.
References DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::gpolynomial, and DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::make().
Referenced by main(), DGtal::Shortcuts< TKSpace >::makeImplicitShape3D(), testDigitalSurfaceBoostGraphInterface(), testMPolynomialReader(), and testMPolynomialReader2().
void DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::selfDisplay | ( | std::ostream & | out | ) | const |
Writes/Displays the object on an output stream.
out | the output stream where the object is written. |
Grammar DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::gpolynomial |
Polynomial grammar.
Definition at line 268 of file MPolynomialReader.h.
Referenced by DGtal::MPolynomialReader< n, TRing, TAlloc, TIterator >::read().