//#define NDEBUG #include #include #include #include #include #include /*template struct Sest_types { typedef CGAL::Simple_cartesian Static_kernel; typedef Static_kernel::FT NT; typedef CGAL::POLYNOMIAL::Polynomial Function; typedef CGAL::POLYNOMIAL::Upper_bound_root_stack_Descartes_traits Root_stack_traits; typedef CGAL::POLYNOMIAL::Upper_bound_root_stack Root_stack; typedef CGAL::POLYNOMIAL::Kernel Function_kernel; typedef CGAL::Kinetic::Handle_degeneracy_function_kernel Simulator_function_kernel; typedef CGAL::Kinetic::Cartesian_kinetic_kernel Kinetic_kernel; typedef typename Simulator_function_kernel::Root Time; typedef CGAL::Kinetic::Two_list_pointer_event_queue Queue_base; struct Event_queue: public Queue_base { Event_queue(const Time &start, const Time &end, Function_kernel fk, int num): Queue_base(start, end, fk, num){} }; typedef CGAL::Kinetic::Default_simulator Simulator; typedef CGAL::Kinetic::Active_objects_vector Active_objects_table; typedef CGAL::Kinetic::Cartesian_instantaneous_kernel Instantaneous_kernel; };*/ /*template struct Exact_simulation_traits: public CGAL::Kinetic::Simulation_traits::Static_kernel, typename Sest_types::Kinetic_kernel, typename Sest_types::Simulator > { };*/ template void check_one(const Traits &tr, const Fn &fn, const Rt &lb, const Rt* rt) { typename Traits::Kinetic_kernel::Function_kernel::Root_stack rs(fn, lb, std::numeric_limits::infinity(), tr.kinetic_kernel_object().function_kernel_object()); while (*rt != std::numeric_limits::infinity()) { if (rs.top() != *rt) { std::cerr << "ERROR For function " << fn << " expected " << *rt << " got " << rs.top() << std::endl; } ++rt; rs.pop(); } if (!rs.empty()) { std::cerr << "ERROR For function " << fn << " expected " << *rt << " got " << rs.top() << std::endl; } } //check the KDS solvers int main(int, char *[]) { /*{ typedef Exact_simulation_traits Traits; Traits tr; typedef Traits::Simulator::Root_stack::Root Root; Root inf= std::numeric_limits::infinity(); Root zero= Root(0); Traits::Simulator::Function_kernel::Construct_function cf= tr.function_kernel_object().construct_function_object(); { check_one(tr, cf(1,-2,1), zero, &inf); } { Root rts[]={Root(1), Root(1), Root(2), Root(2), Root(4), inf}; Traits::Simulator::Function_kernel::Function f= -cf(-1,1)*cf(-1,1)*cf(-2,1)*cf(-2,1)*cf(-4,1); check_one(tr,f , zero, rts); } { Root rts[]={Root(1), Root(1), Root(2),Root(3), Root(3), Root(4), inf}; Traits::Simulator::Function_kernel::Function f= cf(-1,1)*cf(-1,1)*cf(-2,1)*cf(-3,1) *cf(-3,1)*cf(-4,1); check_one(tr,f , zero, rts); } { Root rts[]={Root(0), Root(1), inf}; Traits::Simulator::Function_kernel::Function f= -cf(0,1)*cf(1,-1); check_one(tr,f , zero, rts); } }*/ /* { typedef Exact_simulation_traits Traits; Traits tr; typedef Traits::Simulator::Time Root; Root inf= std::numeric_limits::infinity(); Traits::Kinetic_kernel::Function_kernel::Construct_function cf= tr.kinetic_kernel_object().function_kernel_object().construct_function_object(); Root zero(0); { Root rts[3]={Root(1), Root(1), inf}; Traits::Simulator::Function_kernel::Function f=cf(1,-2,1); check_one(tr, f,zero, rts); } { Root rts[]={Root(1),Root(1),Root(2), Root(2), Root(4), inf}; Traits::Simulator::Function_kernel::Function f= -cf(-1,1)*cf(-1,1)*cf(-2,1)*cf(-2,1)*cf(-4,1); check_one(tr,f , zero, rts); } { Root rts[]={Root(1),Root(1),Root(2), Root(3), Root(3),Root(4), inf}; Traits::Simulator::Function_kernel::Function f= cf(-1,1)*cf(-1,1)*cf(-2,1)*cf(-3,1) *cf(-3,1)*cf(-4,1); check_one(tr,f , zero, rts); } { Root rts[]={Root(0), Root(1), inf}; Traits::Simulator::Function_kernel::Function f= -cf(0,1)*cf(1,-1); check_one(tr,f , zero, rts); } }*/ if (CGAL::Kinetic::internal::audit_failures__ != 0) return EXIT_FAILURE; else return EXIT_SUCCESS; }