realroot_doc 0.1.1
|
#include <realroot/GMP.hpp> #include <realroot/solver_fatarcs.hpp> #include <realroot/Interval.hpp> #include <realroot/Seq.hpp> using namespace mmx; typedef double coeff_t; //typedef GMP::floating coeff_t; typedef domain<coeff_t> box_t; typedef std::vector<coeff_t> vec_t; typedef Seq< box_t > seqbox_t; typedef polynomial< coeff_t, with<MonomialTensor> > monom_t; typedef polynomial< coeff_t, with<Bernstein> > bernstein_t; //typedef solver_fatarcs<coeff_t> sol_t; int main() { bit_precision(512); coeff_t e=10e-5; seqbox_t sols; bernstein_t poly1("4*x^2+4*y^2-0.99-0.4*x"); bernstein_t poly2("4*x*y-0.2*y-0.5"); box_t dom(); std::cout<<"Polynomials: \n"<<poly1<<"\n"<<poly2 <<"\n"; std::cout<<"Tolerance: "<<e <<"\n"; sols=solve_bv_fatarcs(poly1,poly2,e); std::cout<<"Solutions ("<< sols.size()<<"): \n"; for (unsigned i=0; i<sols.size(); ++i ) { sols[i].print(4); }; };