51#include "DGtal/base/Common.h"
52#include "DGtal/math/MPolynomial.h"
53#include "DGtal/io/readers/MPolynomialReader.h"
73 std::cout <<
"Type any multi-variate polynomial, then press return." << std::endl
74 <<
"Examples: xyz^3-4yz, (x+y+z)*(x-y-z)^2." << std::endl;
77 if ( cin.good() && ( ! str.empty() ) )
79 std::string::const_iterator iter
80 = reader.
read( P, str.begin(), str.end() );
81 bool ok = iter == str.end();
84 std::cerr <<
"ERROR: I read only <"
85 << str.substr( 0, iter - str.begin() )
86 <<
">, and I built P=" << P << std::endl;
88 std::cout << (ok ?
"Ok : " :
"Err: ") << P << std::endl;
90 }
while ( ! str.empty() );
Aim: This class converts a string polynomial expression in a multivariate polynomial.
Iterator read(Polynomial &p, Iterator begin, Iterator end)
Aim: Represents a multivariate polynomial, i.e. an element of , where K is some ring or field.
DGtal is the top-level namespace which contains all DGtal functions and types.