34 #include "DGtal/base/Common.h"
35 #include "DGtal/math/MPolynomial.h"
36 #include "DGtal/io/readers/MPolynomialReader.h"
40 using namespace DGtal;
49 int main(
int ,
char** )
53 MPolynomialReader<3,Ring> reader;
56 std::cout <<
"Type any multi-variate polynomial, then press return." << std::endl
57 <<
"Examples: xyz^3-4yz, (x+y+z)*(x-y-z)^2." << std::endl;
60 if ( cin.good() && ( ! str.empty() ) )
62 std::string::const_iterator iter
63 = reader.read( P, str.begin(), str.end() );
64 bool ok = iter == str.end();
67 std::cerr <<
"ERROR: I read only <"
68 << str.substr( 0, iter - str.begin() )
69 <<
">, and I built P=" << P << std::endl;
71 std::cout << (ok ?
"Ok : " :
"Err: ") << P << std::endl;
73 }
while ( ! str.empty() );