#include <CGAL/Polytope_distance_d.h>
#include <CGAL/Polytope_distance_d_traits_3.h>
#include <CGAL/Homogeneous.h>
#include <iostream>
#include <cassert>
#ifdef CGAL_USE_GMP
#include <CGAL/Gmpzf.h>
typedef CGAL::Gmpzf ET;
#else
#include <CGAL/MP_Float.h>
typedef CGAL::MP_Float ET;
#endif
typedef K::Point_3 Point;
int main()
{
Point P[8] = { Point(0,0,0), Point(0,0,1), Point(0,1,0), Point(0,1,1),
Point(1,0,0), Point(1,0,1), Point(1,1,0), Point(1,1,1)};
Point Q[8] = { Point(2,2,2), Point(2,2,3), Point(2,3,2), Point(2,3,3),
Point(3,2,2), Point(3,2,3), Point(3,3,2), Point(3,3,3)};
Polytope_distance pd(P, P+8, Q, Q+8);
assert (pd.is_valid());
std::cout << "Squared distance: " <<
Polytope_distance::Coordinate_iterator coord_it;
std::cout << "p:";
for (coord_it = pd.realizing_point_p_coordinates_begin();
coord_it != pd.realizing_point_p_coordinates_end();
++coord_it)
std::cout << " " << *coord_it;
std::cout << std::endl;
std::cout << "q:";
for (coord_it = pd.realizing_point_q_coordinates_begin();
coord_it != pd.realizing_point_q_coordinates_end();
++coord_it)
std::cout << " " << *coord_it;
std::cout << std::endl;
return 0;
}
The class Polytope_distance_d_traits_3 is a traits class for the -dimensional optimisation algorithms...
Definition: Polytope_distance_d_traits_3.h:25
An object of the class Polytope_distance_d represents the (squared) distance between two convex polyt...
Definition: Polytope_distance_d.h:58
double to_double(const NT &x)