38#include "DGtal/math/MPolynomial.h"
39#include "DGtal/io/readers/MPolynomialReader.h"
48void usage(
int,
char** argv )
50 std::cerr <<
"Usage: " << argv[ 0 ] <<
" <P>" << std::endl;
51 std::cerr <<
"\t - computes the first and second derivative of the given polynomial P (in one variable)." << std::endl;
57int main(
int argc,
char** argv )
71 std::string polynomialString( argv[ 1 ] );
72 std::istringstream polynomialIStream( polynomialString );
74 polynomialIStream >> P;
75 MyPolynomial P1 = derivative<0>( P );
76 MyPolynomial P2 = derivative<0>( P1 );
77 std::cout <<
"P(X_0) = " << P << std::endl;
78 std::cout <<
"P'(X_0) = " << P1 << std::endl;
79 std::cout <<
"P''(X_0) = " << P2 << std::endl;
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.