#include #include #include #include "JMath/JPolynome.hh" #include "Jeep/JParser.hh" #include "Jeep/JMessage.hh" /** * \file * * Example program to test polynome. * \author mdejong */ int main(int argc, char **argv) { using namespace std; using namespace JPP; JPolynome f1; double precision; int debug; try { JParser<> zap("Example program to test polynome."); zap['P'] = make_field(f1); zap['e'] = make_field(precision) = numeric_limits::min(); zap['d'] = make_field(debug) = 3; zap(argc, argv); } catch(const exception &error) { FATAL(error.what() << endl); } ASSERT(!f1.empty()); DEBUG("polynome: " << f1 << endl); DEBUG("derivative: " << f1.getDerivative() << endl); DEBUG("integral: " << f1.getIntegral() << endl); DEBUG("polynome: " << f1.getDerivative().getIntegral() << endl); DEBUG("polynome: " << f1.getIntegral().getDerivative() << endl); ASSERT(f1.equals(f1.getIntegral().getDerivative(), precision)); return 0; }