Merge branch 'CGAL-use_leda-GF-OLD' into CGAL-use_leda-GF

Conflicts:
	Arrangement_on_surface_2/test/Arrangement_on_surface_2/construction_test_suite_generator.cpp
	Arrangement_on_surface_2/test/Arrangement_on_surface_2/test_construction.cpp
	Documentation/doc/Installation.txt
	Kernel_23/include/CGAL/Exact_predicates_exact_constructions_kernel.h
This commit is contained in:
Sébastien Loriot 2014-06-18 22:50:06 +02:00
commit 0230e979e2
68 changed files with 406 additions and 543 deletions

View File

@ -1,9 +1,6 @@
#include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
#include <CGAL/Gmpq.h>
#include <CGAL/Arr_segment_traits_2.h> #include <CGAL/Arr_segment_traits_2.h>
#include<CGAL/Arr_curve_data_traits_2.h> #include<CGAL/Arr_curve_data_traits_2.h>
@ -17,21 +14,24 @@
#include "utils.h" #include "utils.h"
typedef CGAL::Gmpq Number_type; typedef CGAL::Arithmetic_kernel::Rational Number_type;
typedef CGAL::Simple_cartesian<Number_type> Kernel; typedef CGAL::Simple_cartesian<Number_type> Kernel;
typedef CGAL::Arr_segment_traits_2<Kernel> Base_traits; typedef CGAL::Arr_segment_traits_2<Kernel> Base_traits_2;
typedef Base_traits::Curve_2 Base_curve_2; typedef Base_traits_2::Curve_2 Base_curve_2;
typedef Base_traits::X_monotone_curve_2 Base_x_monotone_curve_2; typedef Base_traits_2::X_monotone_curve_2 Base_x_monotone_curve_2;
typedef std::plus<unsigned int> Unsigned_plus; typedef CGAL::Arr_curve_data_traits_2<Base_traits_2,
typedef CGAL::Arr_curve_data_traits_2<Base_traits, unsigned int, Unsigned_plus> unsigned int,
Traits_2; Unsigned_plus >
typedef Traits_2::Curve_2 Curve_2; Traits_2;
typedef Traits_2::Point_2 Point_2; typedef Traits_2::Curve_2 Curve_2;
typedef Traits_2::X_monotone_curve_2 X_monotone_curve_2; typedef Traits_2::Point_2 Point_2;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2; typedef Traits_2::X_monotone_curve_2 X_monotone_curve_2;
typedef Arrangement_2::Vertex_iterator Vertex_iterator; typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
typedef Arrangement_2::Edge_iterator Edge_iterator; typedef Arrangement_2::Vertex_iterator Vertex_iterator;
typedef std::vector<Curve_2> Curve_container; typedef Arrangement_2::Edge_iterator Edge_iterator;
typedef std::vector<Curve_2> Curve_container;
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {

View File

@ -2,7 +2,7 @@
* kernel-object. * kernel-object.
*/ */
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Gmpq.h> #include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Arr_non_caching_segment_traits_2.h> #include <CGAL/Arr_non_caching_segment_traits_2.h>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
#include <iostream> #include <iostream>
@ -116,7 +116,8 @@ struct Ext_seg_kernel :
{}; {};
// The remaining types: // The remaining types:
typedef CGAL::Gmpq Number_type; // leda_rational, or Gmpq, or Quotient<MP_float>
typedef CGAL::Arithmetic_kernel::Rational Number_type;
typedef Ext_seg_kernel<Number_type> Kernel; typedef Ext_seg_kernel<Number_type> Kernel;
typedef CGAL::Arr_non_caching_segment_traits_2<Kernel> Traits; typedef CGAL::Arr_non_caching_segment_traits_2<Kernel> Traits;
typedef Traits::Point_2 Point_2; typedef Traits::Point_2 Point_2;

View File

@ -2,7 +2,7 @@
* kernel-object. * kernel-object.
*/ */
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Gmpq.h> #include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Arr_non_caching_segment_traits_2.h> #include <CGAL/Arr_non_caching_segment_traits_2.h>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
#include <iostream> #include <iostream>
@ -93,7 +93,8 @@ struct Ext_seg_kernel :
{}; {};
// The remaining types: // The remaining types:
typedef CGAL::Gmpq Number_type;
typedef CGAL::Arithmetic_kernel::Rational Number_type;
typedef Ext_seg_kernel<Number_type> Kernel; typedef Ext_seg_kernel<Number_type> Kernel;
typedef CGAL::Arr_non_caching_segment_traits_2<Kernel> Traits; typedef CGAL::Arr_non_caching_segment_traits_2<Kernel> Traits;
typedef Traits::Point_2 Point_2; typedef Traits::Point_2 Point_2;

View File

@ -1,3 +1,5 @@
#include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Arr_segment_traits_2.h> #include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Arr_extended_dcel.h> #include <CGAL/Arr_extended_dcel.h>
@ -8,22 +10,8 @@
#include <CGAL/graph_traits_Dual_Arrangement_2.h> #include <CGAL/graph_traits_Dual_Arrangement_2.h>
#ifdef CGAL_USE_GMP // leda_rational, or Gmpq, or Quotient<MP_float>
typedef CGAL::Arithmetic_kernel::Rational Number_type;
// GMP is installed. Use the GMP rational number-type.
#include <CGAL/Gmpq.h>
typedef CGAL::Gmpq Number_type;
#else
// GMP is not installed. Use CGAL's exact rational number-type.
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::MP_Float> Number_type;
#endif
typedef CGAL::Cartesian<Number_type> Kernel; typedef CGAL::Cartesian<Number_type> Kernel;
typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2; typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2;

View File

@ -1,20 +1,4 @@
#include <CGAL/basic.h> #include <CGAL/Arithmetic_kernel.h>
#ifdef CGAL_USE_GMP
#include <CGAL/Gmpq.h>
typedef CGAL::Gmpq Number_type;
#else
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::MP_Float> Number_type;
#endif
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
#include <CGAL/Polygon_2.h> #include <CGAL/Polygon_2.h>
#include <CGAL/Polygon_with_holes_2.h> #include <CGAL/Polygon_with_holes_2.h>
@ -28,6 +12,10 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
// leda_rational, or Gmpq, or Quotient<MP_float>
typedef CGAL::Arithmetic_kernel::Rational Number_type;
// instead of // instead of
//typedef CGAL::Simple_cartesian<Number_type> Kernel; //typedef CGAL::Simple_cartesian<Number_type> Kernel;
// workaround for VC++ // workaround for VC++

View File

@ -1,20 +1,4 @@
#include <CGAL/basic.h> #include <CGAL/Arithmetic_kernel.h>
#ifdef CGAL_USE_GMP
#include <CGAL/Gmpq.h>
typedef CGAL::Gmpq Number_type;
#else
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::MP_Float> Number_type;
#endif
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
#include <CGAL/Polygon_2.h> #include <CGAL/Polygon_2.h>
#include <CGAL/Polygon_with_holes_2.h> #include <CGAL/Polygon_with_holes_2.h>
@ -28,6 +12,10 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
// leda_rational, or Gmpq, or Quotient<MP_float>
typedef CGAL::Arithmetic_kernel::Rational Number_type;
// instead of // instead of
//typedef CGAL::Simple_cartesian<Number_type> Kernel; //typedef CGAL::Simple_cartesian<Number_type> Kernel;
// workaround for VC++ // workaround for VC++

View File

@ -1,21 +1,6 @@
#include <CGAL/basic.h>
#ifdef CGAL_USE_GMP
#include <CGAL/Gmpq.h>
typedef CGAL::Gmpq Number_type;
#else
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::MP_Float> Number_type;
#endif
#include <string> #include <string>
#include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
#include <CGAL/Gps_segment_traits_2.h> #include <CGAL/Gps_segment_traits_2.h>
#include <vector> #include <vector>
@ -29,6 +14,8 @@
#include <CGAL/General_polygon_set_2.h> #include <CGAL/General_polygon_set_2.h>
#include <CGAL/Polygon_set_2.h> #include <CGAL/Polygon_set_2.h>
// leda_rational, or Gmpq, or Quotient<MP_float>
typedef CGAL::Arithmetic_kernel::Rational Number_type;
// instead of // instead of
//typedef CGAL::Simple_cartesian<Number_type> Kernel; //typedef CGAL::Simple_cartesian<Number_type> Kernel;

View File

@ -1,21 +1,6 @@
#include <CGAL/basic.h>
#ifdef CGAL_USE_GMP
#include <CGAL/Gmpq.h>
typedef CGAL::Gmpq Number_type;
#else
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::MP_Float> Number_type;
#endif
#include <string> #include <string>
#include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
#include <CGAL/Gps_segment_traits_2.h> #include <CGAL/Gps_segment_traits_2.h>
#include <vector> #include <vector>
@ -29,6 +14,10 @@
#include <CGAL/General_polygon_set_2.h> #include <CGAL/General_polygon_set_2.h>
#include <CGAL/Polygon_set_2.h> #include <CGAL/Polygon_set_2.h>
// leda_rational, or Gmpq, or Quotient<MP_float>
typedef CGAL::Arithmetic_kernel::Rational Number_type;
// instead of // instead of
//typedef CGAL::Simple_cartesian<Number_type> Kernel; //typedef CGAL::Simple_cartesian<Number_type> Kernel;
// workaround for VC++ // workaround for VC++

View File

@ -5,18 +5,9 @@
#ifndef CGAL_BSO_RATIONAL_NT_H #ifndef CGAL_BSO_RATIONAL_NT_H
#define CGAL_BSO_RATIONAL_NT_H #define CGAL_BSO_RATIONAL_NT_H
#include <CGAL/basic.h> #include <CGAL/Arithmetic_kernel.h>
// leda_rational, or Gmpq, or Quotient<MP_float>
#ifdef CGAL_USE_GMP typedef CGAL::Arithmetic_kernel::Rational Number_type;
// GMP is installed. Use the GMP rational number-type.
#include <CGAL/Gmpq.h>
typedef CGAL::Gmpq Number_type;
#else
// GMP is not installed. Use CGAL's exact rational number-type.
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::MP_Float> Number_type;
#endif
#endif #endif
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>

View File

@ -3,18 +3,7 @@
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/assertions_behaviour.h> #include <CGAL/assertions_behaviour.h>
#ifdef CGAL_USE_GMP #include <CGAL/Arithmetic_kernel.h>
// GMP is installed. Use the GMP rational number-type.
#include <CGAL/Gmpq.h>
typedef CGAL::Gmpq Number_type;
#else
// GMP is not installed. Use CGAL's exact rational number-type.
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::MP_Float> Number_type;
#endif
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Gps_segment_traits_2.h> #include <CGAL/Gps_segment_traits_2.h>
#include <CGAL/Boolean_set_operations_2.h> #include <CGAL/Boolean_set_operations_2.h>
@ -24,8 +13,10 @@
#include <sstream> #include <sstream>
#include <iostream> #include <iostream>
// leda_rational, or Gmpq, or Quotient<MP_float>
typedef CGAL::Arithmetic_kernel::Rational Number_type;
typedef CGAL::Cartesian<Number_type> Kernel; typedef CGAL::Cartesian<Number_type> Kernel;
typedef CGAL::Gps_segment_traits_2<Kernel> Traits_2; typedef CGAL::Gps_segment_traits_2<Kernel> Traits_2;
typedef Traits_2::Polygon_2 Polygon_2; typedef Traits_2::Polygon_2 Polygon_2;
typedef Traits_2::Polygon_with_holes_2 Polygon_with_holes_2; typedef Traits_2::Polygon_with_holes_2 Polygon_with_holes_2;
@ -99,7 +90,7 @@ special_warnings(const char *,
<< std::endl; << std::endl;
} }
int main () int main()
{ {
std::cerr << "Modify the w-a-r-n-i-n-g-s handler...\n"; std::cerr << "Modify the w-a-r-n-i-n-g-s handler...\n";
CGAL::set_warning_handler(special_warnings); CGAL::set_warning_handler(special_warnings);

View File

@ -5,7 +5,7 @@
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Min_sphere_of_spheres_d.h> #include <CGAL/Min_sphere_of_spheres_d.h>
#include <CGAL/Gmpq.h> #include <CGAL/Arithmetic_kernel.h>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
@ -13,8 +13,8 @@
#include <cstdlib> #include <cstdlib>
// The program will work with numbers of type FieldType. // The program will work with numbers of type FieldType.
// You can change FieldType to leda_real, for instance. // leda_rational, or Gmpq, or Quotient<MP_float>
typedef CGAL::Gmpq FieldType; typedef CGAL::Arithmetic_kernel::Rational FieldType;
template<typename FT> template<typename FT>
CGAL::Tag_true get_is_exact_tag(const FT&) { CGAL::Tag_true get_is_exact_tag(const FT&) {

View File

@ -10,15 +10,16 @@
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Cartesian_d.h> #include <CGAL/Cartesian_d.h>
#include <CGAL/Min_sphere_of_spheres_d.h> #include <CGAL/Min_sphere_of_spheres_d.h>
#include <CGAL/Gmpq.h> #include <CGAL/Arithmetic_kernel.h>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <ctime> #include <ctime>
// The program will work with numbers of type FieldType. // The program will work with numbers of type FieldType.
// You can change FieldType to leda_real, for instance.
typedef CGAL::Gmpq FieldType; // leda_rational, or Gmpq, or Quotient<MP_float>
typedef CGAL::Arithmetic_kernel::Rational FieldType;
class Ball { class Ball {
private: // representation: private: // representation:
@ -60,8 +61,8 @@ struct BallTraits {
}; };
double to_double(const std::pair<FieldType,FieldType>& p,const FieldType& disc) { double to_double(const std::pair<FieldType,FieldType>& p,const FieldType& disc) {
return to_double(p.first)+to_double(p.second)* return CGAL::to_double(p.first)+CGAL::to_double(p.second)*
std::sqrt(to_double(disc)); std::sqrt(CGAL::to_double(disc));
} }
double uniform() { // a (platform independent) random number generator double uniform() { // a (platform independent) random number generator

View File

@ -30,6 +30,7 @@
#include<CGAL/basic.h> #include<CGAL/basic.h>
#include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Random.h> #include <CGAL/Random.h>
#include <CGAL/Cartesian_d.h> #include <CGAL/Cartesian_d.h>
#include <CGAL/Homogeneous_d.h> #include <CGAL/Homogeneous_d.h>
@ -37,11 +38,11 @@
#include <cassert> #include <cassert>
#include <CGAL/Min_sphere_annulus_d_traits_d.h> #include <CGAL/Min_sphere_annulus_d_traits_d.h>
#include <CGAL/Min_sphere_d.h> #include <CGAL/Min_sphere_d.h>
#include <CGAL/Gmpq.h>
using namespace CGAL; using namespace CGAL;
typedef Gmpq NT; // leda_rational, or Gmpq, or Quotient<MP_float>
typedef CGAL::Arithmetic_kernel::Rational NT;
typedef NT FT; typedef NT FT;
typedef NT RT; typedef NT RT;
typedef Cartesian_d<FT> C; typedef Cartesian_d<FT> C;

View File

@ -39,11 +39,12 @@
#include<CGAL/Min_sphere_d.h> #include<CGAL/Min_sphere_d.h>
#include<CGAL/Min_circle_2.h> #include<CGAL/Min_circle_2.h>
#include<CGAL/Min_circle_2_traits_2.h> //why is this not in Min_circle_2.h #include<CGAL/Min_circle_2_traits_2.h> //why is this not in Min_circle_2.h
#include<CGAL/Gmpq.h> #include <CGAL/Arithmetic_kernel.h>
using namespace CGAL; using namespace CGAL;
typedef Gmpq NT; // leda_rational, or Gmpq, or Quotient<MP_float>
typedef CGAL::Arithmetic_kernel::Rational NT;
typedef NT FT; typedef NT FT;
typedef NT RT; typedef NT RT;
typedef Cartesian<FT> C; typedef Cartesian<FT> C;

View File

@ -25,23 +25,20 @@
// implementation: dD Smallest Enclosing Sphere // implementation: dD Smallest Enclosing Sphere
// ============================================================================ // ============================================================================
// hack to overcome external linkage conflict warning in MIPS
#define __SGI_STL_INTERNAL_RELOPS
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Arithmetic_kernel.h>
// only do something if LEDA available
#include <cassert>
#include<CGAL/Random.h> #include<CGAL/Random.h>
#include<CGAL/Cartesian.h> #include<CGAL/Cartesian.h>
#include<CGAL/Homogeneous.h> #include<CGAL/Homogeneous.h>
#include<CGAL/Min_sphere_annulus_d_traits_3.h> #include<CGAL/Min_sphere_annulus_d_traits_3.h>
#include<CGAL/Min_sphere_d.h> #include<CGAL/Min_sphere_d.h>
#include<CGAL/Gmpq.h>
#include <cassert>
using namespace CGAL; using namespace CGAL;
typedef Gmpq NT; // leda_rational, or Gmpq, or Quotient<MP_float>
typedef CGAL::Arithmetic_kernel::Rational NT;
typedef NT FT; typedef NT FT;
typedef NT RT; typedef NT RT;
typedef Cartesian<FT> C; typedef Cartesian<FT> C;

View File

@ -25,6 +25,7 @@
// implementation: test program for 2D Smallest Enclosing Circle // implementation: test program for 2D Smallest Enclosing Circle
// ============================================================================ // ============================================================================
#include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Homogeneous.h> #include <CGAL/Homogeneous.h>
#include <CGAL/Min_circle_2.h> #include <CGAL/Min_circle_2.h>
@ -37,15 +38,8 @@
#include <cstring> #include <cstring>
#include <fstream> #include <fstream>
#ifdef CGAL_USE_LEDA_FOR_OPTIMISATION_TEST typedef CGAL::Arithmetic_kernel::Integer Rt;
# include <CGAL/leda_integer.h> typedef CGAL::Quotient< Rt > Ft;
typedef leda_integer Rt;
typedef CGAL::Quotient< leda_integer > Ft;
#else
# include <CGAL/Gmpz.h>
typedef CGAL::Gmpz Rt;
typedef CGAL::Quotient< CGAL::Gmpz > Ft;
#endif
typedef CGAL::Cartesian< Ft > KerC; typedef CGAL::Cartesian< Ft > KerC;
typedef CGAL::Homogeneous< Rt > KerH; typedef CGAL::Homogeneous< Rt > KerH;

View File

@ -25,6 +25,7 @@
// implementation: test program for 2D Smallest Enclosing Ellipse // implementation: test program for 2D Smallest Enclosing Ellipse
// ============================================================================ // ============================================================================
#include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Homogeneous.h> #include <CGAL/Homogeneous.h>
#include <CGAL/Min_ellipse_2.h> #include <CGAL/Min_ellipse_2.h>
@ -37,15 +38,11 @@
#include <cstring> #include <cstring>
#include <fstream> #include <fstream>
#ifdef CGAL_USE_LEDA_FOR_OPTIMISATION_TEST
# include <CGAL/leda_integer.h> typedef CGAL::Arithmetic_kernel::Integer Rt;
typedef leda_integer Rt; typedef CGAL::Quotient< Rt > Ft;
typedef CGAL::Quotient< leda_integer > Ft;
#else
# include <CGAL/Gmpz.h>
typedef CGAL::Gmpz Rt;
typedef CGAL::Quotient< CGAL::Gmpz > Ft;
#endif
#ifdef CGAL_USE_CORE #ifdef CGAL_USE_CORE
#include <CGAL/CORE_Expr.h> #include <CGAL/CORE_Expr.h>

View File

@ -184,8 +184,8 @@ namespace CartesianKernelFunctors {
operator()( const Circle_2& c, const Point_2& p) const operator()( const Circle_2& c, const Point_2& p) const
{ {
typename K::Compute_squared_distance_2 squared_distance; typename K::Compute_squared_distance_2 squared_distance;
return enum_cast<Bounded_side>(CGAL_NTS compare(c.squared_radius(), return enum_cast<Bounded_side>(CGAL::compare(c.squared_radius(),
squared_distance(c.center(),p))); squared_distance(c.center(),p)));
} }
result_type result_type
@ -447,14 +447,14 @@ namespace CartesianKernelFunctors {
result_type result_type
operator()(const T1& p, const T2& q, const T3& r) const operator()(const T1& p, const T2& q, const T3& r) const
{ {
return CGAL_NTS compare(squared_distance(p, q), squared_distance(p, r)); return CGAL::compare(squared_distance(p, q), squared_distance(p, r));
} }
template <class T1, class T2, class T3, class T4> template <class T1, class T2, class T3, class T4>
result_type result_type
operator()(const T1& p, const T2& q, const T3& r, const T4& s) const operator()(const T1& p, const T2& q, const T3& r, const T4& s) const
{ {
return CGAL_NTS compare(squared_distance(p, q), squared_distance(r, s)); return CGAL::compare(squared_distance(p, q), squared_distance(r, s));
} }
}; };
@ -477,14 +477,14 @@ namespace CartesianKernelFunctors {
result_type result_type
operator()(const T1& p, const T2& q, const T3& r) const operator()(const T1& p, const T2& q, const T3& r) const
{ {
return CGAL_NTS compare(squared_distance(p, q), squared_distance(p, r)); return CGAL::compare(squared_distance(p, q), squared_distance(p, r));
} }
template <class T1, class T2, class T3, class T4> template <class T1, class T2, class T3, class T4>
result_type result_type
operator()(const T1& p, const T2& q, const T3& r, const T4& s) const operator()(const T1& p, const T2& q, const T3& r, const T4& s) const
{ {
return CGAL_NTS compare(squared_distance(p, q), squared_distance(r, s)); return CGAL::compare(squared_distance(p, q), squared_distance(r, s));
} }
}; };
@ -499,28 +499,28 @@ namespace CartesianKernelFunctors {
result_type result_type
operator()(const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s, const FT& ft) const operator()(const Point_3& p, const Point_3& q, const Point_3& r, const Point_3& s, const FT& ft) const
{ {
return CGAL_NTS compare(squared_radiusC3(p.x(), p.y(), p.z(), return CGAL::compare(squared_radiusC3(p.x(), p.y(), p.z(),
q.x(), q.y(), q.z(), q.x(), q.y(), q.z(),
r.x(), r.y(), r.z(), r.x(), r.y(), r.z(),
s.x(), s.y(), s.z() ), s.x(), s.y(), s.z() ),
ft); ft);
} }
result_type result_type
operator()(const Point_3& p, const Point_3& q, const Point_3& r, const FT& ft) const operator()(const Point_3& p, const Point_3& q, const Point_3& r, const FT& ft) const
{ {
return CGAL_NTS compare(squared_radiusC3(p.x(), p.y(), p.z(), return CGAL::compare(squared_radiusC3(p.x(), p.y(), p.z(),
q.x(), q.y(), q.z(), q.x(), q.y(), q.z(),
r.x(), r.y(), r.z()), r.x(), r.y(), r.z()),
ft); ft);
} }
result_type result_type
operator()(const Point_3& p, const Point_3& q, const FT& ft) const operator()(const Point_3& p, const Point_3& q, const FT& ft) const
{ {
return CGAL_NTS compare(squared_radiusC3(p.x(), p.y(), p.z(), return CGAL::compare(squared_radiusC3(p.x(), p.y(), p.z(),
q.x(), q.y(), q.z() ), q.x(), q.y(), q.z() ),
ft); ft);
} }
result_type result_type
@ -640,7 +640,7 @@ namespace CartesianKernelFunctors {
result_type result_type
operator()( const Point_2& p, const Point_2& q) const operator()( const Point_2& p, const Point_2& q) const
{ return CGAL_NTS compare(p.x(), q.x()); } { return CGAL::compare(p.x(), q.x()); }
result_type result_type
operator()( const Point_2& p, const Line_2& l, const Line_2& h) const operator()( const Point_2& p, const Line_2& l, const Line_2& h) const
@ -671,7 +671,7 @@ namespace CartesianKernelFunctors {
result_type result_type
operator()( const Point_3& p, const Point_3& q) const operator()( const Point_3& p, const Point_3& q) const
{ return CGAL_NTS compare(p.x(), q.x()); } { return CGAL::compare(p.x(), q.x()); }
}; };
template <typename K> template <typename K>
@ -751,7 +751,7 @@ namespace CartesianKernelFunctors {
result_type result_type
operator()( const Point_2& p, const Point_2& q) const operator()( const Point_2& p, const Point_2& q) const
{ return CGAL_NTS compare(p.y(), q.y()); } { return CGAL::compare(p.y(), q.y()); }
result_type result_type
operator()( const Point_2& p, const Line_2& l1, const Line_2& l2) const operator()( const Point_2& p, const Line_2& l1, const Line_2& l2) const
@ -786,7 +786,7 @@ namespace CartesianKernelFunctors {
result_type result_type
operator()( const Point_3& p, const Point_3& q) const operator()( const Point_3& p, const Point_3& q) const
{ return CGAL_NTS compare(p.y(), q.y()); } { return CGAL::compare(p.y(), q.y()); }
}; };
template <typename K> template <typename K>
@ -798,7 +798,7 @@ namespace CartesianKernelFunctors {
result_type result_type
operator()( const Point_3& p, const Point_3& q) const operator()( const Point_3& p, const Point_3& q) const
{ return CGAL_NTS compare(p.z(), q.z()); } { return CGAL::compare(p.z(), q.z()); }
}; };
template <class K> template <class K>

View File

@ -1,4 +1,4 @@
#include<CGAL/Gmpz.h> #include <CGAL/Arithmetic_kernel.h>
#include<CGAL/Homogeneous.h> #include<CGAL/Homogeneous.h>
#include<CGAL/Nef_polyhedron_3.h> #include<CGAL/Nef_polyhedron_3.h>
#include<CGAL/IO/Nef_polyhedron_iostream_3.h> #include<CGAL/IO/Nef_polyhedron_iostream_3.h>
@ -8,7 +8,7 @@
#include<CGAL/Nef_3/SNC_indexed_items.h> #include<CGAL/Nef_3/SNC_indexed_items.h>
#include<fstream> #include<fstream>
typedef CGAL::Gmpz RT; typedef CGAL::Arithmetic_kernel::Integer RT;
typedef CGAL::Homogeneous<RT> Kernel; typedef CGAL::Homogeneous<RT> Kernel;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron_3; typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron_3;
//typedef CGAL::Nef_polyhedron_3<Kernel, CGAL::SNC_indexed_items> Nef_polyhedron_3; //typedef CGAL::Nef_polyhedron_3<Kernel, CGAL::SNC_indexed_items> Nef_polyhedron_3;

View File

@ -1,8 +1,8 @@
#include<CGAL/Gmpz.h> #include <CGAL/Arithmetic_kernel.h>
#include<CGAL/Homogeneous.h> #include<CGAL/Homogeneous.h>
#include<CGAL/Convex_decomposition_3/Edge_sorter.h> #include<CGAL/Convex_decomposition_3/Edge_sorter.h>
typedef CGAL::Gmpz RT; typedef CGAL::Arithmetic_kernel::Integer RT;
typedef CGAL::Homogeneous<RT> Kernel; typedef CGAL::Homogeneous<RT> Kernel;
typedef Kernel::Point_3 Point_3; typedef Kernel::Point_3 Point_3;
typedef Kernel::FT FT; typedef Kernel::FT FT;

View File

@ -1,5 +1,5 @@
#include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Homogeneous.h> #include <CGAL/Homogeneous.h>
#include <CGAL/Gmpz.h>
#include <CGAL/Nef_S2/Sphere_point.h> #include <CGAL/Nef_S2/Sphere_point.h>
#include <CGAL/Nef_S2/Sphere_circle.h> #include <CGAL/Nef_S2/Sphere_circle.h>
#include <CGAL/Nef_S2/Sphere_segment.h> #include <CGAL/Nef_S2/Sphere_segment.h>
@ -60,7 +60,8 @@ int main()
// CGAL_NEF_SETDTHREAD(239); // CGAL_NEF_SETDTHREAD(239);
typedef CGAL::Homogeneous<CGAL::Gmpz> Kernel; typedef CGAL::Arithmetic_kernel::Integer RT;
typedef CGAL::Homogeneous<RT> Kernel;
typedef Test_SNC<Kernel> SNC; typedef Test_SNC<Kernel> SNC;
typedef SNC::Point_3 Point_3; typedef SNC::Point_3 Point_3;
typedef SNC::Sphere_point Sphere_point; typedef SNC::Sphere_point Sphere_point;

View File

@ -1,3 +1,4 @@
#include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h> #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
@ -7,18 +8,9 @@
#include <CGAL/assertions.h> #include <CGAL/assertions.h>
#include <boost/type_traits.hpp> #include <boost/type_traits.hpp>
#ifdef CGAL_USE_LEDA
# include <CGAL/leda_rational.h> typedef CGAL::Arithmetic_kernel::Rational Precise_rational;
typedef leda_rational Precise_rational;
#elif defined CGAL_USE_GMP
# include <CGAL/Gmpz.h>
# include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::Gmpz> Precise_rational;
#else
# include <CGAL/MP_Float.h>
# include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::MP_Float> Precise_rational;
#endif
typedef CGAL::Exact_predicates_exact_constructions_kernel EPEC; typedef CGAL::Exact_predicates_exact_constructions_kernel EPEC;
typedef CGAL::Exact_predicates_inexact_constructions_kernel EPIC; typedef CGAL::Exact_predicates_inexact_constructions_kernel EPIC;

View File

@ -1,4 +1,4 @@
#include <CGAL/basic.h> #include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <fstream> #include <fstream>
@ -9,20 +9,8 @@
#include <CGAL/point_generators_3.h> #include <CGAL/point_generators_3.h>
#include <cassert> #include <cassert>
#ifdef CGAL_USE_LEDA
# include <CGAL/leda_rational.h>
typedef leda_rational Precise_rational;
#elif defined CGAL_USE_GMP
# include <CGAL/Gmpz.h>
# include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::Gmpz> Precise_rational;
#else
# include <CGAL/MP_Float.h>
# include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::MP_Float> Precise_rational;
#endif
typedef CGAL::Arithmetic_kernel::Rational Precise_rational;
typedef CGAL::Cartesian< Precise_rational > R; typedef CGAL::Cartesian< Precise_rational > R;
typedef CGAL::Convex_hull_traits_3<R> Traits; typedef CGAL::Convex_hull_traits_3<R> Traits;
typedef Traits::Polyhedron_3 Polyhedron_3; typedef Traits::Polyhedron_3 Polyhedron_3;

View File

@ -1,3 +1,4 @@
#include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Convex_hull_traits_3.h> #include <CGAL/Convex_hull_traits_3.h>
@ -6,21 +7,8 @@
#include <CGAL/point_generators_3.h> #include <CGAL/point_generators_3.h>
#include <vector> #include <vector>
#include <cassert> #include <cassert>
#ifdef CGAL_USE_LEDA
# include <CGAL/leda_rational.h>
typedef leda_rational Precise_rational;
#elif defined CGAL_USE_GMP
# include <CGAL/Gmpz.h>
# include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::Gmpz> Precise_rational;
#else
# include <CGAL/MP_Float.h>
# include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::MP_Float> Precise_rational;
#endif
typedef CGAL::Arithmetic_kernel::Rational NT;
typedef Precise_rational NT;
typedef CGAL::Cartesian<NT> K; typedef CGAL::Cartesian<NT> K;
typedef CGAL::Convex_hull_traits_3<K> Traits; typedef CGAL::Convex_hull_traits_3<K> Traits;
typedef Traits::Polyhedron_3 Polyhedron_3; typedef Traits::Polyhedron_3 Polyhedron_3;

View File

@ -1163,7 +1163,7 @@ usage of \sc{Gmp} and of \sc{Mpfr} will be disabled.
| Variable | Description | Type | | Variable | Description | Type |
| :- | :- | :- | | :- | :- | :- |
| `WITH_GMP` | Indicates whether to search and use \sc{Gmp}/\sc{Mpfr} or not | CMake | | `CGAL_DISABLE_GMP` | Indicates whether to search and use \sc{Gmp}/\sc{Mpfr} or not | CMake |
| `GMP_DIR` | Directory of \sc{Gmp} default installation | Environment | | `GMP_DIR` | Directory of \sc{Gmp} default installation | Environment |
| `GMP_INCLUDE_DIR` | Directory containing the `gmp.h` file | CMake | | `GMP_INCLUDE_DIR` | Directory containing the `gmp.h` file | CMake |
| `GMP_INC_DIR` | Idem | Environment | | `GMP_INC_DIR` | Idem | Environment |

View File

@ -1,16 +1,4 @@
#include <CGAL/basic.h> #include <CGAL/Arithmetic_kernel.h>
#ifdef CGAL_USE_GMP
// GMP is installed. Use the GMP rational number-type.
#include <CGAL/Gmpq.h>
typedef CGAL::Gmpq NT;
#else
// GMP is not installed. Use CGAL's exact rational number-type.
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::MP_Float> NT;
#endif
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Arr_segment_traits_2.h> #include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Arr_curve_data_traits_2.h> #include <CGAL/Arr_curve_data_traits_2.h>
@ -23,6 +11,8 @@
using std::strcmp; using std::strcmp;
// leda_rational, or Gmpq, or Quotient<MP_float>
typedef CGAL::Arithmetic_kernel::Rational NT;
typedef CGAL::Cartesian<NT> Kernel; typedef CGAL::Cartesian<NT> Kernel;
typedef CGAL::Arr_segment_traits_2<Kernel> Segment_traits_2; typedef CGAL::Arr_segment_traits_2<Kernel> Segment_traits_2;
typedef CGAL::Arr_curve_data_traits_2<Segment_traits_2, typedef CGAL::Arr_curve_data_traits_2<Segment_traits_2,

View File

@ -1,6 +1,5 @@
#include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Gmpq.h>
#include <CGAL/Timer.h> #include <CGAL/Timer.h>
#include <CGAL/Env_triangle_traits_3.h> #include <CGAL/Env_triangle_traits_3.h>
@ -14,7 +13,8 @@
#include <vector> #include <vector>
#include <map> #include <map>
typedef CGAL::Gmpq NT; // leda_rational, or Gmpq, or Quotient<MP_float>
typedef CGAL::Arithmetic_kernel::Rational NT;
typedef CGAL::Cartesian<NT> Kernel; typedef CGAL::Cartesian<NT> Kernel;
typedef Kernel::Point_3 Point_3; typedef Kernel::Point_3 Point_3;

View File

@ -127,8 +127,8 @@ namespace HomogeneousKernelFunctors {
operator()( const Circle_2& c, const Point_2& p) const operator()( const Circle_2& c, const Point_2& p) const
{ {
typename K::Compute_squared_distance_2 squared_distance; typename K::Compute_squared_distance_2 squared_distance;
return enum_cast<Bounded_side>(CGAL_NTS compare(c.squared_radius(), return enum_cast<Bounded_side>(CGAL::compare(c.squared_radius(),
squared_distance(c.center(),p))); squared_distance(c.center(),p)));
} }
result_type result_type
@ -676,14 +676,14 @@ namespace HomogeneousKernelFunctors {
result_type result_type
operator()(const T1& p, const T2& q, const T3& r) const operator()(const T1& p, const T2& q, const T3& r) const
{ {
return CGAL_NTS compare(squared_distance(p, q), squared_distance(p, r)); return CGAL::compare(squared_distance(p, q), squared_distance(p, r));
} }
template <class T1, class T2, class T3, class T4> template <class T1, class T2, class T3, class T4>
result_type result_type
operator()(const T1& p, const T2& q, const T3& r, const T4& s) const operator()(const T1& p, const T2& q, const T3& r, const T4& s) const
{ {
return CGAL_NTS compare(squared_distance(p, q), squared_distance(r, s)); return CGAL::compare(squared_distance(p, q), squared_distance(r, s));
} }
}; };
@ -729,14 +729,14 @@ namespace HomogeneousKernelFunctors {
result_type result_type
operator()(const T1& p, const T2& q, const T3& r) const operator()(const T1& p, const T2& q, const T3& r) const
{ {
return CGAL_NTS compare(squared_distance(p, q), squared_distance(p, r)); return CGAL::compare(squared_distance(p, q), squared_distance(p, r));
} }
template <class T1, class T2, class T3, class T4> template <class T1, class T2, class T3, class T4>
result_type result_type
operator()(const T1& p, const T2& q, const T3& r, const T4& s) const operator()(const T1& p, const T2& q, const T3& r, const T4& s) const
{ {
return CGAL_NTS compare(squared_distance(p, q), squared_distance(r, s)); return CGAL::compare(squared_distance(p, q), squared_distance(r, s));
} }
}; };
@ -766,11 +766,11 @@ namespace HomogeneousKernelFunctors {
if (l1_sign > l2_sign) return LARGER; if (l1_sign > l2_sign) return LARGER;
if (l1_sign > 0) if (l1_sign > 0)
return CGAL_NTS compare( CGAL_NTS abs(l1.a() * l2.b()), return CGAL::compare( CGAL::abs(l1.a() * l2.b()),
CGAL_NTS abs(l2.a() * l1.b()) ); CGAL::abs(l2.a() * l1.b()) );
return CGAL_NTS compare( CGAL_NTS abs(l2.a() * l1.b()), return CGAL::compare( CGAL::abs(l2.a() * l1.b()),
CGAL_NTS abs(l1.a() * l2.b()) ); CGAL::abs(l1.a() * l2.b()) );
} // FIXME } // FIXME
result_type result_type
@ -855,7 +855,7 @@ namespace HomogeneousKernelFunctors {
result_type result_type
operator()( const Point_2& p, const Line_2& h1, const Line_2& h2) const operator()( const Point_2& p, const Line_2& h1, const Line_2& h2) const
{ return CGAL_NTS compare(h1.x_at_y( p.y() ), h2.x_at_y( p.y() )); } { return CGAL::compare(h1.x_at_y( p.y() ), h2.x_at_y( p.y() )); }
// FIXME // FIXME
result_type result_type
@ -905,7 +905,7 @@ namespace HomogeneousKernelFunctors {
// same x and y // same x and y
pV = p.hz()*q.hw(); pV = p.hz()*q.hw();
qV = q.hz()*p.hw(); qV = q.hz()*p.hw();
return CGAL_NTS compare(pV, qV); return CGAL::compare(pV, qV);
} }
}; };
@ -935,7 +935,7 @@ namespace HomogeneousKernelFunctors {
pV = phy*qhw; pV = phy*qhw;
qV = qhy*phw; qV = qhy*phw;
} }
return CGAL_NTS compare(pV, qV); return CGAL::compare(pV, qV);
} }
}; };
@ -965,7 +965,7 @@ namespace HomogeneousKernelFunctors {
pV = phx*qhw; pV = phx*qhw;
qV = qhx*phw; qV = qhx*phw;
} }
return CGAL_NTS compare(pV, qV); return CGAL::compare(pV, qV);
} }
}; };
@ -993,7 +993,7 @@ namespace HomogeneousKernelFunctors {
// same x // same x
pV = p.hy()*q.hw(); pV = p.hy()*q.hw();
qV = q.hy()*p.hw(); qV = q.hy()*p.hw();
return CGAL_NTS compare(pV, qV); return CGAL::compare(pV, qV);
} }
}; };
@ -1008,7 +1008,7 @@ namespace HomogeneousKernelFunctors {
result_type result_type
operator()( const Point_2& p, const Point_2& q) const operator()( const Point_2& p, const Point_2& q) const
{ {
return CGAL_NTS compare(p.hx()*q.hw(), q.hx()*p.hw()); return CGAL::compare(p.hx()*q.hw(), q.hx()*p.hw());
} }
result_type result_type
@ -1043,7 +1043,7 @@ namespace HomogeneousKernelFunctors {
result_type result_type
operator()( const Point_3& p, const Point_3& q) const operator()( const Point_3& p, const Point_3& q) const
{ return CGAL_NTS compare(p.hx() * q.hw(), q.hx() * p.hw() ); } { return CGAL::compare(p.hx() * q.hw(), q.hx() * p.hw() ); }
}; };
template <typename K> template <typename K>
@ -1067,7 +1067,7 @@ namespace HomogeneousKernelFunctors {
result_type result_type
operator()( const Point_2& p, const Line_2& h1, const Line_2& h2) const operator()( const Point_2& p, const Line_2& h1, const Line_2& h2) const
{ return CGAL_NTS compare(h1.y_at_x( p.x() ), h2.y_at_x( p.x() )); } { return CGAL::compare(h1.y_at_x( p.x() ), h2.y_at_x( p.x() )); }
// FIXME // FIXME
result_type result_type
@ -1140,11 +1140,11 @@ namespace HomogeneousKernelFunctors {
FT s1stx = s1sx-s1tx; FT s1stx = s1sx-s1tx;
FT s2stx = s2sx-s2tx; FT s2stx = s2sx-s2tx;
return CGAL_NTS compare(s1sx, s1tx) * return CGAL::compare(s1sx, s1tx) *
CGAL_NTS compare(s2sx, s2tx) * CGAL::compare(s2sx, s2tx) *
CGAL_NTS compare(-(s1sx-px)*(s1sy-s1ty)*s2stx, CGAL::compare(-(s1sx-px)*(s1sy-s1ty)*s2stx,
(s2sy-s1sy)*s2stx*s1stx (s2sy-s1sy)*s2stx*s1stx
-(s2sx-px)*(s2sy-s2ty)*s1stx); -(s2sx-px)*(s2sy-s2ty)*s1stx);
} }
else { else {
if (s1sx == s1tx) { // s1 is vertical if (s1sx == s1tx) { // s1 is vertical
@ -1183,7 +1183,7 @@ namespace HomogeneousKernelFunctors {
const RT& phw = p.hw(); const RT& phw = p.hw();
const RT& qhy = q.hy(); const RT& qhy = q.hy();
const RT& qhw = q.hw(); const RT& qhw = q.hw();
return CGAL_NTS compare(phy * qhw, qhy * phw); return CGAL::compare(phy * qhw, qhy * phw);
} }
result_type result_type
@ -1218,7 +1218,7 @@ namespace HomogeneousKernelFunctors {
result_type result_type
operator()( const Point_3& p, const Point_3& q) const operator()( const Point_3& p, const Point_3& q) const
{ return CGAL_NTS compare(p.hy() * q.hw(), q.hy() * p.hw() ); } { return CGAL::compare(p.hy() * q.hw(), q.hy() * p.hw() ); }
}; };
template <typename K> template <typename K>
@ -1230,7 +1230,7 @@ namespace HomogeneousKernelFunctors {
result_type result_type
operator()( const Point_3& p, const Point_3& q) const operator()( const Point_3& p, const Point_3& q) const
{ return CGAL_NTS compare(p.hz() * q.hw(), q.hz() * p.hw() ); } { return CGAL::compare(p.hz() * q.hw(), q.hz() * p.hw() ); }
}; };
template <typename K> template <typename K>
@ -4197,7 +4197,7 @@ namespace HomogeneousKernelFunctors {
RT C = qhx*rhw - qhw*rhx; RT C = qhx*rhw - qhw*rhx;
RT D = qhy*rhw - qhw*rhy; RT D = qhy*rhw - qhw*rhy;
return CGAL_NTS compare(A*D, B*C); return CGAL::compare(A*D, B*C);
} }
result_type result_type
@ -4330,8 +4330,8 @@ namespace HomogeneousKernelFunctors {
const RT& thw = t.hw(); const RT& thw = t.hw();
return enum_cast<Bounded_side>( return enum_cast<Bounded_side>(
CGAL_NTS compare((thx*phw-phx*thw)*(qhx*thw-thx*qhw), CGAL::compare((thx*phw-phx*thw)*(qhx*thw-thx*qhw),
(thy*phw-phy*thw)*(thy*qhw-qhy*thw)) ); (thy*phw-phy*thw)*(thy*qhw-qhy*thw)) );
} }
result_type result_type

View File

@ -534,7 +534,32 @@ set_special_prefix(QGLViewer QGLVIEWER)
set_special_prefix(Coin3D COIN3D) set_special_prefix(Coin3D COIN3D)
# some libraries are essential (stl and Boost.Thread are treated in another way) # some libraries are essential (stl and Boost.Thread are treated in another way)
list (INSERT CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES 0 GMP MPFR) if("$ENV{CGAL_DISABLE_GMP}" OR CGAL_DISABLE_GMP)
list(LENGTH CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES CGAL_ESSENTIAL_LENGTH)
if(NOT CGAL_ESSENTIAL_LENGTH EQUAL 0)
list(REMOVE_ITEM CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES GMP MPFR)
endif()
unset(CGAL_CONFIGURED_LIBRARIES)
unset(CGAL_CONFIGURED_LIBRARIES CACHE)
unset(GMP_FOUND)
unset(GMP_FOUND CACHE)
unset(GMPXX_FOUND)
unset(GMPXX_FOUND CACHE)
unset(MPFR_FOUND)
unset(MPFR_FOUND CACHE)
unset(WITH_CGAL_Core)
unset(WITH_CGAL_Core CACHE)
unset(WITH_GMP)
unset(WITH_GMP CACHE)
unset(WITH_GMPXX)
unset(WITH_GMPXX CACHE)
unset(WITH_MPFR)
unset(WITH_MPFR CACHE)
else()
list(APPEND CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES GMP MPFR)
# Where CMake is run several times, to avoid duplicates
list (REMOVE_DUPLICATES CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES)
endif()
hide_variable(CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES) hide_variable(CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES)
foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES}) foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES})

View File

@ -369,11 +369,17 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
use_component( MPFI ) use_component( MPFI )
endif() endif()
use_component( MPFR ) if(MPFR_FOUND)
use_component( MPFR )
endif()
if (GMPXX_FOUND) if (GMPXX_FOUND)
use_component( GMPXX ) use_component( GMPXX )
endif() endif()
use_component( GMP )
if(GMP_FOUND)
use_component( GMP )
endif()
if(LEDA_FOUND) if(LEDA_FOUND)
use_component( LEDA ) use_component( LEDA )

View File

@ -56,7 +56,7 @@ foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES})
if (${lib} STREQUAL "LEDA") if (${lib} STREQUAL "LEDA")
# special case for LEDA - add a flag # special case for LEDA - add a flag
message( STATUS "$LEDA cxx flags: ${LEDA_CXX_FLAGS}" ) message( STATUS "LEDA cxx flags: ${LEDA_CXX_FLAGS}" )
uniquely_add_flags( CMAKE_CXX_FLAGS ${LEDA_CXX_FLAGS} ) uniquely_add_flags( CMAKE_CXX_FLAGS ${LEDA_CXX_FLAGS} )
endif() endif()

View File

@ -12,14 +12,14 @@ else()
DOC "The directory containing the LEDA header files WITHOUT the LEDA prefix" DOC "The directory containing the LEDA header files WITHOUT the LEDA prefix"
) )
find_library(LEDA_LIBRARY_RELEASE NAMES "leda" find_library(LEDA_LIBRARY_RELEASE NAMES "leda_md" "leda"
HINTS ENV LEDA_LIB_DIR HINTS ENV LEDA_LIB_DIR
ENV LEDA_DIR ENV LEDA_DIR
# PATH_SUFFIXES lib # PATH_SUFFIXES lib
DOC "Path to the LEDA library" DOC "Path to the LEDA library"
) )
find_library(LEDA_LIBRARY_DEBUG NAMES "ledaD" find_library(LEDA_LIBRARY_DEBUG NAMES "leda_mdd" "ledaD"
HINTS ENV LEDA_LIB_DIR HINTS ENV LEDA_LIB_DIR
ENV LEDA_DIR ENV LEDA_DIR
# PATH_SUFFIXES lib # PATH_SUFFIXES lib

View File

@ -128,8 +128,7 @@ foreach(package ${CGAL_CONFIGURED_PACKAGES})
cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_INCLUDE_DIRS "" ) cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_INCLUDE_DIRS "" )
cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES "" ) cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES "" )
cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES_DIRS "" ) cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES_DIRS "" )
if (${CGAL_CONFIGURED_LIBRARY_NAME} STREQUAL "CGAL_Core")
if (${CGAL_CONFIGURED_LIBRARY_NAME} STREQUAL "Core")
if (NOT CGAL_NO_CORE) if (NOT CGAL_NO_CORE)
configure_component( ${package}/src/${CGAL_CONFIGURED_LIBRARY_NAME} ${CGAL_CONFIGURED_LIBRARY_NAME}) configure_component( ${package}/src/${CGAL_CONFIGURED_LIBRARY_NAME} ${CGAL_CONFIGURED_LIBRARY_NAME})
else(NOT CGAL_NO_CORE) else(NOT CGAL_NO_CORE)

View File

@ -26,7 +26,10 @@
#if defined(BOOST_MSVC) #if defined(BOOST_MSVC)
# pragma warning(disable:4244) // int to float conversion warning # pragma warning(disable:4244) // int to float conversion warning
#endif #endif
#include <CGAL/Arithmetic_kernel.h>
// leda_rational, or Gmpq, or Quotient<MP_float>
typedef CGAL::Arithmetic_kernel::Rational Rational;
#include <CGAL/intersections.h> #include <CGAL/intersections.h>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
@ -679,11 +682,9 @@ int main()
std::cout << std::endl << "Testing with Simple_cartesian<double>..." << std::endl ; std::cout << std::endl << "Testing with Simple_cartesian<double>..." << std::endl ;
b &= test_kernel<CGAL::Simple_cartesian<double> >(true); b &= test_kernel<CGAL::Simple_cartesian<double> >(true);
#ifdef CGAL_USE_GMP std::cout << std::endl << "Testing with Simple_cartesian<Rational>..." << std::endl ;
std::cout << std::endl << "Testing with Simple_cartesian<Gmpq>..." << std::endl ; b &= test_kernel<CGAL::Simple_cartesian<Rational> >(true);
b &= test_kernel<CGAL::Simple_cartesian<CGAL::Gmpq> >(true);
#endif
std::cout << std::endl << "Testing with Cartesian<float>..." << std::endl ; std::cout << std::endl << "Testing with Cartesian<float>..." << std::endl ;
b &= test_kernel<CGAL::Cartesian<float> >(false); b &= test_kernel<CGAL::Cartesian<float> >(false);

View File

@ -1,19 +1,14 @@
#include <cassert> #include <cassert>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#ifdef CGAL_USE_GMP #include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Gmpq.h>
typedef CGAL::Gmpq NT;
#else
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::MP_Float> NT;
#endif
typedef CGAL::Cartesian<NT> Kernel; // leda_rational, or Gmpq, or Quotient<MP_float>
typedef Kernel::Triangle_3 Triangle; typedef CGAL::Arithmetic_kernel::Rational NT;
typedef Kernel::Point_3 Point; typedef CGAL::Cartesian<NT> Kernel;
typedef Kernel::Segment_3 Segment; typedef Kernel::Triangle_3 Triangle;
typedef std::vector<Point> Polygon2; typedef Kernel::Point_3 Point;
typedef Kernel::Segment_3 Segment;
typedef std::vector<Point> Polygon2;
void test_coplanar_triangles(){ void test_coplanar_triangles(){
CGAL::Object obj; CGAL::Object obj;

View File

@ -37,7 +37,7 @@
namespace CGAL { namespace CGAL {
// Epeck_ft is either Gmpq or Quotient<MP_float> // Epeck_ft is either Gmpq, or leda_rational, or Quotient<MP_float>
typedef internal::Exact_field_selector<double>::Type Epeck_ft; typedef internal::Exact_field_selector<double>::Type Epeck_ft;
// The following are redefined kernels instead of simple typedefs in order to shorten // The following are redefined kernels instead of simple typedefs in order to shorten

View File

@ -223,9 +223,9 @@ namespace CommonKernelFunctors {
if(sc_prod_1 >= 0 ) { if(sc_prod_1 >= 0 ) {
if(cosine >= 0) { if(cosine >= 0) {
// the two cosine are >= 0, cosine is decreasing on [0,1] // the two cosine are >= 0, cosine is decreasing on [0,1]
return compare(CGAL::square(cosine)* return CGAL::compare(CGAL::square(cosine)*
abac1.squared_length()*abad1.squared_length(), abac1.squared_length()*abad1.squared_length(),
CGAL::square(sc_prod_1)); CGAL::square(sc_prod_1));
} }
else { else {
return SMALLER; return SMALLER;
@ -234,9 +234,9 @@ namespace CommonKernelFunctors {
else { else {
if(cosine < 0) { if(cosine < 0) {
// the two cosine are < 0, cosine is increasing on [-1,0] // the two cosine are < 0, cosine is increasing on [-1,0]
return compare(CGAL::square(sc_prod_1), return CGAL::compare(CGAL::square(sc_prod_1),
CGAL::square(cosine)* CGAL::square(cosine)*
abac1.squared_length()*abad1.squared_length()); abac1.squared_length()*abad1.squared_length());
} }
else else
return LARGER; return LARGER;
@ -272,10 +272,10 @@ namespace CommonKernelFunctors {
if(sc_prod_1 >= 0 ) { if(sc_prod_1 >= 0 ) {
if(sc_prod_2 >= 0) { if(sc_prod_2 >= 0) {
// the two cosine are >= 0, cosine is decreasing on [0,1] // the two cosine are >= 0, cosine is decreasing on [0,1]
return compare(CGAL::square(sc_prod_2)* return CGAL::compare(CGAL::square(sc_prod_2)*
abac1.squared_length()*abad1.squared_length(), abac1.squared_length()*abad1.squared_length(),
CGAL::square(sc_prod_1)* CGAL::square(sc_prod_1)*
abac2.squared_length()*abad2.squared_length()); abac2.squared_length()*abad2.squared_length());
} }
else { else {
return SMALLER; return SMALLER;
@ -284,10 +284,10 @@ namespace CommonKernelFunctors {
else { else {
if(sc_prod_2 < 0) { if(sc_prod_2 < 0) {
// the two cosine are < 0, cosine is increasing on [-1,0] // the two cosine are < 0, cosine is increasing on [-1,0]
return compare(CGAL::square(sc_prod_1)* return CGAL::compare(CGAL::square(sc_prod_1)*
abac2.squared_length()*abad2.squared_length(), abac2.squared_length()*abad2.squared_length(),
CGAL::square(sc_prod_2)* CGAL::square(sc_prod_2)*
abac1.squared_length()*abad1.squared_length()); abac1.squared_length()*abad1.squared_length());
} }
else else
return LARGER; return LARGER;
@ -306,14 +306,14 @@ namespace CommonKernelFunctors {
result_type result_type
operator()(const T1& p, const T2& q, const FT& d2) const operator()(const T1& p, const T2& q, const FT& d2) const
{ {
return CGAL_NTS compare(squared_distance(p, q), d2); return CGAL::compare(squared_distance(p, q), d2);
} }
template <class T1, class T2, class T3, class T4> template <class T1, class T2, class T3, class T4>
result_type result_type
operator()(const T1& p, const T2& q, const T3& r, const T4& s) const operator()(const T1& p, const T2& q, const T3& r, const T4& s) const
{ {
return CGAL_NTS compare(squared_distance(p, q), squared_distance(r, s)); return CGAL::compare(squared_distance(p, q), squared_distance(r, s));
} }
}; };
@ -328,14 +328,14 @@ namespace CommonKernelFunctors {
result_type result_type
operator()(const T1& p, const T2& q, const FT& d2) const operator()(const T1& p, const T2& q, const FT& d2) const
{ {
return CGAL_NTS compare(squared_distance(p, q), d2); return CGAL::compare(squared_distance(p, q), d2);
} }
template <class T1, class T2, class T3, class T4> template <class T1, class T2, class T3, class T4>
result_type result_type
operator()(const T1& p, const T2& q, const T3& r, const T4& s) const operator()(const T1& p, const T2& q, const T3& r, const T4& s) const
{ {
return CGAL_NTS compare(squared_distance(p, q), squared_distance(r, s)); return CGAL::compare(squared_distance(p, q), squared_distance(r, s));
} }
}; };

View File

@ -31,7 +31,7 @@ _test_io_for(const T& t)
{ {
{ {
std::ofstream oFile("Test_IO.out", std::ios::out); std::ofstream oFile("Test_IO.out", std::ios::out);
oFile << t; oFile << t << std::endl;
} }
std::ifstream iFile("Test_IO.out", std::ios::in); std::ifstream iFile("Test_IO.out", std::ios::in);

View File

@ -8,19 +8,12 @@
#define VEC_DIM 10 #define VEC_DIM 10
#define MAT_DIM 10 #define MAT_DIM 10
#ifdef CGAL_USE_LEDA #include <CGAL/Arithmetic_kernel.h>
#include <CGAL/leda_integer.h> #if defined( CGAL_USE_LEDA) || defined ( CGAL_USE_GMP )
#include <CGAL/leda_rational.h>
typedef leda_integer RT;
typedef leda_rational FT;
#elif defined CGAL_USE_GMP typedef CGAL::Arithmetic_kernel::Integer RT;
typedef CGAL::Arithmetic_kernel::Rational FT;
#include <CGAL/Gmpz.h>
#include <CGAL/Gmpq.h>
typedef CGAL::Gmpz RT;
typedef CGAL::Gmpq FT;
#else #else

View File

@ -1,33 +1,13 @@
//---------------------------------------------------------------------
// file generated by notangle from noweb/Kernel_d-tests.lw
// please debug or modify noweb file
// coding: M. Seel
//---------------------------------------------------------------------
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Homogeneous_d.h> #include <CGAL/Homogeneous_d.h>
#include <CGAL/Cartesian_d.h> #include <CGAL/Cartesian_d.h>
#include <CGAL/simple_transformations_d.h> #include <CGAL/simple_transformations_d.h>
#include <CGAL/test_macros.h> #include <CGAL/test_macros.h>
#include <CGAL/Arithmetic_kernel.h>
#ifdef CGAL_USE_LEDA
#include <CGAL/leda_integer.h> typedef CGAL::Arithmetic_kernel::Integer RT_;
#include <CGAL/leda_rational.h> typedef CGAL::Arithmetic_kernel::Rational FT_;
typedef leda_integer RT_;
typedef leda_rational FT_;
#else
#ifdef CGAL_USE_GMP
#include <CGAL/Gmpz.h>
#include <CGAL/Quotient.h>
typedef CGAL::Gmpz RT_;
typedef CGAL::Quotient<RT_> FT_;
#else
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
typedef CGAL::MP_Float RT_;
typedef CGAL::Quotient<RT_> FT_;
#endif
#endif
int main() int main()

View File

@ -1,15 +1,7 @@
#include <CGAL/basic.h> #include <CGAL/Arithmetic_kernel.h>
#ifdef CGAL_USE_GMP // leda_rational, or Gmpq, or Quotient<MP_float>
// GMP is installed. Use the GMP rational number-type. typedef CGAL::Arithmetic_kernel::Rational Rational;
#include <CGAL/Gmpq.h>
typedef CGAL::Gmpq Rational;
#else
// GMP is not installed. Use CGAL's exact rational number-type.
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::MP_Float> Rational;
#endif
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/minkowski_sum_2.h> #include <CGAL/minkowski_sum_2.h>

View File

@ -1,15 +1,7 @@
#include <CGAL/basic.h> #include <CGAL/Arithmetic_kernel.h>
#ifdef CGAL_USE_GMP // leda_rational, or Gmpq, or Quotient<MP_float>
// GMP is installed. Use the GMP rational number-type. typedef CGAL::Arithmetic_kernel::Rational Rational;
#include <CGAL/Gmpq.h>
typedef CGAL::Gmpq Rational;
#else
// GMP is not installed. Use CGAL's exact rational number-type.
#include <CGAL/MP_Float.h>
#include <CGAL/Quotient.h>
typedef CGAL::Quotient<CGAL::MP_Float> Rational;
#endif
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Polygon_2.h> #include <CGAL/Polygon_2.h>

View File

@ -1,4 +1,4 @@
#include<CGAL/Gmpz.h> #include <CGAL/Arithmetic_kernel.h>
#include<CGAL/Homogeneous.h> #include<CGAL/Homogeneous.h>
#include<CGAL/Nef_polyhedron_3.h> #include<CGAL/Nef_polyhedron_3.h>
#include<CGAL/IO/Nef_polyhedron_iostream_3.h> #include<CGAL/IO/Nef_polyhedron_iostream_3.h>
@ -11,7 +11,7 @@
#include<CGAL/Minkowski_sum_3/Gaussian_map_to_nef_3.h> #include<CGAL/Minkowski_sum_3/Gaussian_map_to_nef_3.h>
#include<fstream> #include<fstream>
typedef CGAL::Gmpz RT; typedef CGAL::Arithmetic_kernel::Integer RT;
typedef CGAL::Homogeneous<RT> Kernel; typedef CGAL::Homogeneous<RT> Kernel;
typedef CGAL::Nef_polyhedron_3<Kernel, CGAL::SNC_indexed_items> Nef_polyhedron_3; typedef CGAL::Nef_polyhedron_3<Kernel, CGAL::SNC_indexed_items> Nef_polyhedron_3;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron_3; typedef CGAL::Polyhedron_3<Kernel> Polyhedron_3;

View File

@ -39,7 +39,7 @@
#include <boost/type_traits/is_same.hpp> #include <boost/type_traits/is_same.hpp>
#ifndef CGAL_USE_LEDA #ifndef CGAL_USE_LEDA_LIBRARY
#define LEDA_MEMORY(t) #define LEDA_MEMORY(t)
#endif #endif

View File

@ -35,7 +35,7 @@
#include <boost/any.hpp> #include <boost/any.hpp>
#endif #endif
#ifdef CGAL_USE_LEDA #ifdef CGAL_USE_LEDA_LIBRARY
#include <CGAL/LEDA_basic.h> #include <CGAL/LEDA_basic.h>
# if __LEDA__ > 410 && __LEDA__ < 441 # if __LEDA__ > 410 && __LEDA__ < 441
# define CGAL_USING_PPL # define CGAL_USING_PPL

View File

@ -24,22 +24,9 @@
#define CGAL_NEF_DEBUG 23 #define CGAL_NEF_DEBUG 23
#include <CGAL/Nef_2/debug.h> #include <CGAL/Nef_2/debug.h>
#if defined(CGAL_USE_LEDA) #if defined(CGAL_USE_LEDA_LIBRARY)
#include <CGAL/LEDA_basic.h> #include <CGAL/LEDA_basic.h>
#if CGAL_LEDA_VERSION < 500
#include <LEDA/tuple.h>
#include <LEDA/slist.h>
#include <LEDA/list.h>
#include <LEDA/map.h>
#include <LEDA/map2.h>
#include <LEDA/sortseq.h>
#include <LEDA/p_queue.h>
#include <LEDA/impl/ab_tree.h>
#include <LEDA/impl/bb_tree.h>
#include <LEDA/impl/rb_tree.h>
#include <LEDA/impl/rs_tree.h>
#include <LEDA/impl/skiplist.h>
#else
#include <LEDA/core/tuple.h> #include <LEDA/core/tuple.h>
#include <LEDA/core/slist.h> #include <LEDA/core/slist.h>
#include <LEDA/core/list.h> #include <LEDA/core/list.h>
@ -52,7 +39,7 @@
#include <LEDA/core/impl/rb_tree.h> #include <LEDA/core/impl/rb_tree.h>
#include <LEDA/core/impl/rs_tree.h> #include <LEDA/core/impl/rs_tree.h>
#include <LEDA/core/impl/skiplist.h> #include <LEDA/core/impl/skiplist.h>
#endif
#include <utility> #include <utility>
#include <sstream> #include <sstream>
@ -444,8 +431,8 @@ public:
} // namespace CGAL } // namespace CGAL
#endif // defined(CGAL_USE_LEDA) #endif // defined(CGAL_USE_LEDA_LIBRARY)
#if !defined(CGAL_USE_LEDA) #if !defined(CGAL_USE_LEDA_LIBRARY)
#include <list> #include <list>
#include <string> #include <string>
#include <sstream> #include <sstream>
@ -1123,10 +1110,10 @@ public:
} // namespace CGAL } // namespace CGAL
#endif // !defined(CGAL_USE_LEDA) #endif // !defined(CGAL_USE_LEDA_LIBRARY)
namespace CGAL { namespace CGAL {
#if defined(CGAL_USE_LEDA) #if defined(CGAL_USE_LEDA_LIBRARY)
#define Segment_overlay_traits leda_seg_overlay_traits #define Segment_overlay_traits leda_seg_overlay_traits
static const char* const sweepversion = "LEDA segment overlay sweep"; static const char* const sweepversion = "LEDA segment overlay sweep";
#else #else

View File

@ -4,23 +4,16 @@
#include <CGAL/Filtered_extended_homogeneous.h> #include <CGAL/Filtered_extended_homogeneous.h>
#include <CGAL/Extended_cartesian.h> #include <CGAL/Extended_cartesian.h>
#include <CGAL/Nef_polyhedron_2.h> #include <CGAL/Nef_polyhedron_2.h>
#include <CGAL/Arithmetic_kernel.h>
#ifdef CGAL_USE_LEDA #if defined (CGAL_USE_LEDA) || defined (CGAL_USE_GMP)
#include <CGAL/leda_integer.h>
#include <CGAL/leda_rational.h> typedef CGAL::Arithmetic_kernel::Integer Integer;
typedef leda_integer Integer; typedef CGAL::Arithmetic_kernel::Rational Rational;
typedef leda_rational Rational;
#else
#ifdef CGAL_USE_GMP
#include <CGAL/Gmpz.h>
#include <CGAL/Gmpq.h>
typedef CGAL::Gmpz Integer;
typedef CGAL::Gmpq Rational;
#else #else
typedef long Integer; typedef long Integer;
typedef double Rational; typedef double Rational;
#endif #endif
#endif

View File

@ -1,6 +1,7 @@
// file : examples/Nef_2/point_location.C // file : examples/Nef_2/point_location.cpp
#include <CGAL/Gmpz.h>
#include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Bounded_kernel.h> #include <CGAL/Bounded_kernel.h>
#include <CGAL/Homogeneous.h> #include <CGAL/Homogeneous.h>
#include <CGAL/Filtered_extended_homogeneous.h> #include <CGAL/Filtered_extended_homogeneous.h>
@ -51,7 +52,7 @@ void test() {
int main() { int main() {
typedef CGAL::Gmpz RT; typedef CGAL::Arithmetic_kernel::Integer RT;
typedef CGAL::Filtered_extended_homogeneous<RT> EKernel; typedef CGAL::Filtered_extended_homogeneous<RT> EKernel;
typedef CGAL::Homogeneous<RT> HOM; typedef CGAL::Homogeneous<RT> HOM;
typedef CGAL::Bounded_kernel<HOM> BKernel; typedef CGAL::Bounded_kernel<HOM> BKernel;

View File

@ -23,26 +23,27 @@
#include <CGAL/Nef_polyhedron_3.h> #include <CGAL/Nef_polyhedron_3.h>
// --- begin preliminary number type converter ----------------- // --- begin preliminary number type converter -----------------
#ifndef CGAL_NUMBER_TYPE_CONVERTER_NEF_3_H #ifndef CGAL_NUMBER_TYPE_CONVERTER_NEF_3_H
#define CGAL_NUMBER_TYPE_CONVERTER_NEF_3_H #define CGAL_NUMBER_TYPE_CONVERTER_NEF_3_H
#include<sstream> #include<sstream>
#include<CGAL/Gmpz.h> #include <CGAL/Arithmetic_kernel.h>
#include<CGAL/Gmpq.h> #include <CGAL/Fraction_traits.h>
#include<CGAL/Cartesian.h> #include<CGAL/Cartesian.h>
#include<CGAL/Homogeneous.h> #include<CGAL/Homogeneous.h>
#include<CGAL/Nef_S2/Normalizing.h> #include<CGAL/Nef_S2/Normalizing.h>
#include<CGAL/Nef_nary_union_3.h> #include<CGAL/Nef_nary_union_3.h>
#ifdef CGAL_USE_LEDA
#include<CGAL/leda_integer.h>
#include<CGAL/leda_rational.h>
#endif // CGAL_USE_LEDA
namespace CGAL { namespace CGAL {
typedef CGAL::Arithmetic_kernel::Integer Integer;
typedef CGAL::Arithmetic_kernel::Rational Rational;
class Homogeneous_tag; class Homogeneous_tag;
class Cartesian_tag; class Cartesian_tag;
template<typename Tag, typename Kernel> class number_type_converter_nef_3; template<typename Tag, typename Kernel> class number_type_converter_nef_3;
@ -55,15 +56,21 @@ class number_type_converter_nef_3<Homogeneous_tag, Kernel> {
{ {
typedef typename Kernel::Point_3 Point_3; typedef typename Kernel::Point_3 Point_3;
typedef typename Kernel::RT RT; typedef typename Kernel::RT RT;
CGAL::Gmpq x(d.x()), y(d.y()), z(d.z()); typedef Fraction_traits<Rational> F_traits;
CGAL::Homogeneous<CGAL::Gmpz>::Point_3 b = Rational x(d.x()), y(d.y()), z(d.z());
normalized ( CGAL::Homogeneous<CGAL::Gmpz>::Point_3 ( Integer xn, xd, yn, yd, zn, zd;
x.numerator() * y.denominator() * z.denominator(), typename F_traits::Decompose decompose;
x.denominator() * y.numerator() * z.denominator(), decompose(x, xn, xd);
x.denominator() * y.denominator() * z.numerator(), decompose(y, yn, yd);
x.denominator() * y.denominator() * z.denominator() ) ); decompose(z, zn, zd);
CGAL::Homogeneous<Integer>::Point_3 b =
normalized ( CGAL::Homogeneous<Integer>::Point_3 (
xn * yd * zd,
xd * yn * zd,
xd * yd * zn,
xd * yd * zd ) );
std::ostringstream outx, outy, outz, outw; std::ostringstream outx, outy, outz, outw;
outx << b.hx(); outx << b.hx();

View File

@ -28,23 +28,9 @@
#define CGAL_NEF3_SORT_OUTPUT 1 #define CGAL_NEF3_SORT_OUTPUT 1
#include <CGAL/Gmpz.h> #include <CGAL/Arithmetic_kernel.h>
#include <CGAL/Gmpq.h>
#include <CGAL/Quotient.h>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Homogeneous.h> #include <CGAL/Homogeneous.h>
typedef CGAL::Gmpz NT;
typedef CGAL::Gmpq FNT;
typedef CGAL::Quotient<NT> FNT2;
#ifdef CGAL_USE_LEDA
#include <CGAL/leda_integer.h>
#include <CGAL/leda_rational.h>
typedef leda_integer LNT;
typedef leda_rational LFNT;
typedef CGAL::Quotient<LNT> LFNT2;
#endif
#include <CGAL/Nef_polyhedron_3.h> #include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/IO/Nef_polyhedron_iostream_3.h> #include <CGAL/IO/Nef_polyhedron_iostream_3.h>
#include <CGAL/OFF_to_nef_3.h> #include <CGAL/OFF_to_nef_3.h>
@ -53,6 +39,11 @@ typedef CGAL::Quotient<LNT> LFNT2;
#include <cassert> #include <cassert>
#include <string> #include <string>
typedef CGAL::Arithmetic_kernel::Integer NT;
typedef CGAL::Arithmetic_kernel::Rational FNT;
template<typename Kernel> template<typename Kernel>
class test { class test {
@ -131,36 +122,22 @@ int main() {
CGAL::Timer t; CGAL::Timer t;
t.start(); t.start();
#ifndef CGAL_USE_LEDA #if defined( CGAL_USE_LEDA ) || defined ( CGAL_USE_GMP )
{ typedef CGAL::Homogeneous<NT> H_kernel; typedef CGAL::Homogeneous<NT> H_kernel;
typedef CGAL::Cartesian<FNT> C_kernel; typedef CGAL::Cartesian<FNT> C_kernel;
// typedef CGAL::Cartesian<FNT2> Q_kernel;
test<H_kernel> test_H;
test<C_kernel> test_C;
test<H_kernel> test_H; test_H.run_test(true,".H");
test<C_kernel> test_C; # ifdef CGAL_USE_GMP
// test<Q_kernel> test_Q; test_C.run_test(false,".C");
# else
test_H.run_test(true,".H"); test_C.run_test(false,".LC");
test_C.run_test(false,".C"); # endif
// test_Q.run_test();
}
#else
{ typedef CGAL::Homogeneous<LNT> LH_kernel;
typedef CGAL::Cartesian<LFNT> LC_kernel;
// typedef CGAL::Cartesian<LFNT2> LQ_kernel;
test<LH_kernel> test_LH;
test<LC_kernel> test_LC;
// test<LQ_kernel> test_LQ;
test_LH.run_test(true,".H");
test_LC.run_test(false,".LC");
// test_LQ.run_test();
}
#endif #endif
t.stop(); t.stop();
std::cout << "Time " << t.time() << std::endl; std::cout << "Time " << t.time() << std::endl;
return 0;
} }

View File

@ -26,19 +26,13 @@
#define CGAL_NEF3_SORT_OUTPUT 1 #define CGAL_NEF3_SORT_OUTPUT 1
#include <CGAL/basic.h> #include <CGAL/Arithmetic_kernel.h>
#ifdef CGAL_USE_LEDA
#include <CGAL/leda_integer.h>
typedef leda_integer NT;
#else
#include <CGAL/Gmpz.h>
typedef CGAL::Gmpz NT;
#endif
#include <CGAL/Extended_homogeneous.h> #include <CGAL/Extended_homogeneous.h>
#include <CGAL/Timer.h> #include <CGAL/Timer.h>
#include <CGAL/test_Nef_3.h> #include <CGAL/test_Nef_3.h>
int main() { int main() {
typedef CGAL::Arithmetic_kernel::Integer NT;
typedef CGAL::Extended_homogeneous<NT> EH_kernel; typedef CGAL::Extended_homogeneous<NT> EH_kernel;
#ifdef CGAL_CFG_ISTREAM_INT_BUG #ifdef CGAL_CFG_ISTREAM_INT_BUG

View File

@ -26,19 +26,13 @@
#define CGAL_NEF3_SORT_OUTPUT 1 #define CGAL_NEF3_SORT_OUTPUT 1
#include <CGAL/basic.h> #include <CGAL/Arithmetic_kernel.h>
#ifdef CGAL_USE_LEDA
#include <CGAL/leda_integer.h>
typedef leda_integer NT;
#else
#include <CGAL/Gmpz.h>
typedef CGAL::Gmpz NT;
#endif
#include <CGAL/Homogeneous.h> #include <CGAL/Homogeneous.h>
#include <CGAL/Timer.h> #include <CGAL/Timer.h>
#include <CGAL/test_Nef_3.h> #include <CGAL/test_Nef_3.h>
int main() { int main() {
typedef CGAL::Arithmetic_kernel::Integer NT;
typedef CGAL::Homogeneous<NT> H_kernel; typedef CGAL::Homogeneous<NT> H_kernel;
#ifdef CGAL_CFG_ISTREAM_INT_BUG #ifdef CGAL_CFG_ISTREAM_INT_BUG

View File

@ -26,8 +26,8 @@
#define CGAL_NEF3_SORT_OUTPUT 1 #define CGAL_NEF3_SORT_OUTPUT 1
#include <CGAL/Gmpq.h> #include <CGAL/Arithmetic_kernel.h>
typedef CGAL::Gmpq NT; typedef CGAL::Arithmetic_kernel::Rational NT;
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
#include <CGAL/Lazy_kernel.h> #include <CGAL/Lazy_kernel.h>
#include <CGAL/Timer.h> #include <CGAL/Timer.h>

View File

@ -57,12 +57,14 @@ namespace CGAL { namespace internal {
// Two classes which tell the prefered "exact number types" corresponding to a type. // Two classes which tell the prefered "exact number types" corresponding to a type.
// The default template chooses Gmpq or Quotient<MP_Float>. // The default template chooses Gmpq, or leda_rational, or Quotient<MP_Float>.
// It should support the built-in types. // It should support the built-in types.
template < typename > template < typename >
struct Exact_field_selector struct Exact_field_selector
#ifdef CGAL_USE_GMP #ifdef CGAL_USE_GMP
{ typedef Gmpq Type; }; { typedef Gmpq Type; };
#elif defined(CGAL_USE_LEDA)
{ typedef leda_rational Type; };
#else #else
{ typedef Quotient<MP_Float> Type; }; { typedef Quotient<MP_Float> Type; };
#endif #endif

View File

@ -1,6 +1,5 @@
#include <CGAL/config.h>
#include <CGAL/basic.h>
#ifdef CGAL_USE_GMP #ifdef CGAL_USE_GMP

View File

@ -1,3 +1,8 @@
#include <CGAL/config.h>
#ifdef CGAL_USE_GMP
#include <iostream> #include <iostream>
#include <cassert> #include <cassert>
#include <CGAL/Gmpzf.h> #include <CGAL/Gmpzf.h>
@ -31,3 +36,12 @@ int main() {
} }
return 0; return 0;
} }
#else
int main()
{
return 0;
}
#endif

View File

@ -1,14 +1,8 @@
#define CGAL_POLYGON_DEBUG 1 #define CGAL_POLYGON_DEBUG 1
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Quotient.h> #include <CGAL/Arithmetic_kernel.h>
#ifdef CGAL_USE_GMP
#include <CGAL/Gmpz.h>
typedef CGAL::Quotient<CGAL::Gmpz> NT;
#else
#include <CGAL/MP_Float.h>
typedef CGAL::Quotient<CGAL::MP_Float> NT;
#endif
#include <CGAL/Point_2.h> #include <CGAL/Point_2.h>
#include <CGAL/Polygon_2_algorithms.h> #include <CGAL/Polygon_2_algorithms.h>
@ -23,6 +17,7 @@ using std::endl;
bool TestSimplicity(const char* FileName) bool TestSimplicity(const char* FileName)
// tests the simplicity of the polygon in the file FileName // tests the simplicity of the polygon in the file FileName
{ {
typedef CGAL::Arithmetic_kernel::Rational NT;
typedef CGAL::Cartesian<NT> K; typedef CGAL::Cartesian<NT> K;
typedef CGAL::Point_2<K> Point; typedef CGAL::Point_2<K> Point;

View File

@ -5,7 +5,21 @@
#include <cassert> #include <cassert>
// choose number type // choose number type
#ifdef CGAL_USE_GMP
// choose number type
#ifdef CGAL_USE_LEDA
# include <CGAL/leda_rational.h>
typedef leda_rational exact_ring_t;
typedef leda_rational exact_field_t;
namespace CGAL {
// needed for the drawing methods
leda_rational sqrt(const leda_rational& x) {
return leda_rational( CGAL::sqrt( CGAL::to_double(x) ) );
}
}
#elif defined( CGAL_USE_GMP )
# include <CGAL/Gmpq.h> # include <CGAL/Gmpq.h>
typedef CGAL::Gmpq exact_ring_t; typedef CGAL::Gmpq exact_ring_t;

View File

@ -5,7 +5,19 @@
#include <cassert> #include <cassert>
// choose number type // choose number type
#ifdef CGAL_USE_GMP #ifdef CGAL_USE_LEDA
# include <CGAL/leda_rational.h>
typedef leda_rational exact_ring_t;
typedef leda_rational exact_field_t;
namespace CGAL {
// needed for the drawing methods
leda_rational sqrt(const leda_rational& x) {
return leda_rational( CGAL::sqrt( CGAL::to_double(x) ) );
}
}
#elif defined( CGAL_USE_GMP )
# include <CGAL/Gmpq.h> # include <CGAL/Gmpq.h>
typedef CGAL::Gmpq exact_ring_t; typedef CGAL::Gmpq exact_ring_t;

View File

@ -1,4 +1,3 @@
// examples/Skin_surface_3/skin_surface_simple.C
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h> #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Skin_surface_3.h> #include <CGAL/Skin_surface_3.h>
@ -31,7 +30,10 @@ public:
std::ifstream in(filename.c_str()); std::ifstream in(filename.c_str());
assert(in.is_open()); assert(in.is_open());
Weighted_point wp; Weighted_point wp;
while (in >> wp) l.push_front(wp); double x, y, z, w;
while (in >> x >> y >> z >> w ) {
l.push_front(Weighted_point(Bare_point(x,y,z),w));
}
Skin_surface_3 skin_surface(l.begin(), l.end(), s); Skin_surface_3 skin_surface(l.begin(), l.end(), s);

View File

@ -1,4 +1,4 @@
// test/Skin_surface_3/subdivision_test.C // test/Skin_surface_3/subdivision_test.cpp
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Skin_surface_3.h> #include <CGAL/Skin_surface_3.h>
#include <CGAL/Polyhedron_3.h> #include <CGAL/Polyhedron_3.h>

View File

@ -308,7 +308,7 @@ typename Kernel_traits<Bare_point>::Kernel::Oriented_side
power_test_2(const Weighted_point<Bare_point, Weight> &p, power_test_2(const Weighted_point<Bare_point, Weight> &p,
const Weighted_point<Bare_point, Weight> &t) const Weighted_point<Bare_point, Weight> &t)
{ {
Comparison_result r = compare(p.weight(), t.weight()); Comparison_result r = CGAL::compare(p.weight(), t.weight());
if(r == LARGER) return ON_NEGATIVE_SIDE; if(r == LARGER) return ON_NEGATIVE_SIDE;
else if (r == SMALLER) return ON_POSITIVE_SIDE; else if (r == SMALLER) return ON_POSITIVE_SIDE;
return ON_ORIENTED_BOUNDARY; return ON_ORIENTED_BOUNDARY;

View File

@ -61,19 +61,29 @@ using namespace CGAL;
// - EPEC, // - EPEC,
// - or EPIC (the default) // - or EPIC (the default)
#ifdef SC_DOUBLE #ifdef SC_DOUBLE
typedef Simple_cartesian<double> K; typedef Simple_cartesian<double> K;
#elif C_LEDA
# include <CGAL/leda_rational.h>
# include <CGAL/Cartesian.h>
typedef Cartesian<leda_rational> K;
#elif defined(ONLY_STATIC_FILTERS) #elif defined(ONLY_STATIC_FILTERS)
typedef CGAL::internal::Static_filters<CGAL::Simple_cartesian<double> > K; typedef CGAL::internal::Static_filters<CGAL::Simple_cartesian<double> > K;
#elif defined(EPEC) #elif defined(EPEC)
# ifdef CGAL_DONT_USE_LAZY_KERNEL # ifdef CGAL_DONT_USE_LAZY_KERNEL
typedef Epeck K; typedef Epeck K;
# else # else // not CGAL_DONT_USE_LAZY_KERNEL
typedef Simple_cartesian<Gmpq> SK; # ifdef CGAL_USE_LEDA
typedef Lazy_kernel<SK> K; # include <CGAL/leda_rational.h>
# endif # include <CGAL/Cartesian.h>
typedef Cartesian<leda_rational> SK;
# else // not CGAL_USE_LEDA
typedef Simple_cartesian<Gmpq> SK;
# endif // not CGAL_USE_LEDA
typedef Lazy_kernel<SK> K;
# endif // not CGAL_DONT_USE_LAZY_KERNEL
#else // EPIC #else // EPIC
typedef Exact_predicates_inexact_constructions_kernel K; typedef Exact_predicates_inexact_constructions_kernel K;
#endif #endif // EPIC
typedef Regular_triangulation_euclidean_traits_3<K> WK; typedef Regular_triangulation_euclidean_traits_3<K> WK;
typedef K::Point_3 Point; typedef K::Point_3 Point;
@ -104,9 +114,11 @@ Point rnd_point()
void generate_points() void generate_points()
{ {
if (input_file_selected) { if (input_file_selected) {
Point p; Point p;
while (input_file >> p) while (input_file >> p){
pts.push_back(p);
pts.push_back(p);
}
cout << " [ Read " << pts.size() << " points from file ] " << endl; cout << " [ Read " << pts.size() << " points from file ] " << endl;
min_pts = max_pts = pts.size(); min_pts = max_pts = pts.size();
} }
@ -240,7 +252,7 @@ int main(int argc, char **argv)
cout << "\nProcessor : " cout << "\nProcessor : "
<< ((sizeof(void*)==4) ? 32 : (sizeof(void*)==8) ? 64 : -1) << " bits\n"; << ((sizeof(void*)==4) ? 32 : (sizeof(void*)==8) ? 64 : -1) << " bits\n";
// cout << "Kernel : EPICK\n"; cout << "Kernel typeid: " << typeid(K).name() << "\n";
do_benchmarks<Delaunay_triangulation_3<K> >("Delaunay [Compact_location]"); do_benchmarks<Delaunay_triangulation_3<K> >("Delaunay [Compact_location]");
if (input_file_selected) if (input_file_selected)

View File

@ -398,7 +398,7 @@ public:
const Weighted_point_3 & s, const Weighted_point_3 & s,
const FT& w) const const FT& w) const
{ {
return compare( return CGAL::compare(
squared_radius_orthogonal_sphereC3( squared_radius_orthogonal_sphereC3(
p.x(),p.y(),p.z(),p.weight(), p.x(),p.y(),p.z(),p.weight(),
q.x(),q.y(),q.z(),q.weight(), q.x(),q.y(),q.z(),q.weight(),
@ -413,7 +413,7 @@ public:
const Weighted_point_3 & r, const Weighted_point_3 & r,
const FT& w) const const FT& w) const
{ {
return compare( return CGAL::compare(
squared_radius_smallest_orthogonal_sphereC3( squared_radius_smallest_orthogonal_sphereC3(
p.x(),p.y(),p.z(),p.weight(), p.x(),p.y(),p.z(),p.weight(),
q.x(),q.y(),q.z(),q.weight(), q.x(),q.y(),q.z(),q.weight(),
@ -426,7 +426,7 @@ public:
const Weighted_point_3 & q, const Weighted_point_3 & q,
const FT& w) const const FT& w) const
{ {
return compare( return CGAL::compare(
squared_radius_smallest_orthogonal_sphereC3( squared_radius_smallest_orthogonal_sphereC3(
p.x(),p.y(),p.z(),p.weight(), p.x(),p.y(),p.z(),p.weight(),
q.x(),q.y(),q.z(),q.weight() ), q.x(),q.y(),q.z(),q.weight() ),
@ -437,7 +437,7 @@ public:
const Weighted_point_3 & p, const Weighted_point_3 & p,
const FT& w) const const FT& w) const
{ {
return compare(-p.weight(),w); return CGAL::compare(-p.weight(),w);
} }
}; };

View File

@ -21,6 +21,9 @@
#ifndef CGAL_REGULAR_TRIANGULATION_FTC3_H #ifndef CGAL_REGULAR_TRIANGULATION_FTC3_H
#define CGAL_REGULAR_TRIANGULATION_FTC3_H #define CGAL_REGULAR_TRIANGULATION_FTC3_H
#include <CGAL/number_utils.h>
#include <CGAL/predicates/sign_of_determinant.h>
// This file contains the low level cartesian predicates // This file contains the low level cartesian predicates
// used by the 3D regular triangulation. // used by the 3D regular triangulation.

View File

@ -295,7 +295,7 @@ _test_cls_delaunay_3(const Triangulation &)
std::cout << " I/O" << std::endl; std::cout << " I/O" << std::endl;
{ {
std::ofstream oFileT1("Test1_triangulation_IO_3",std::ios::out); std::ofstream oFileT1("Test1_triangulation_IO_3",std::ios::out);
oFileT1 << T0; oFileT1 << T0 << std::endl;
} }
std::ifstream iFileT1("Test1_triangulation_IO_3",std::ios::in); std::ifstream iFileT1("Test1_triangulation_IO_3",std::ios::in);
iFileT1 >> Tfromfile; iFileT1 >> Tfromfile;
@ -316,7 +316,7 @@ _test_cls_delaunay_3(const Triangulation &)
std::cout << " I/O" << std::endl; std::cout << " I/O" << std::endl;
{ {
std::ofstream oFileT2("Test2_triangulation_IO_3",std::ios::out); std::ofstream oFileT2("Test2_triangulation_IO_3",std::ios::out);
oFileT2 << T0; oFileT2 << T0 << std::endl;
} }
std::ifstream iFileT2("Test2_triangulation_IO_3",std::ios::in); std::ifstream iFileT2("Test2_triangulation_IO_3",std::ios::in);
iFileT2 >> Tfromfile; iFileT2 >> Tfromfile;
@ -338,7 +338,7 @@ _test_cls_delaunay_3(const Triangulation &)
std::cout << " I/O" << std::endl; std::cout << " I/O" << std::endl;
{ {
std::ofstream oFileT3("Test3_triangulation_IO_3",std::ios::out); std::ofstream oFileT3("Test3_triangulation_IO_3",std::ios::out);
oFileT3 << T0; oFileT3 << T0 << std::endl;
} }
std::ifstream iFileT3("Test3_triangulation_IO_3",std::ios::in); std::ifstream iFileT3("Test3_triangulation_IO_3",std::ios::in);
iFileT3 >> Tfromfile; iFileT3 >> Tfromfile;

View File

@ -85,7 +85,7 @@ _test_cls_tds_3( const Tds &)
std::cout << " I/O" << std::endl; std::cout << " I/O" << std::endl;
{ {
std::ofstream oFileT("Test_tds_IO_3", std::ios::out); std::ofstream oFileT("Test_tds_IO_3", std::ios::out);
oFileT << tds1; oFileT << tds1 << std::endl;
} }
std::ifstream iFileT("Test_tds_IO_3", std::ios::in); std::ifstream iFileT("Test_tds_IO_3", std::ios::in);
iFileT >> tdsfromfile; iFileT >> tdsfromfile;

View File

@ -52,7 +52,7 @@ _test_cls_triangulation_3_input_output(const Triangulation & T,
std::cout << " I/O" << std::endl; std::cout << " I/O" << std::endl;
{ {
std::ofstream oFile(filename, std::ios::out); std::ofstream oFile(filename, std::ios::out);
oFile << T; oFile << T << std::endl;
} }
std::ifstream iFile(filename, std::ios::in); std::ifstream iFile(filename, std::ios::in);
Triangulation Tfromfile; Triangulation Tfromfile;