#include <CGAL/config.h>
#ifdef CGAL_USE_MPFI
#include <CGAL/Algebraic_kernel_d_1.h>
#include <vector>
typedef AK::Polynomial_1 Polynomial_1;
typedef AK::Algebraic_real_1 Algebraic_real_1;
typedef AK::Coefficient Coefficient;
typedef AK::Bound Bound;
typedef AK::Multiplicity_type Multiplicity_type;
int main(){
AK ak;
AK::Solve_1 solve_1 = ak.solve_1_object();
AK::Sign_at_1 sign_at_1 = ak.sign_at_1_object();
AK::Is_zero_at_1 is_zero_at_1 = ak.is_zero_at_1_object();
Polynomial_1 p = x*x-5;
std::cout << "Polynomial p: " << p << "\n";
Polynomial_1 q = x-2;
std::cout << "Polynomial q: " << q << "\n";
std::vector<Algebraic_real_1> roots_p,roots_q;
solve_1(p,true, std::back_inserter(roots_p));
solve_1(q,true, std::back_inserter(roots_q));
std::cout << "Sign of the evaluation of root 2 of p in q: "
<< sign_at_1(q,roots_p[1]) << "\n";
std::cout << "Sign of the evaluation of root 1 of q in p: "
<< sign_at_1(p,roots_q[0]) << "\n";
std::cout << "Is zero the evaluation of root 1 of p in p? "
<< is_zero_at_1(p,roots_p[0]) << "\n";
return 0;
}
#else
int main(){
std::cout << "This example requires CGAL to be configured with library MPFI." << std::endl;
return 0;
}
#endif