mirror of https://github.com/CGAL/cgal
Cleaning bad examples in CK2
This commit is contained in:
parent
fabc785391
commit
74271fa365
|
|
@ -12,12 +12,6 @@ if ( CGAL_FOUND )
|
|||
include(${CGAL_USE_FILE})
|
||||
include(CreateSingleSourceCGALProgram)
|
||||
|
||||
create_single_source_cgal_program( arrangement_random_circles.cpp )
|
||||
create_single_source_cgal_program( arrangement_random_circles_segments.cpp )
|
||||
create_single_source_cgal_program( Circular_kernel_arrangement.cpp )
|
||||
create_single_source_cgal_program( Circular_kernel_arrangement_Line_arc.cpp )
|
||||
create_single_source_cgal_program( Circular_kernel_arrangement_Line_Circular.cpp )
|
||||
create_single_source_cgal_program( intersecting_arcs.cpp )
|
||||
create_single_source_cgal_program( Exact_circular_kernel.cpp )
|
||||
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,55 +0,0 @@
|
|||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/MP_Float.h>
|
||||
#include <CGAL/Gmpq.h>
|
||||
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
|
||||
#include <CGAL/intersections.h>
|
||||
#include <CGAL/Circular_kernel_2.h>
|
||||
#include <CGAL/Arr_circular_arc_traits.h>
|
||||
#include <CGAL/Arrangement_2.h>
|
||||
#include <CGAL/Arr_naive_point_location.h>
|
||||
#include <CGAL/Random.h>
|
||||
|
||||
|
||||
typedef CGAL::Quotient<CGAL::MP_Float> NT;
|
||||
typedef CGAL::Cartesian<NT> Linear_k;
|
||||
typedef CGAL::Algebraic_kernel_for_circles_2_2<NT> Algebraic_k;
|
||||
typedef CGAL::Circular_kernel_2<Linear_k,Algebraic_k> Circular_k;
|
||||
|
||||
typedef Circular_k::Circular_arc_2 Arc_2;
|
||||
typedef std::vector<Arc_2> ArcContainer;
|
||||
|
||||
typedef CGAL::Arr_circular_arc_traits<Circular_k> Traits;
|
||||
|
||||
typedef CGAL::Arrangement_2<Traits> Arrangement;
|
||||
typedef CGAL::Arr_naive_point_location<Arrangement> Point_location;
|
||||
|
||||
typedef Circular_k::Point_2 Point_2;
|
||||
typedef Circular_k::Circle_2 Circle_2;
|
||||
int main(){
|
||||
|
||||
CGAL::Random generatorOfgenerator;
|
||||
int random_seed = generatorOfgenerator.get_int(0, 123456);
|
||||
std::cout << "random_seed = " << random_seed << std::endl;
|
||||
CGAL::Random theRandom(random_seed);
|
||||
int random_max = 128;
|
||||
int random_min = -128;
|
||||
ArcContainer ac;
|
||||
int x;
|
||||
int y;
|
||||
for(int i = 0; i < 10; i++){
|
||||
x = theRandom.get_int(random_min,random_max);
|
||||
y = theRandom.get_int(random_min,random_max);
|
||||
ac.push_back( Circle_2( Point_2(x,y), x*x + y*y));
|
||||
}
|
||||
|
||||
Arrangement arr;
|
||||
Point_location _pl(arr);
|
||||
for (ArcContainer::const_iterator it=ac.begin();
|
||||
it != ac.end(); ++it) {
|
||||
//insert(arr,_pl, *it);
|
||||
insert_curve(arr, *it, _pl);
|
||||
};
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/MP_Float.h>
|
||||
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
|
||||
#include <CGAL/intersections.h>
|
||||
#include <CGAL/Circular_kernel_2.h>
|
||||
#include <CGAL/Arr_circular_line_arc_traits.h>
|
||||
#include <CGAL/Arrangement_2.h>
|
||||
#include <CGAL/Arr_naive_point_location.h>
|
||||
#include <boost/variant.hpp>
|
||||
|
||||
#include <CGAL/Random.h>
|
||||
|
||||
|
||||
typedef CGAL::Quotient<CGAL::MP_Float> NT;
|
||||
typedef CGAL::Cartesian<NT> Linear_k;
|
||||
typedef CGAL::Algebraic_kernel_for_circles_2_2<NT> Algebraic_k;
|
||||
typedef CGAL::Circular_kernel_2<Linear_k,Algebraic_k> Circular_k;
|
||||
|
||||
typedef Circular_k::Point_2 Point_2;
|
||||
typedef Circular_k::Circle_2 Circle_2;
|
||||
typedef Circular_k::Circular_arc_2 Circular_arc_2;
|
||||
typedef Circular_k::Line_arc_2 Line_arc_2;
|
||||
|
||||
typedef boost::variant< Circular_arc_2, Line_arc_2> Arc_2;
|
||||
typedef std::vector< Arc_2> ArcContainer;
|
||||
|
||||
typedef CGAL::Arr_circular_line_arc_traits<Circular_k,
|
||||
Circular_arc_2, Line_arc_2> Traits;
|
||||
|
||||
typedef CGAL::Arrangement_2<Traits> Arrangement;
|
||||
typedef CGAL::Arr_naive_point_location<Arrangement> Point_location;
|
||||
|
||||
|
||||
int main(){
|
||||
|
||||
CGAL::Random generatorOfgenerator;
|
||||
int random_seed = generatorOfgenerator.get_int(0, 123456);
|
||||
std::cout << "random_seed = " << random_seed << std::endl;
|
||||
CGAL::Random theRandom(random_seed);
|
||||
int random_max = 128;
|
||||
int random_min = -128;
|
||||
ArcContainer ac;
|
||||
int x1;
|
||||
int y1;
|
||||
int x2;
|
||||
int y2;
|
||||
|
||||
for(int i = 0; i < 10; i++){
|
||||
x1 = theRandom.get_int(random_min,random_max);
|
||||
y1 = theRandom.get_int(random_min,random_max);
|
||||
do{
|
||||
x2 = theRandom.get_int(random_min,random_max);
|
||||
y2 = theRandom.get_int(random_min,random_max);
|
||||
}while((x1 == x2) && (y1 == y2));
|
||||
|
||||
std::cout << x1 << " "
|
||||
<< y1 << " "
|
||||
<< x2 << " "
|
||||
<< y2 << std::endl;
|
||||
boost::variant< Circular_arc_2, Line_arc_2 > v = Line_arc_2(Point_2(x1,y1), Point_2(x2,y2));
|
||||
ac.push_back( v);
|
||||
}
|
||||
|
||||
for(int i = 0; i < 10; i++){
|
||||
x1 = theRandom.get_int(random_min,random_max);
|
||||
y1 = theRandom.get_int(random_min,random_max);
|
||||
boost::variant< Circular_arc_2, Line_arc_2 > v = Circle_2( Point_2(x1,y1), x1*x1 + y1*y1);
|
||||
ac.push_back(v);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Arrangement arr;
|
||||
Point_location _pl(arr);
|
||||
for (ArcContainer::const_iterator it=ac.begin();
|
||||
it != ac.end(); ++it) {
|
||||
//insert(arr,_pl,*it);
|
||||
insert_curve(arr, *it, _pl);
|
||||
};
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/MP_Float.h>
|
||||
#include <CGAL/Gmpq.h>
|
||||
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
|
||||
#include <CGAL/intersections.h>
|
||||
#include <CGAL/Circular_kernel_2.h>
|
||||
#include <CGAL/Arr_line_arc_traits.h>
|
||||
#include <CGAL/Arrangement_2.h>
|
||||
#include <CGAL/Arr_naive_point_location.h>
|
||||
#include <CGAL/Random.h>
|
||||
|
||||
typedef CGAL::Quotient<CGAL::MP_Float> NT;
|
||||
typedef CGAL::Cartesian<NT> Linear_k;
|
||||
typedef CGAL::Algebraic_kernel_for_circles_2_2<NT> Algebraic_k;
|
||||
typedef CGAL::Circular_kernel_2<Linear_k,Algebraic_k> Circular_k;
|
||||
|
||||
//typedef Circular_k::Circular_arc_2 Arc;
|
||||
typedef Circular_k::Line_arc_2 Arc_2;
|
||||
typedef std::vector<Arc_2> ArcContainer;
|
||||
|
||||
typedef CGAL::Arr_line_arc_traits<Circular_k> Traits;
|
||||
|
||||
typedef CGAL::Arrangement_2<Traits> Arrangement;
|
||||
typedef CGAL::Arr_naive_point_location<Arrangement> Point_location;
|
||||
|
||||
typedef Circular_k::Point_2 Point_2;
|
||||
typedef Circular_k::Line_arc_2 Line_arc_2;
|
||||
int main(){
|
||||
|
||||
CGAL::Random generatorOfgenerator;
|
||||
int random_seed = generatorOfgenerator.get_int(0, 123456);
|
||||
//std::cout << "random_seed = " << random_seed << std::endl;
|
||||
CGAL::Random theRandom(random_seed);
|
||||
int random_max = 5;
|
||||
int random_min = -5;
|
||||
for(int j = 0; j < 10 ; j++){
|
||||
|
||||
ArcContainer ac;
|
||||
int x1;
|
||||
int y1;
|
||||
int x2;
|
||||
int y2;
|
||||
|
||||
for(int i = 0; i < 50; i++){
|
||||
x1 = theRandom.get_int(random_min,random_max);
|
||||
y1 = theRandom.get_int(random_min,random_max);
|
||||
do{
|
||||
x2 = theRandom.get_int(random_min,random_max);
|
||||
y2 = theRandom.get_int(random_min,random_max);
|
||||
}while((x1 == x2) && (y1 == y2));
|
||||
|
||||
|
||||
std::cout << x1 << " "
|
||||
<< y1 << " "
|
||||
<< x2 << " "
|
||||
<< y2 << std::endl;
|
||||
ac.push_back( Line_arc_2(Point_2(x1,y1), Point_2(x2,y2)));
|
||||
}
|
||||
|
||||
//while(std::cin >> x1 >> y1 >> x2 >> y2){
|
||||
// ac.push_back( Line_arc_2(Point_2(x1,y1), Point_2(x2,y2)));
|
||||
//}
|
||||
|
||||
{
|
||||
int i = 0;
|
||||
Arrangement arr;
|
||||
Point_location _pl(arr);
|
||||
for (ArcContainer::const_iterator it=ac.begin();
|
||||
it != ac.end(); ++it) {
|
||||
std::cout << i++ << std::endl;
|
||||
//insert(arr,_pl,*it);
|
||||
insert_curve(arr, *it,_pl);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
#include <CGAL/basic.h>
|
||||
#include <CGAL/Random.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/Exact_circular_kernel_2.h>
|
||||
#include <CGAL/Arr_circular_line_arc_traits.h>
|
||||
#include <CGAL/Arrangement_2.h>
|
||||
#include <CGAL/Arr_naive_point_location.h>
|
||||
|
||||
typedef CGAL::Exact_circular_kernel_2 Circular_k;
|
||||
|
||||
typedef Circular_k::Point_2 Point_2;
|
||||
typedef Circular_k::Circle_2 Circle_2;
|
||||
typedef Circular_k::Circular_arc_2 Circular_arc_2;
|
||||
typedef Circular_k::Line_arc_2 Line_arc_2;
|
||||
|
||||
typedef boost::variant< Circular_arc_2, Line_arc_2> Arc_2;
|
||||
typedef std::vector< Arc_2> ArcContainer;
|
||||
|
||||
typedef CGAL::Arr_circular_line_arc_traits
|
||||
<Circular_k, Circular_arc_2, Line_arc_2> Traits;
|
||||
|
||||
typedef CGAL::Arrangement_2<Traits> Arr;
|
||||
typedef CGAL::Arr_naive_point_location<Arr> Point_location;
|
||||
|
||||
int main(){
|
||||
|
||||
CGAL::Random generatorOfgenerator;
|
||||
int random_seed = generatorOfgenerator.get_int(0, 123456);
|
||||
std::cout << "random_seed = " << random_seed << std::endl;
|
||||
CGAL::Random theRandom(random_seed);
|
||||
int random_max = 128;
|
||||
int random_min = -128;
|
||||
ArcContainer ac;
|
||||
int x1, y1, x2, y2;
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
x1 = theRandom.get_int(random_min,random_max);
|
||||
y1 = theRandom.get_int(random_min,random_max);
|
||||
do{
|
||||
x2 = theRandom.get_int(random_min,random_max);
|
||||
y2 = theRandom.get_int(random_min,random_max);
|
||||
} while((x1 == x2) && (y1 == y2));
|
||||
std::cout << x1 << " " << y1 << " " << x2 << " " << y2 << std::endl;
|
||||
|
||||
boost::variant< Circular_arc_2, Line_arc_2 >
|
||||
v = Line_arc_2(Point_2(x1,y1), Point_2(x2,y2));
|
||||
ac.push_back( v);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
x1 = theRandom.get_int(random_min,random_max);
|
||||
y1 = theRandom.get_int(random_min,random_max);
|
||||
|
||||
boost::variant< Circular_arc_2, Line_arc_2 >
|
||||
v = Circle_2( Point_2(x1,y1), x1*x1 + y1*y1);
|
||||
ac.push_back(v);
|
||||
}
|
||||
|
||||
Arr _pm;
|
||||
Point_location _pl(_pm);
|
||||
for (ArcContainer::const_iterator it=ac.begin(); it != ac.end(); ++it) {
|
||||
insert_curve(_pm,*it,_pl);
|
||||
};
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
|
@ -37,58 +37,13 @@ LDFLAGS = \
|
|||
#---------------------------------------------------------------------#
|
||||
|
||||
all: \
|
||||
arrangement_random_circles$(EXE_EXT) \
|
||||
arrangement_random_circles_segments$(EXE_EXT) \
|
||||
Exact_circular_kernel$(EXE_EXT) \
|
||||
Circular_kernel_arrangement$(EXE_EXT) \
|
||||
Circular_kernel_arrangement_Line_arc$(EXE_EXT) \
|
||||
Circular_kernel_arrangement_Line_Circular$(EXE_EXT) \
|
||||
intersecting_arcs$(EXE_EXT) \
|
||||
Lazy_Circular_kernel_arrangement$(EXE_EXT) \
|
||||
Lazy_Circular_kernel_arrangement_Line_arc$(EXE_EXT) \
|
||||
Lazy_Circular_kernel_arrangement_Line_Circular$(EXE_EXT)
|
||||
|
||||
arrangement_random_circles$(EXE_EXT): arrangement_random_circles$(OBJ_EXT)
|
||||
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)arrangement_random_circles arrangement_random_circles$(OBJ_EXT) $(LDFLAGS)
|
||||
|
||||
arrangement_random_circles_segments$(EXE_EXT): arrangement_random_circles_segments$(OBJ_EXT)
|
||||
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)arrangement_random_circles_segments arrangement_random_circles_segments$(OBJ_EXT) $(LDFLAGS)
|
||||
|
||||
Exact_circular_kernel$(EXE_EXT): Exact_circular_kernel$(OBJ_EXT)
|
||||
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)Exact_circular_kernel Exact_circular_kernel$(OBJ_EXT) $(LDFLAGS)
|
||||
|
||||
Circular_kernel_arrangement$(EXE_EXT): Circular_kernel_arrangement$(OBJ_EXT)
|
||||
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)Circular_kernel_arrangement Circular_kernel_arrangement$(OBJ_EXT) $(LDFLAGS)
|
||||
|
||||
Circular_kernel_arrangement_Line_arc$(EXE_EXT): Circular_kernel_arrangement_Line_arc$(OBJ_EXT)
|
||||
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)Circular_kernel_arrangement_Line_arc Circular_kernel_arrangement_Line_arc$(OBJ_EXT) $(LDFLAGS)
|
||||
|
||||
Circular_kernel_arrangement_Line_Circular$(EXE_EXT): Circular_kernel_arrangement_Line_Circular$(OBJ_EXT)
|
||||
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)Circular_kernel_arrangement_Line_Circular Circular_kernel_arrangement_Line_Circular$(OBJ_EXT) $(LDFLAGS)
|
||||
intersecting_arcs$(EXE_EXT)
|
||||
|
||||
intersecting_arcs$(EXE_EXT): intersecting_arcs$(OBJ_EXT)
|
||||
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)intersecting_arcs intersecting_arcs$(OBJ_EXT) $(LDFLAGS)
|
||||
|
||||
Lazy_Circular_kernel_arrangement$(EXE_EXT): Lazy_Circular_kernel_arrangement$(OBJ_EXT)
|
||||
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)Lazy_Circular_kernel_arrangement Lazy_Circular_kernel_arrangement$(OBJ_EXT) $(LDFLAGS)
|
||||
|
||||
Lazy_Circular_kernel_arrangement_Line_arc$(EXE_EXT): Lazy_Circular_kernel_arrangement_Line_arc$(OBJ_EXT)
|
||||
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)Lazy_Circular_kernel_arrangement_Line_arc Lazy_Circular_kernel_arrangement_Line_arc$(OBJ_EXT) $(LDFLAGS)
|
||||
|
||||
Lazy_Circular_kernel_arrangement_Line_Circular$(EXE_EXT): Lazy_Circular_kernel_arrangement_Line_Circular$(OBJ_EXT)
|
||||
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)Lazy_Circular_kernel_arrangement_Line_Circular Lazy_Circular_kernel_arrangement_Line_Circular$(OBJ_EXT) $(LDFLAGS)
|
||||
|
||||
clean: \
|
||||
arrangement_random_circles.clean \
|
||||
arrangement_random_circles_segments.clean \
|
||||
Exact_circular_kernel.clean \
|
||||
Circular_kernel_arrangement.clean \
|
||||
Circular_kernel_arrangement_Line_arc.clean \
|
||||
Circular_kernel_arrangement_Line_Circular.clean \
|
||||
intersecting_arcs.clean \
|
||||
Lazy_Circular_kernel_arrangement.clean \
|
||||
Lazy_Circular_kernel_arrangement_Line_arc.clean \
|
||||
Lazy_Circular_kernel_arrangement_Line_Circular.clean
|
||||
intersecting_arcs.clean
|
||||
|
||||
#---------------------------------------------------------------------#
|
||||
# suffix rules
|
||||
|
|
|
|||
|
|
@ -1,118 +0,0 @@
|
|||
#include <CGAL/basic.h>
|
||||
#include <utility>
|
||||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/MP_Float.h>
|
||||
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
|
||||
#include <CGAL/Lazy_circular_kernel_2.h>
|
||||
#include <CGAL/intersections.h>
|
||||
#include <CGAL/Circular_kernel_2.h>
|
||||
#include <CGAL/Timer.h>
|
||||
#include <CGAL/Arr_circular_arc_traits.h>
|
||||
#include <CGAL/Arr_circular_arc_traits_tracer.h>
|
||||
#include <CGAL/Arrangement_2.h>
|
||||
#include <CGAL/Arr_naive_point_location.h>
|
||||
#include <CGAL/Random.h>
|
||||
|
||||
typedef CGAL::Quotient<CGAL::MP_Float> NT1;
|
||||
typedef CGAL::Cartesian<NT1> Linear_k1;
|
||||
typedef CGAL::Algebraic_kernel_for_circles_2_2<NT1> Algebraic_k1;
|
||||
typedef CGAL::Circular_kernel_2<Linear_k1, Algebraic_k1> CK1_;
|
||||
|
||||
typedef CGAL::Interval_nt_advanced NT2;
|
||||
typedef CGAL::Cartesian<NT2> Linear_k2;
|
||||
typedef CGAL::Algebraic_kernel_for_circles_2_2<NT2> Algebraic_k2;
|
||||
typedef CGAL::Circular_kernel_2<Linear_k2,Algebraic_k2> CK2_;
|
||||
|
||||
typedef CGAL::Lazy_circular_kernel_2<CK1_,CK2_> Circular_k;
|
||||
|
||||
typedef Circular_k::Circular_arc_2 Arc1;
|
||||
typedef std::vector<Arc1> ArcContainer;
|
||||
|
||||
typedef CK1_::Circular_arc_2 Arc2;
|
||||
typedef std::vector<Arc2> ArcContainer2;
|
||||
|
||||
#ifndef CGAL_CURVED_KERNEL_DEBUG
|
||||
typedef CGAL::Arr_circular_arc_traits<Circular_k> Traits;
|
||||
typedef CGAL::Arr_circular_arc_traits<CK1_> Traits2;
|
||||
#else
|
||||
typedef CGAL::Arr_circular_arc_traits<Circular_k> Traits0;
|
||||
typedef CGAL::Circular_arc_traits_tracer<Traits0> Traits;
|
||||
|
||||
typedef CGAL::Arr_circular_arc_traits<CK1_> Traits02;
|
||||
typedef CGAL::Circular_arc_traits_tracer<Traits02> Traits2;
|
||||
#endif
|
||||
|
||||
//typedef Traits::Point_2 Point_2;
|
||||
typedef Traits::Curve_2 Conic_arc_2;
|
||||
typedef CGAL::Arrangement_2<Traits> Pmwx;
|
||||
typedef CGAL::Arr_naive_point_location<Pmwx> Point_location;
|
||||
|
||||
//typedef Traits::Point_2 Point_2_2;
|
||||
typedef Traits2::Curve_2 Conic_arc_2_2;
|
||||
typedef CGAL::Arrangement_2<Traits2> Pmwx2;
|
||||
typedef CGAL::Arr_naive_point_location<Pmwx2> Point_location2;
|
||||
|
||||
typedef Traits2::X_monotone_curve_2 X_monotone_curve_2_2;
|
||||
typedef CK1_::Point_2 Point_2_2;
|
||||
typedef CK1_::Circle_2 Circle_2_2;
|
||||
typedef CK1_::Circular_arc_2 Circular_arc_2_2;
|
||||
|
||||
typedef Traits::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef Circular_k::Point_2 Point_2;
|
||||
typedef Circular_k::Circle_2 Circle_2;
|
||||
typedef Circular_k::Circular_arc_2 Circular_arc_2;
|
||||
|
||||
int main(){
|
||||
|
||||
CGAL::Timer clck1,clck2;
|
||||
double t1,t2,t3,t4;
|
||||
CGAL::Random generatorOfgenerator;
|
||||
int random_seed = generatorOfgenerator.get_int(0, 123456);
|
||||
std::cout << "random_seed = " << random_seed << std::endl;
|
||||
CGAL::Random theRandom(random_seed);
|
||||
int random_max = 128;
|
||||
int random_min = -128;
|
||||
ArcContainer ac;
|
||||
ArcContainer2 ac2;
|
||||
int x;
|
||||
int y;
|
||||
for(int i = 0; i < 30; i++){
|
||||
x = theRandom.get_int(random_min,random_max);
|
||||
y = theRandom.get_int(random_min,random_max);
|
||||
ac.push_back( Circle_2( Point_2(x,y), x*x + y*y));
|
||||
ac2.push_back( Circle_2_2( Point_2_2(x,y), x*x + y*y));
|
||||
}
|
||||
|
||||
Pmwx _pm;
|
||||
Point_location _pl(_pm);
|
||||
|
||||
clck1.start();
|
||||
t1=clck1.time();
|
||||
for (ArcContainer::const_iterator it=ac.begin();
|
||||
it != ac.end(); ++it) {
|
||||
//insert(_pm,_pl,*it);
|
||||
insert_curve(_pm,*it,_pl);
|
||||
};
|
||||
t2=clck1.time();
|
||||
clck1.stop();
|
||||
|
||||
|
||||
Pmwx2 _pm2;
|
||||
Point_location2 _pl2(_pm2);
|
||||
clck2.start();
|
||||
t3=clck2.time();
|
||||
for (ArcContainer2::const_iterator it2=ac2.begin();
|
||||
it2 != ac2.end(); ++it2) {
|
||||
//insert(_pm2,_pl2,*it2);
|
||||
insert_curve(_pm2,*it2,_pl2);
|
||||
};
|
||||
t4=clck2.time();
|
||||
clck2.stop();
|
||||
|
||||
std::cout<<"Lazy Circular_k ="<<(t2-t1)<<std::endl;
|
||||
std::cout<<"Exact Circular_k ="<<(t4-t3)<<std::endl;
|
||||
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
|
@ -1,182 +0,0 @@
|
|||
#include <CGAL/basic.h>
|
||||
#include <utility>
|
||||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/MP_Float.h>
|
||||
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
|
||||
#include <CGAL/intersections.h>
|
||||
#include <CGAL/Circular_kernel_2.h>
|
||||
#include <CGAL/Lazy_circular_kernel_2.h>
|
||||
#include <CGAL/Arr_circular_line_arc_traits.h>
|
||||
#include <CGAL/Arrangement_2.h>
|
||||
#include <CGAL/Arr_naive_point_location.h>
|
||||
#include <boost/variant.hpp>
|
||||
#include <CGAL/Timer.h>
|
||||
|
||||
#include <CGAL/Random.h>
|
||||
|
||||
|
||||
typedef CGAL::Quotient<CGAL::MP_Float> NT1;
|
||||
typedef CGAL::Cartesian<NT1> Linear_k1;
|
||||
typedef CGAL::Algebraic_kernel_for_circles_2_2<NT1> Algebraic_k1;
|
||||
typedef CGAL::Circular_kernel_2<Linear_k1, Algebraic_k1> CK1_;
|
||||
|
||||
typedef CGAL::Interval_nt_advanced NT2;
|
||||
typedef CGAL::Cartesian<NT2> Linear_k2;
|
||||
typedef CGAL::Algebraic_kernel_for_circles_2_2<NT2> Algebraic_k2;
|
||||
typedef CGAL::Circular_kernel_2<Linear_k2,Algebraic_k2> CK2_;
|
||||
|
||||
typedef CGAL::Lazy_circular_kernel_2<CK1_,CK2_> Circular_k;
|
||||
|
||||
|
||||
typedef Circular_k::Point_2 Point_2;
|
||||
typedef Circular_k::Circle_2 Circle_2;
|
||||
typedef Circular_k::Circular_arc_2 Circular_arc_2;
|
||||
typedef Circular_k::Line_arc_2 Line_arc_2;
|
||||
|
||||
typedef CK1_::Point_2 Point_2_2;
|
||||
typedef CK1_::Circle_2 Circle_2_2;
|
||||
typedef CK1_::Circular_arc_2 Circular_arc_2_2;
|
||||
typedef CK1_::Line_arc_2 Line_arc_2_2;
|
||||
|
||||
|
||||
//typedef Circular_k::Circular_arc_2 Arc;
|
||||
//typedef Circular_k::Line_arc_2 Arc;
|
||||
typedef boost::variant< Circular_arc_2, Line_arc_2 > Arc1;
|
||||
typedef boost::variant< Circular_arc_2_2, Line_arc_2_2 > Arc2;
|
||||
|
||||
typedef std::vector< Arc1> ArcContainer;
|
||||
typedef std::vector< Arc2> ArcContainer2;
|
||||
|
||||
#ifndef CGAL_CURVED_KERNEL_DEBUG
|
||||
typedef CGAL::Arr_circular_line_arc_traits<Circular_k,Circular_k::Line_arc_2,
|
||||
Circular_k::Circular_arc_2> Traits;
|
||||
|
||||
typedef CGAL::Arr_circular_line_arc_traits<CK1_,CK1_::Line_arc_2,
|
||||
CK1_::Circular_arc_2> Traits2;
|
||||
#else
|
||||
typedef CGAL::Arr_circular_line_arc_traits<Circular_k,Circular_k::Line_arc_2,
|
||||
Circular_k::Circular_arc_2> Traits0;
|
||||
|
||||
typedef CGAL::Arr_circular_line_arc_traits_tracer<Traits0> Traits;
|
||||
|
||||
typedef CGAL::Arr_circular_line_arc_traits<CK1_,CK1_::Line_arc_2,
|
||||
CK1_::Circular_arc_2> Traits02;
|
||||
typedef CGAL::Arr_circular_line_arc_traits_tracer<Traits02> Traits2;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
typedef Traits::Curve_2 Conic_arc_2;
|
||||
typedef CGAL::Arrangement_2<Traits> Pmwx;
|
||||
typedef CGAL::Arr_naive_point_location<Pmwx> Point_location;
|
||||
|
||||
typedef Traits::X_monotone_curve_2 X_monotone_curve_2;
|
||||
|
||||
typedef Traits2::Curve_2 Conic_arc_2_2;
|
||||
typedef CGAL::Arrangement_2<Traits2> Pmwx2;
|
||||
typedef CGAL::Arr_naive_point_location<Pmwx2> Point_location2;
|
||||
|
||||
typedef Traits2::X_monotone_curve_2 X_monotone_curve_2_2;
|
||||
|
||||
|
||||
|
||||
int main(){
|
||||
|
||||
CGAL::Random generatorOfgenerator;
|
||||
int random_seed = generatorOfgenerator.get_int(0, 123456);
|
||||
std::cout << "random_seed = " << random_seed << std::endl;
|
||||
CGAL::Random theRandom(random_seed);
|
||||
int random_max = 128;
|
||||
int random_min = -128;
|
||||
|
||||
ArcContainer ac;
|
||||
ArcContainer2 ac2;
|
||||
|
||||
CGAL::Timer clck1,clck2;
|
||||
double t1,t2,t3,t4;
|
||||
|
||||
int x1;
|
||||
int y1;
|
||||
int x2;
|
||||
int y2;
|
||||
//double x1, y1, x2, y2;
|
||||
|
||||
for(int i = 0; i < 200; i++){
|
||||
x1 = theRandom.get_int(random_min,random_max);
|
||||
y1 = theRandom.get_int(random_min,random_max);
|
||||
//x1 = theRandom.get_double(random_min,random_max);
|
||||
//y1 = theRandom.get_double(random_min,random_max);
|
||||
do{
|
||||
x2 = theRandom.get_int(random_min,random_max);
|
||||
y2 = theRandom.get_int(random_min,random_max);
|
||||
//x2 = theRandom.get_double(random_min,random_max);
|
||||
//y2 = theRandom.get_double(random_min,random_max);
|
||||
}while((x1 == x2) && (y1 == y2));
|
||||
|
||||
std::cout << x1 << " "
|
||||
<< y1 << " "
|
||||
<< x2 << " "
|
||||
<< y2 << std::endl;
|
||||
boost::variant< Circular_arc_2, Line_arc_2 > v = Line_arc_2(Point_2(x1,y1), Point_2(x2,y2));
|
||||
ac.push_back( v);
|
||||
|
||||
boost::variant< Circular_arc_2_2, Line_arc_2_2 > v2 = Line_arc_2_2(Point_2_2(x1,y1), Point_2_2(x2,y2));
|
||||
ac2.push_back( v2);
|
||||
|
||||
}
|
||||
|
||||
for(int i = 0; i < 10; i++){
|
||||
x1 = theRandom.get_int(random_min,random_max);
|
||||
y1 = theRandom.get_int(random_min,random_max);
|
||||
boost::variant< Circular_arc_2, Line_arc_2 > v = Circle_2( Point_2(x1,y1), x1*x1 + y1*y1);
|
||||
ac.push_back(v);
|
||||
|
||||
boost::variant< Circular_arc_2_2, Line_arc_2_2 > v2 = Circle_2_2( Point_2_2(x1,y1), x1*x1 + y1*y1);
|
||||
ac2.push_back(v2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Pmwx _pm;
|
||||
Point_location _pl(_pm);
|
||||
|
||||
clck1.start();
|
||||
|
||||
t1=clck1.time();
|
||||
|
||||
|
||||
for (ArcContainer::const_iterator it=ac.begin();
|
||||
it != ac.end(); ++it) {
|
||||
//insert(_pm,_pl,*it);
|
||||
insert_curve(_pm,*it,_pl);
|
||||
};
|
||||
|
||||
t2=clck1.time();
|
||||
|
||||
clck1.stop();
|
||||
|
||||
|
||||
Pmwx2 _pm2;
|
||||
Point_location2 _pl2(_pm2);
|
||||
|
||||
clck2.start();
|
||||
|
||||
t3=clck2.time();
|
||||
|
||||
|
||||
for (ArcContainer2::const_iterator it2=ac2.begin();
|
||||
it2 != ac2.end(); ++it2) {
|
||||
//insert(_pm,_pl,*it);
|
||||
insert_curve(_pm2,*it2,_pl2);
|
||||
};
|
||||
|
||||
t4=clck2.time();
|
||||
|
||||
clck2.stop();
|
||||
|
||||
std::cout<<"Lazy Circular_k ="<<(t2-t1)<<std::endl;
|
||||
std::cout<<"Exact Circular_k ="<<(t4-t3)<<std::endl;
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
#include <CGAL/basic.h>
|
||||
#include <utility>
|
||||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/MP_Float.h>
|
||||
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
|
||||
#include <CGAL/Lazy_circular_kernel_2.h>
|
||||
#include <CGAL/intersections.h>
|
||||
#include <CGAL/Circular_kernel_2.h>
|
||||
#include <CGAL/Arr_line_arc_traits.h>
|
||||
#include <CGAL/Timer.h>
|
||||
#include <CGAL/Arrangement_2.h>
|
||||
#include <CGAL/Arr_naive_point_location.h>
|
||||
#include <CGAL/Random.h>
|
||||
|
||||
|
||||
typedef CGAL::Quotient<CGAL::MP_Float> NT1;
|
||||
typedef CGAL::Cartesian<NT1> Linear_k1;
|
||||
typedef CGAL::Algebraic_kernel_for_circles_2_2<NT1> Algebraic_k1;
|
||||
typedef CGAL::Circular_kernel_2<Linear_k1, Algebraic_k1> CK1_;
|
||||
|
||||
typedef CGAL::Interval_nt_advanced NT2;
|
||||
typedef CGAL::Cartesian<NT2> Linear_k2;
|
||||
typedef CGAL::Algebraic_kernel_for_circles_2_2<NT2> Algebraic_k2;
|
||||
typedef CGAL::Circular_kernel_2<Linear_k2,Algebraic_k2> CK2_;
|
||||
|
||||
typedef CGAL::Lazy_circular_kernel_2<CK1_,CK2_> Circular_k;
|
||||
|
||||
typedef Circular_k::Line_arc_2 Arc1;
|
||||
typedef std::vector<Arc1> ArcContainer;
|
||||
|
||||
typedef CK1_::Line_arc_2 Arc2;
|
||||
typedef std::vector<Arc2> ArcContainer2;
|
||||
|
||||
#ifndef CGAL_CURVED_KERNEL_DEBUG
|
||||
typedef CGAL::Arr_line_arc_traits<Circular_k> Traits;
|
||||
typedef CGAL::Arr_line_arc_traits<CK1_> Traits2;
|
||||
#else
|
||||
typedef CGAL::Arr_line_arc_traits<Circular_k> Traits0;
|
||||
typedef CGAL::Circular_arc_traits_tracer<Traits0> Traits;
|
||||
|
||||
typedef CGAL::Arr_line_arc_traits<CK1_> Traits02;
|
||||
typedef CGAL::Circular_arc_traits_tracer<Traits02> Traits2;
|
||||
#endif
|
||||
|
||||
|
||||
typedef Traits::Curve_2 Conic_arc_2;
|
||||
typedef CGAL::Arrangement_2<Traits> Pmwx;
|
||||
typedef CGAL::Arr_naive_point_location<Pmwx> Point_location;
|
||||
|
||||
|
||||
//typedef Traits::Point_2 Point_2_2;
|
||||
typedef Traits2::Curve_2 Conic_arc_2_2;
|
||||
typedef CGAL::Arrangement_2<Traits2> Pmwx2;
|
||||
typedef CGAL::Arr_naive_point_location<Pmwx2> Point_location2;
|
||||
|
||||
|
||||
|
||||
typedef Traits::X_monotone_curve_2 X_monotone_curve_2;
|
||||
typedef Circular_k::Point_2 Point_2;
|
||||
typedef CK1_::Point_2 Point_2_2;
|
||||
typedef Circular_k::Circle_2 Circle_2;
|
||||
typedef Circular_k::Circular_arc_2 Circular_arc_2;
|
||||
typedef Circular_k::Line_arc_2 Line_arc_2;
|
||||
typedef CK1_::Line_arc_2 Line_arc_2_2;
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
|
||||
CGAL::Random generatorOfgenerator;
|
||||
int random_seed = generatorOfgenerator.get_int(0, 123456);
|
||||
//std::cout << "random_seed = " << random_seed << std::endl;
|
||||
CGAL::Random theRandom(random_seed);
|
||||
int random_max = 5;
|
||||
int random_min = -5;
|
||||
// for(int j = 0; j < 10 ; j++){
|
||||
|
||||
ArcContainer ac;
|
||||
ArcContainer2 ac2;
|
||||
int x1,y1,x2,y2;
|
||||
double t1,t2,t3,t4;
|
||||
CGAL::Timer clck1,clck2;
|
||||
|
||||
for(int i = 0; i < 100; i++){
|
||||
x1 = theRandom.get_int(random_min,random_max);
|
||||
y1 = theRandom.get_int(random_min,random_max);
|
||||
do{
|
||||
x2 = theRandom.get_int(random_min,random_max);
|
||||
y2 = theRandom.get_int(random_min,random_max);
|
||||
}while((x1 == x2) && (y1 == y2));
|
||||
|
||||
|
||||
std::cout << x1 << " "
|
||||
<< y1 << " "
|
||||
<< x2 << " "
|
||||
<< y2 << std::endl;
|
||||
ac.push_back( Line_arc_2(Point_2(x1,y1), Point_2(x2,y2)));
|
||||
ac2.push_back( Line_arc_2_2(Point_2_2(x1,y1), Point_2_2(x2,y2)));
|
||||
}
|
||||
|
||||
// while(std::cin >> x1 >> y1 >> x2 >> y2){
|
||||
// ac.push_back( Line_arc_2(Point_2(x1,y1), Point_2(x2,y2)));
|
||||
// ac2.push_back( Line_arc_2_2(Point_2_2(x1,y1), Point_2_2(x2,y2)));
|
||||
// }
|
||||
|
||||
|
||||
Pmwx _pm;
|
||||
Point_location _pl(_pm);
|
||||
|
||||
clck1.start();
|
||||
t1=clck1.time();
|
||||
for (ArcContainer::const_iterator it=ac.begin();
|
||||
it != ac.end(); ++it) {
|
||||
//insert(_pm,_pl,*it);
|
||||
insert_curve(_pm,*it,_pl);
|
||||
};
|
||||
t2=clck1.time();
|
||||
|
||||
clck1.stop();
|
||||
|
||||
Pmwx2 _pm2;
|
||||
Point_location2 _pl2(_pm2);
|
||||
|
||||
clck2.start();
|
||||
t3=clck2.time();
|
||||
for (ArcContainer2::const_iterator it2=ac2.begin();
|
||||
it2 != ac2.end(); ++it2) {
|
||||
//insert(_pm2,_pl2,*it2);
|
||||
insert_curve(_pm2,*it2,_pl2);
|
||||
};
|
||||
t4=clck2.time();
|
||||
|
||||
clck2.stop();
|
||||
|
||||
std::cout<<"Lazy Circular_k ="<<(t2-t1)<<std::endl;
|
||||
std::cout<<"Exact Circular_k ="<<(t4-t3)<<std::endl;
|
||||
|
||||
|
||||
// }
|
||||
return 0;
|
||||
};
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/Random.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/MP_Float.h>
|
||||
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
|
||||
#include <CGAL/Circular_kernel_2.h>
|
||||
#include <CGAL/Arr_circular_arc_traits.h>
|
||||
#include <CGAL/Arrangement_2.h>
|
||||
#include <CGAL/Arr_naive_point_location.h>
|
||||
|
||||
typedef CGAL::Quotient<CGAL::MP_Float> NT;
|
||||
typedef CGAL::Cartesian<NT> Linear_k;
|
||||
typedef CGAL::Algebraic_kernel_for_circles_2_2<NT> Algebraic_k;
|
||||
typedef CGAL::Circular_kernel_2<Linear_k,Algebraic_k> Circular_k;
|
||||
|
||||
typedef Circular_k::Point_2 Point_2;
|
||||
typedef Circular_k::Circle_2 Circle_2;
|
||||
typedef Circular_k::Circular_arc_2 Circular_arc_2;
|
||||
typedef std::vector<Circular_arc_2> ArcContainer;
|
||||
|
||||
typedef CGAL::Arr_circular_arc_traits<Circular_k> Traits;
|
||||
|
||||
typedef CGAL::Arrangement_2<Traits> Arr;
|
||||
typedef CGAL::Arr_naive_point_location<Arr> Point_location;
|
||||
|
||||
int main(){
|
||||
|
||||
CGAL::Random generatorOfgenerator;
|
||||
int random_seed = generatorOfgenerator.get_int(0, 123456);
|
||||
std::cout << "random_seed = " << random_seed << std::endl;
|
||||
CGAL::Random theRandom(random_seed);
|
||||
int random_max = 128;
|
||||
int random_min = -128;
|
||||
ArcContainer ac;
|
||||
int x, y;
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
x = theRandom.get_int(random_min,random_max);
|
||||
y = theRandom.get_int(random_min,random_max);
|
||||
ac.push_back( Circle_2( Point_2(x,y), x*x + y*y));
|
||||
}
|
||||
|
||||
Arr arr;
|
||||
Point_location _pl(arr);
|
||||
for (ArcContainer::const_iterator it=ac.begin(); it != ac.end(); ++it) {
|
||||
insert_curve(arr, *it, _pl);
|
||||
};
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
|
@ -1,70 +0,0 @@
|
|||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/Random.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/MP_Float.h>
|
||||
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
|
||||
#include <CGAL/Circular_kernel_2.h>
|
||||
#include <CGAL/Arr_circular_line_arc_traits.h>
|
||||
#include <CGAL/Arrangement_2.h>
|
||||
#include <CGAL/Arr_naive_point_location.h>
|
||||
|
||||
typedef CGAL::Quotient<CGAL::MP_Float> NT;
|
||||
typedef CGAL::Cartesian<NT> Linear_k;
|
||||
typedef CGAL::Algebraic_kernel_for_circles_2_2<NT> Algebraic_k;
|
||||
typedef CGAL::Circular_kernel_2<Linear_k,Algebraic_k> Circular_k;
|
||||
typedef Circular_k::Point_2 Point_2;
|
||||
typedef Circular_k::Circle_2 Circle_2;
|
||||
typedef Circular_k::Circular_arc_2 Circular_arc_2;
|
||||
typedef Circular_k::Line_arc_2 Line_arc_2;
|
||||
|
||||
typedef boost::variant< Circular_arc_2, Line_arc_2> Arc_2;
|
||||
typedef std::vector< Arc_2> ArcContainer;
|
||||
|
||||
typedef CGAL::Arr_circular_line_arc_traits
|
||||
<Circular_k, Circular_arc_2, Line_arc_2> Traits;
|
||||
|
||||
typedef CGAL::Arrangement_2<Traits> Arr;
|
||||
typedef CGAL::Arr_naive_point_location<Arr> Point_location;
|
||||
|
||||
int main(){
|
||||
|
||||
CGAL::Random generatorOfgenerator;
|
||||
int random_seed = generatorOfgenerator.get_int(0, 123456);
|
||||
std::cout << "random_seed = " << random_seed << std::endl;
|
||||
CGAL::Random theRandom(random_seed);
|
||||
int random_max = 128;
|
||||
int random_min = -128;
|
||||
ArcContainer ac;
|
||||
int x1, y1, x2, y2;
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
x1 = theRandom.get_int(random_min,random_max);
|
||||
y1 = theRandom.get_int(random_min,random_max);
|
||||
do{
|
||||
x2 = theRandom.get_int(random_min,random_max);
|
||||
y2 = theRandom.get_int(random_min,random_max);
|
||||
} while((x1 == x2) && (y1 == y2));
|
||||
std::cout << x1 << " " << y1 << " " << x2 << " " << y2 << std::endl;
|
||||
|
||||
boost::variant< Circular_arc_2, Line_arc_2 >
|
||||
v = Line_arc_2(Point_2(x1,y1), Point_2(x2,y2));
|
||||
ac.push_back( v);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
x1 = theRandom.get_int(random_min,random_max);
|
||||
y1 = theRandom.get_int(random_min,random_max);
|
||||
|
||||
boost::variant< Circular_arc_2, Line_arc_2 >
|
||||
v = Circle_2( Point_2(x1,y1), x1*x1 + y1*y1);
|
||||
ac.push_back(v);
|
||||
}
|
||||
|
||||
Arr arr;
|
||||
Point_location _pl(arr);
|
||||
for (ArcContainer::const_iterator it=ac.begin(); it != ac.end(); ++it) {
|
||||
insert_curve(arr, *it, _pl);
|
||||
};
|
||||
|
||||
return 0;
|
||||
};
|
||||
Loading…
Reference in New Issue