#include <CGAL/Polynomial.h>
#include <CGAL/Polynomial_traits_d.h>
#include <CGAL/Polynomial_type_generator.h>
int main(){
Poly_2 x = PT_2::Shift()(Poly_2(1),1,0);
Poly_2 y = PT_2::Shift()(Poly_2(1),1,1);
Poly_2 F = 2*x*y + 3*CGAL::ipower(y,3);
std::cout << "The bivariate polynomial F: " << F
<< std::endl << std::endl;
PT_2::Evaluate evaluate;
PT_2::Evaluate_homogeneous hevaluate;
std::cout << "F(5): " << evaluate(F,5)
<< std::endl;
std::cout << "F(5,7): " << hevaluate(F,5,7)
<< std::endl << std::endl;
PT_2::Substitute substitute;
PT_2::Substitute_homogeneous hsubstitute;
std::list<Poly_2> replacements;
replacements.push_back(x-1);
replacements.push_back(y);
std::cout << "The bivariate polynomial F: " << F
<< std::endl;
std::cout << "F(x-1,y): "
<< substitute(F,replacements.begin(),replacements.end())
<< std::endl;
replacements.push_back(y);
std::cout << "F(x-1,y,y): "
<< hsubstitute(F,replacements.begin(),replacements.end())
<< std::endl;
}
A model of concept PolynomialTraits_d
Definition: Polynomial_traits_d.h:13
Mode set_pretty_mode(std::ios &s)