mirror of https://github.com/CGAL/cgal
rm Number_type_traits
Ring_tag -> Integral_domain_without_division_tag Sqrt_field_tag -> Field_with_sqrt_tag
This commit is contained in:
parent
65c79588a8
commit
c9dc205525
|
|
@ -37,7 +37,7 @@ typedef CGAL::Simple_cartesian<double> Rep;
|
|||
#include <CGAL/Apollonius_graph_filtered_traits_2.h>
|
||||
|
||||
|
||||
typedef CGAL::Apollonius_graph_filtered_traits_2<Rep,CGAL::Ring_tag> Gt;
|
||||
typedef CGAL::Apollonius_graph_filtered_traits_2<Rep,CGAL::Integral_domain_without_division_tag> Gt;
|
||||
|
||||
typedef Gt::Point_2 Point_2;
|
||||
typedef Rep::Circle_2 Circle_2;
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ typedef CGAL::Simple_cartesian<NT> Kernel;
|
|||
// the traits class is now going to assume that the operations
|
||||
// +,-,*,/ and sqrt are supported exactly
|
||||
typedef
|
||||
CGAL::Apollonius_graph_traits_2<Kernel,CGAL::Sqrt_field_tag> Traits;
|
||||
CGAL::Apollonius_graph_traits_2<Kernel,CGAL::Field_with_sqrt_tag> Traits;
|
||||
|
||||
typedef CGAL::Apollonius_graph_2<Traits> Apollonius_graph;
|
||||
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ typedef CGAL::Simple_cartesian<CGAL::MP_Float> EK;
|
|||
// constructions (field operations plus square roots) are different
|
||||
// from the operations allowed when the exact kernel is used (ring
|
||||
// operations).
|
||||
typedef CGAL::Sqrt_field_tag CM;
|
||||
typedef CGAL::Ring_tag EM;
|
||||
typedef CGAL::Field_with_sqrt_tag CM;
|
||||
typedef CGAL::Integral_domain_without_division_tag EM;
|
||||
typedef CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM> Traits;
|
||||
|
||||
// Now we use the Apollonius graph hierarchy.
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
typedef CGAL::Simple_cartesian<double> CK;
|
||||
typedef CGAL::Simple_cartesian<CGAL::MP_Float> EK;
|
||||
|
||||
typedef CGAL::Sqrt_field_tag CM;
|
||||
typedef CGAL::Ring_tag EM;
|
||||
typedef CGAL::Field_with_sqrt_tag CM;
|
||||
typedef CGAL::Integral_domain_without_division_tag EM;
|
||||
typedef CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM> Traits;
|
||||
|
||||
typedef Traits::Site_2 Site;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public:
|
|||
public:
|
||||
|
||||
inline
|
||||
Sign operator()(const Voronoi_radius& vr, const Sqrt_field_tag&) const
|
||||
Sign operator()(const Voronoi_radius& vr, const Field_with_sqrt_tag&) const
|
||||
{
|
||||
FT r = vr.c1() + vr.c2() * CGAL::sqrt(vr.delta());
|
||||
return CGAL::sign(r);
|
||||
|
|
@ -51,7 +51,7 @@ public:
|
|||
|
||||
|
||||
inline
|
||||
Sign operator()(const Voronoi_radius& vr, const Ring_tag&) const
|
||||
Sign operator()(const Voronoi_radius& vr, const Integral_domain_without_division_tag&) const
|
||||
{
|
||||
// this is another way of doing this; the degree becomes 10
|
||||
// instead of 5 in this case.
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public:
|
|||
|
||||
Orientation
|
||||
operator()(const Voronoi_circle& vc, const Point_2& p1,
|
||||
const Point_2& p2, const Sqrt_field_tag&) const
|
||||
const Point_2& p2, const Field_with_sqrt_tag&) const
|
||||
{
|
||||
FT a = vc.a1() + vc.a2() * CGAL::sqrt(vc.delta());
|
||||
FT b = vc.b1() + vc.b2() * CGAL::sqrt(vc.delta());
|
||||
|
|
@ -58,7 +58,7 @@ public:
|
|||
|
||||
Orientation
|
||||
operator()(const Voronoi_circle& vc, const Point_2& p1,
|
||||
const Point_2& p2, const Ring_tag&) const
|
||||
const Point_2& p2, const Integral_domain_without_division_tag&) const
|
||||
{
|
||||
FT dx = p2.x() - p1.x();
|
||||
FT dy = p2.y() - p1.y();
|
||||
|
|
@ -140,7 +140,7 @@ private:
|
|||
public:
|
||||
Comparison_result
|
||||
operator()(const Voronoi_circle& vc1, const Voronoi_circle& vc2,
|
||||
const Sqrt_field_tag&) const
|
||||
const Field_with_sqrt_tag&) const
|
||||
{
|
||||
FT c1 = (vc1.c1() + vc1.c2() * CGAL::sqrt(vc1.delta())) / vc1.d();
|
||||
FT c2 = (vc2.c1() + vc2.c2() * CGAL::sqrt(vc2.delta())) / vc2.d();
|
||||
|
|
@ -154,7 +154,7 @@ public:
|
|||
/*
|
||||
Comparison_result
|
||||
operator()(const Voronoi_circle& vc1, const Voronoi_circle& vc2,
|
||||
Ring_tag)
|
||||
Integral_domain_without_division_tag)
|
||||
{
|
||||
FT A = vc1.c1() * vc2.d() - vc2.c1() * vc1.d();
|
||||
FT B = vc1.c2() * vc2.d();
|
||||
|
|
@ -171,7 +171,7 @@ public:
|
|||
|
||||
Comparison_result
|
||||
operator()(const Voronoi_circle& vc1, const Voronoi_circle& vc2,
|
||||
const Ring_tag&) const
|
||||
const Integral_domain_without_division_tag&) const
|
||||
{
|
||||
bool is_first_root1 = vc1.is_first_root();
|
||||
bool is_first_root2 = vc2.is_first_root();
|
||||
|
|
@ -214,7 +214,7 @@ public:
|
|||
/*
|
||||
Comparison_result
|
||||
operator()(const Voronoi_circle& vc1, const Voronoi_circle& vc2,
|
||||
Ring_tag)
|
||||
Integral_domain_without_division_tag)
|
||||
{
|
||||
bool is_first_root1 = vc1.is_first_root();
|
||||
bool is_first_root2 = vc2.is_first_root();
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public:
|
|||
|
||||
inline Sign
|
||||
operator()(const Bitangent_line& bl, const Site_2& q,
|
||||
const Sqrt_field_tag&) const
|
||||
const Field_with_sqrt_tag&) const
|
||||
{
|
||||
#ifdef AG2_PROFILE_PREDICATES
|
||||
ag2_predicate_profiler::distance_from_bitangent_counter++;
|
||||
|
|
@ -63,7 +63,7 @@ public:
|
|||
|
||||
inline Sign
|
||||
operator()(const Bitangent_line& bl, const Site_2& q,
|
||||
const Ring_tag&) const
|
||||
const Integral_domain_without_division_tag&) const
|
||||
{
|
||||
#ifdef AG2_PROFILE_PREDICATES
|
||||
ag2_predicate_profiler::distance_from_bitangent_counter++;
|
||||
|
|
@ -91,7 +91,7 @@ public:
|
|||
inline Sign
|
||||
operator()(const Bitangent_line& bl,
|
||||
const Inverted_weighted_point& v,
|
||||
const Sqrt_field_tag&) const
|
||||
const Field_with_sqrt_tag&) const
|
||||
{
|
||||
FT a = bl.a1() + bl.a2() * CGAL::sqrt(bl.delta());
|
||||
FT b = bl.b1() + bl.b2() * CGAL::sqrt(bl.delta());
|
||||
|
|
@ -103,7 +103,7 @@ public:
|
|||
inline Sign
|
||||
operator()(const Bitangent_line& bl,
|
||||
const Inverted_weighted_point& v,
|
||||
const Ring_tag&) const
|
||||
const Integral_domain_without_division_tag&) const
|
||||
{
|
||||
FT A = bl.a1() * v.x() + bl.b1() * v.y() + bl.c1() * v.p()
|
||||
- v.weight() * bl.d();
|
||||
|
|
@ -158,7 +158,7 @@ public:
|
|||
private:
|
||||
inline Orientation
|
||||
orientation(const Bitangent_line& l, const Point_2& p,
|
||||
const Sqrt_field_tag&) const
|
||||
const Field_with_sqrt_tag&) const
|
||||
{
|
||||
FT A = l.a1() * p.x() + l.b1() * p.y() + l.c1();
|
||||
FT B = l.a2() * p.x() + l.b2() * p.y() + l.c2();
|
||||
|
|
@ -168,7 +168,7 @@ private:
|
|||
|
||||
inline Orientation
|
||||
orientation(const Bitangent_line& l, const Point_2& p,
|
||||
const Ring_tag&) const
|
||||
const Integral_domain_without_division_tag&) const
|
||||
{
|
||||
FT A = l.a1() * p.x() + l.b1() * p.y() + l.c1();
|
||||
FT B = l.a2() * p.x() + l.b2() * p.y() + l.c2();
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ public:
|
|||
}
|
||||
|
||||
Sign chi2(const Bitangent_line& bl1,
|
||||
const Bitangent_line& bl2, Sqrt_field_tag) const
|
||||
const Bitangent_line& bl2, Field_with_sqrt_tag) const
|
||||
{
|
||||
FT sigma = bl1.dx() * bl2.dx() + bl1.dy() * bl2.dy();
|
||||
FT delta = bl1.dx() * bl2.dy() - bl1.dy() * bl2.dx();
|
||||
|
|
@ -143,7 +143,7 @@ public:
|
|||
|
||||
inline
|
||||
Sign chi2(const Bitangent_line& bl1,
|
||||
const Bitangent_line& bl2, Ring_tag) const
|
||||
const Bitangent_line& bl2, Integral_domain_without_division_tag) const
|
||||
{
|
||||
return chi2(bl1.dx(), bl1.dy(), -bl1.dw(), bl1.d(), bl1.delta(),
|
||||
bl2.dx(), bl2.dy(), -bl2.dw(), bl2.d(), bl2.delta());
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public:
|
|||
|
||||
private:
|
||||
bool is_hidden(const Site_2& p, const Site_2& q,
|
||||
const Ring_tag&) const
|
||||
const Integral_domain_without_division_tag&) const
|
||||
{
|
||||
RT w1 = p.weight();
|
||||
RT w2 = q.weight();
|
||||
|
|
@ -57,7 +57,7 @@ private:
|
|||
}
|
||||
|
||||
bool is_hidden(const Site_2& p, const Site_2& q,
|
||||
const Sqrt_field_tag&) const
|
||||
const Field_with_sqrt_tag&) const
|
||||
{
|
||||
RT d = CGAL::sqrt(CGAL::square(p.x() - q.x())
|
||||
+ CGAL::square(p.y() - q.y()));
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ private:
|
|||
private:
|
||||
Orientation vv_orientation(const Voronoi_circle& vc, const Point_2& sp1,
|
||||
const Point_2& p1, const Point_2& p2,
|
||||
const Sqrt_field_tag&) const
|
||||
const Field_with_sqrt_tag&) const
|
||||
{
|
||||
FT a = vc.a1() + vc.a2() * CGAL::sqrt(vc.delta());
|
||||
FT b = vc.b1() + vc.b2() * CGAL::sqrt(vc.delta());
|
||||
|
|
@ -69,7 +69,7 @@ private:
|
|||
|
||||
Orientation vv_orientation(const Voronoi_circle vc, const Point_2& sp1,
|
||||
const Point_2& p1, const Point_2& p2,
|
||||
const Ring_tag&) const
|
||||
const Integral_domain_without_division_tag&) const
|
||||
{
|
||||
FT dx = p2.x() - p1.x();
|
||||
FT dy = p2.y() - p1.y();
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ private:
|
|||
private:
|
||||
Comparison_result
|
||||
compare_distances(const Site_2& p1, const Site_2& p2,
|
||||
const Point_2& p, const Ring_tag&) const
|
||||
const Point_2& p, const Integral_domain_without_division_tag&) const
|
||||
{
|
||||
#ifdef AG2_PROFILE_PREDICATES
|
||||
ag2_predicate_profiler::side_of_bisector_counter++;
|
||||
|
|
@ -85,7 +85,7 @@ private:
|
|||
|
||||
Comparison_result
|
||||
compare_distances(const Site_2& p1, const Site_2& p2,
|
||||
const Point_2 &p, const Sqrt_field_tag&) const
|
||||
const Point_2 &p, const Field_with_sqrt_tag&) const
|
||||
{
|
||||
#ifdef AG2_PROFILE_PREDICATES
|
||||
ag2_predicate_profiler::side_of_bisector_counter++;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define CGAL_APOLLONIUS_GRAPH_2_BASIC_H 1
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/Number_type_traits.h>
|
||||
#include <CGAL/number_type_basic.h>
|
||||
#include <CGAL/Apollonius_graph_2/short_names_2.h>
|
||||
|
||||
#define CGAL_APOLLONIUS_GRAPH_2_NS CGAL::ApolloniusGraph_2
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ namespace CGALi {
|
|||
|
||||
|
||||
template<class CK_t,
|
||||
class CK_MTag = Ring_tag,
|
||||
class CK_MTag = Integral_domain_without_division_tag,
|
||||
class EK_t = Simple_cartesian< MP_Float >,
|
||||
class EK_MTag = CK_MTag,
|
||||
class FK_t = Simple_cartesian< Interval_nt<false> >,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include <CGAL/Apollonius_graph_2/new_traits/New_predicates_C2.h>
|
||||
#endif
|
||||
|
||||
#include <CGAL/Number_type_traits.h>
|
||||
#include <CGAL/number_type_basic.h>
|
||||
#include <CGAL/Apollonius_graph_2/Kernel_wrapper_2.h>
|
||||
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ CGAL_BEGIN_NAMESPACE
|
|||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
template < class Rep, class MTag = Ring_tag >
|
||||
template < class Rep, class MTag = Integral_domain_without_division_tag >
|
||||
class Apollonius_graph_mixed_traits_2
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ namespace CGALi {
|
|||
|
||||
|
||||
template<class CK_t,
|
||||
class CK_MTag = Ring_tag,
|
||||
class CK_MTag = Integral_domain_without_division_tag,
|
||||
class EK_t = Simple_cartesian< MP_Float >,
|
||||
class EK_MTag = CK_MTag,
|
||||
class FK_t = Simple_cartesian< Interval_nt<false> >,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include <CGAL/Apollonius_graph_2/new_traits/New_predicates_C2.h>
|
||||
#endif
|
||||
|
||||
#include <CGAL/Number_type_traits.h>
|
||||
#include <CGAL/number_type_basic.h>
|
||||
#include <CGAL/Apollonius_graph_2/Kernel_wrapper_2.h>
|
||||
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ CGAL_BEGIN_NAMESPACE
|
|||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
template < class Rep, class MTag = Ring_tag >
|
||||
template < class Rep, class MTag = Integral_domain_without_division_tag >
|
||||
class Apollonius_graph_new_traits_2
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ namespace CGALi {
|
|||
|
||||
|
||||
template<class CK_t,
|
||||
class CK_MTag = Ring_tag,
|
||||
class CK_MTag = Integral_domain_without_division_tag,
|
||||
class EK_t = Simple_cartesian< MP_Float >,
|
||||
class EK_MTag = CK_MTag,
|
||||
class FK_t = Simple_cartesian< Interval_nt<false> >,
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include <CGAL/enum.h>
|
||||
#include <CGAL/Uncertain.h>
|
||||
#include <CGAL/Number_type_traits.h>
|
||||
#include <CGAL/number_type_basic.h>
|
||||
|
||||
|
||||
CGAL_BEGIN_NAMESPACE
|
||||
|
|
@ -43,7 +43,7 @@ public:
|
|||
|
||||
private:
|
||||
Uncertain<bool> is_hidden(const Site_2& p, const Site_2& q,
|
||||
const Ring_tag&) const
|
||||
const Integral_domain_without_division_tag&) const
|
||||
{
|
||||
RT w1 = p.weight();
|
||||
RT w2 = q.weight();
|
||||
|
|
@ -64,7 +64,7 @@ private:
|
|||
}
|
||||
|
||||
Uncertain<bool> is_hidden(const Site_2& p, const Site_2& q,
|
||||
const Sqrt_field_tag&) const
|
||||
const Field_with_sqrt_tag&) const
|
||||
{
|
||||
RT d = CGAL::sqrt(CGAL::square(p.x() - q.x())
|
||||
+ CGAL::square(p.y() - q.y()));
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include <CGAL/enum.h>
|
||||
#include <CGAL/Uncertain.h>
|
||||
#include <CGAL/Number_type_traits.h>
|
||||
#include <CGAL/number_type_basic.h>
|
||||
#include <CGAL/Apollonius_graph_2/uncertain/uncertain_functions_on_signs.h>
|
||||
|
||||
CGAL_BEGIN_NAMESPACE
|
||||
|
|
@ -47,7 +47,7 @@ private:
|
|||
private:
|
||||
Uncertain<Comparison_result>
|
||||
compare_distances(const Site_2& p1, const Site_2& p2,
|
||||
const Point_2& p, const Ring_tag&) const
|
||||
const Point_2& p, const Integral_domain_without_division_tag&) const
|
||||
{
|
||||
#ifdef AG2_PROFILE_PREDICATES
|
||||
ag2_predicate_profiler::side_of_bisector_counter++;
|
||||
|
|
@ -98,7 +98,7 @@ private:
|
|||
|
||||
Comparison_result
|
||||
compare_distances(const Site_2& p1, const Site_2& p2,
|
||||
const Point_2 &p, const Sqrt_field_tag&) const
|
||||
const Point_2 &p, const Field_with_sqrt_tag&) const
|
||||
{
|
||||
#ifdef AG2_PROFILE_PREDICATES
|
||||
ag2_predicate_profiler::side_of_bisector_counter++;
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ namespace CGALi {
|
|||
|
||||
|
||||
template<class CK_t,
|
||||
class CK_MTag = Ring_tag,
|
||||
class CK_MTag = Integral_domain_without_division_tag,
|
||||
class EK_t = Simple_cartesian< MP_Float >,
|
||||
class EK_MTag = CK_MTag,
|
||||
class FK_t = Simple_cartesian< Interval_nt<false> >,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
#include <CGAL/Apollonius_graph_2/Predicates_C2.h>
|
||||
#endif
|
||||
|
||||
#include <CGAL/Number_type_traits.h>
|
||||
#include <CGAL/number_type_basic.h>
|
||||
#include <CGAL/Apollonius_graph_2/Kernel_wrapper_2.h>
|
||||
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ CGAL_BEGIN_NAMESPACE
|
|||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------
|
||||
template < class Rep, class MTag = Ring_tag >
|
||||
template < class Rep, class MTag = Integral_domain_without_division_tag >
|
||||
class Apollonius_graph_traits_2
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -78,10 +78,10 @@ protected:
|
|||
|
||||
inline static
|
||||
FT divide(const FT& x, const FT& y) {
|
||||
static typename Number_type_traits<FT>::Has_division has_division;
|
||||
return divide(x, y, has_division);
|
||||
return divide(x, y,
|
||||
Boolean_tag< ! CGALi::Is_integral_domain_without_division<FT>::value >());
|
||||
}
|
||||
|
||||
|
||||
inline static
|
||||
FT sqrt(const FT& x, const Tag_false&) {
|
||||
return CGAL::sqrt(CGAL::to_double(x));
|
||||
|
|
@ -94,8 +94,7 @@ protected:
|
|||
|
||||
inline static
|
||||
FT sqrt(const FT& x) {
|
||||
static typename Number_type_traits<FT>::Has_sqrt has_sqrt;
|
||||
return sqrt(x, has_sqrt);
|
||||
return sqrt(x, Boolean_tag<CGALi::Is_field_with_sqrt<FT>::value >());
|
||||
}
|
||||
|
||||
inline static
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ struct Kernel : public CGAL::Simple_cartesian<number_t> {};
|
|||
|
||||
#include <CGAL/Number_type_traits.h>
|
||||
|
||||
typedef CGAL::Ring_tag Method_tag;
|
||||
typedef CGAL::Integral_domain_without_division_tag Method_tag;
|
||||
|
||||
#include "./include/test.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ struct Kernel : public CGAL::Simple_cartesian<number_t> {};
|
|||
|
||||
#include <CGAL/Number_type_traits.h>
|
||||
|
||||
typedef CGAL::Ring_tag Method_tag;
|
||||
typedef CGAL::Integral_domain_without_division_tag Method_tag;
|
||||
|
||||
#include "./include/test.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ struct Kernel : public CGAL::Simple_cartesian<number_t> {};
|
|||
|
||||
#include <CGAL/Number_type_traits.h>
|
||||
|
||||
typedef CGAL::Ring_tag Method_tag;
|
||||
typedef CGAL::Integral_domain_without_division_tag Method_tag;
|
||||
|
||||
#include "./include/test.h"
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ int main(int argc, char* argv[])
|
|||
assert( ifs_traits );
|
||||
|
||||
// bool is_ok =
|
||||
// CGAL::test_traits<Kernel,CGAL::Ring_tag,std::ifstream>(ifs_traits);
|
||||
// CGAL::test_traits<Kernel,CGAL::Integral_domain_without_division_tag,std::ifstream>(ifs_traits);
|
||||
|
||||
std::cout << "testing the traits class..." << std::flush;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue