5 # ifndef realroot_solver_run_hpp
6 # define realroot_solver_run_hpp
13 # define begin_polynomial "<polynomial"
14 # define end_polynomial "</polynomial>"
18 template<
class POL,
class SLV>
20 double total=0,start,end;
28 for(
int i=0;i<argc;i++)
29 if (
string(argv[i]) ==
string(
"-h")) {
30 std::cout<<
"Usage: "<<argv[0]<<
" file [-h|-q|-v]"<<std::endl;
32 }
else if (
string(argv[i]) ==
string(
"-v"))
34 else if (
string(argv[i]) ==
string(
"-q"))
36 else if (
string(argv[i]) ==
string(
"-n"))
41 std::cout<<
"file: "<<argv[1]<<std::endl;
51 while(
xml::read(in,p,Vr) && (N==0 || nbp < N)) {
59 xml::print(std::cout,*it,
"polynomial")<<std::endl;
60 typename SLV::Solutions sol;
63 xml::print(std::cout,sol,
"solution")<<std::endl;
65 typename SLV::Solutions sol;
68 end = clock(); total += (end - start);
72 cout <<
"<nb_pol>" << nbp <<
"</nb_pol>";
73 cout <<
"<degree>" << deg <<
"</degree>";
74 cout <<
"<nb_root>" <<nr<<
"</nb_root>";
76 cout <<
"<time>" << (total / CLOCKS_PER_SEC) <<
"</time> ";
77 cout <<
"<speed>" << int(nr/(total / CLOCKS_PER_SEC)) <<
"</speed>";
84 #endif //realroot_solver_hpp
iterator end()
Definition: Seq.hpp:88
bool read(ISTREAM &is, polynomial< C, R > &p, variables &V)
Read a polynomial, enclosed in polynomial tags.
Definition: polynomial_xml.hpp:41
dynamic_exp< E >::degree_t degree(const dynamic_exp< E > &t)
Definition: dynamicexp.hpp:191
iterator begin()
Definition: Seq.hpp:87
TMPL int N(const MONOMIAL &v)
Definition: monomial_glue.hpp:60
Seq< typename ContFrac< NT, LB >::root_t > solve(const typename ContFrac< NT >::Poly &f, ContFrac< NT, LB >)
Definition: contfrac.hpp:164
OSTREAM & print(OSTREAM &os, const X &x, const char *tag)
Definition: polynomial_xml.hpp:16
bool in(const T &x, const Interval< T, r > &y)
Definition: Interval_fcts.hpp:100
TMPL POL
Definition: polynomial_dual.hpp:74
void run_solver(int argc, char **argv)
Definition: solver_run.hpp:19
Interval< T, r > max(const Interval< T, r > &a, const Interval< T, r > &b)
Definition: Interval_fcts.hpp:135
Definition: variables.hpp:65