Make the benchmark compiling again.

I try to run some of the mode 'alpha' as described in the
README_benchmark_CK2.txt but this ended up with different
preconditions non validated (for alpha=1,4,5 or 8 with beta=9)
This commit is contained in:
Sébastien Loriot 2010-06-22 09:37:10 +00:00
parent 625582b52e
commit 93a7d05699
14 changed files with 123 additions and 180 deletions

View File

@ -260,14 +260,14 @@ private:
typedef typename CGAL::Arr_naive_point_location<Pmwx> Point_location; typedef typename CGAL::Arr_naive_point_location<Pmwx> Point_location;
std::cout << "memory size before construction" << mem_sizer.virtual_size() << std::endl; std::cout << "memory size before construction" << mem_sizer.virtual_size() << std::endl;
std::cout << "memory resident size before insert_curves()" << mem_sizer.resident_size () << std::endl; std::cout << "memory resident size before insert()" << mem_sizer.resident_size () << std::endl;
MemBefore = mem_sizer.virtual_size ()/1000; MemBefore = mem_sizer.virtual_size ()/1000;
Pmwx _pm; Pmwx _pm;
Point_location _pl(_pm); Point_location _pl(_pm);
try{ try{
this->start(); this->start();
insert_curves(_pm,ac.begin(),ac.end()); insert(_pm,ac.begin(),ac.end(),boost::false_type());
this->stop(); this->stop();
} }
catch (...) { catch (...) {
@ -280,8 +280,8 @@ private:
if (!fail){this->summarize(_pm.number_of_vertices(),_pm.number_of_halfedges());} if (!fail){this->summarize(_pm.number_of_vertices(),_pm.number_of_halfedges());}
MemAfter = mem_sizer.virtual_size ()/1000; MemAfter = mem_sizer.virtual_size ()/1000;
std::cout << "memory size after insert_curves()" << mem_sizer.virtual_size () << std::endl; std::cout << "memory size after insert()" << mem_sizer.virtual_size () << std::endl;
std::cout << "memory resident size after insert_curves()" << mem_sizer.resident_size () << std::endl; std::cout << "memory resident size after insert()" << mem_sizer.resident_size () << std::endl;
_pm.clear(); _pm.clear();
} }

View File

@ -25,7 +25,7 @@ void _bench_input_grid(ArcContainer& ac){
for(int i = 0; i < 20; i++){ for(int i = 0; i < 20; i++){
for(int j = 0; j <20; j++){ for(int j = 0; j <20; j++){
ac.push_back( Circle_2( Point_2(x + j*r, y + i*r), r*r)); ac.push_back(typename CK::Circular_arc_2 ( Circle_2( Point_2(x + j*r, y + i*r), r*r)));
} }
} }
} }
@ -42,7 +42,7 @@ void _bench_input_grid2(ArcContainer& ac){
for(int i = 0; i < 20; i++){ for(int i = 0; i < 20; i++){
for(int j = 0; j < 20; j++){ for(int j = 0; j < 20; j++){
ac.push_back(Circle_2( Point_2(x + j*r, y + i*r), r*r)); ac.push_back(typename CK::Circular_arc_2 ( Circle_2( Point_2(x + j*r, y + i*r), r*r) ));
} }
} }
@ -51,7 +51,7 @@ void _bench_input_grid2(ArcContainer& ac){
for(int i = 0; i < 20; i++){ for(int i = 0; i < 20; i++){
for(int j = 0; j < 20; j++){ for(int j = 0; j < 20; j++){
ac.push_back( Circle_2( Point_2(x + j*r, y + i*r), r*r)); ac.push_back(typename CK::Circular_arc_2 ( Circle_2( Point_2(x + j*r, y + i*r), r*r)));
} }
} }
@ -77,7 +77,7 @@ void _bench_input_random(ArcContainter& arcs)
double y = theRandom.get_double(random_min,random_max); double y = theRandom.get_double(random_min,random_max);
double r = theRandom.get_double(0.1,random_max); double r = theRandom.get_double(0.1,random_max);
fout << x << " " << y << " " << r << " " ; fout << x << " " << y << " " << r << " " ;
arcs.push_back( Circle_2( Point_2(x,y), r*r)); arcs.push_back(typename CK::Circular_arc_2 ( Circle_2( Point_2(x,y), r*r) ));
} }
fout.close(); fout.close();
@ -94,7 +94,7 @@ void _bench_input_file(ArcContainter& arcs){
std::ifstream fin("random.inp"); std::ifstream fin("random.inp");
for(int i = 0; i < 100 ; i++){ for(int i = 0; i < 100 ; i++){
fin >> x >> y >> r ; fin >> x >> y >> r ;
arcs.push_back( Circle_2( Point_2(x,y), r*r)); arcs.push_back(typename CK::Circular_arc_2 ( Circle_2( Point_2(x,y), r*r)));
} }
fin.close(); fin.close();
@ -115,7 +115,7 @@ void _bench_input_rotation(ArcContainter& ac){
for(int i = 0; i < 5; i++){ for(int i = 0; i < 5; i++){
for(int j = 0; j < 5; j++){ for(int j = 0; j < 5; j++){
R = (r+k)*(r+k); R = (r+k)*(r+k);
ac.push_back( Circle_2( Point_2(x + i*r, y + j*r),R)); ac.push_back(typename CK::Circular_arc_2 ( Circle_2( Point_2(x + i*r, y + j*r),R) ));
} }
} }
} }

View File

@ -206,7 +206,7 @@ class Bench
typedef typename CGAL::Arrangement_2<Traits> Pmwx; typedef typename CGAL::Arrangement_2<Traits> Pmwx;
typedef typename CGAL::Arr_naive_point_location<Pmwx> Point_location; typedef typename CGAL::Arr_naive_point_location<Pmwx> Point_location;
std::cout << "memory size before construction" << mem_sizer.virtual_size() << std::endl; std::cout << "memory size before construction" << mem_sizer.virtual_size() << std::endl;
std::cout << "memory resident size before insert_curves()" << mem_sizer.resident_size () << std::endl; std::cout << "memory resident size before insert()" << mem_sizer.resident_size () << std::endl;
Pmwx _pm; Pmwx _pm;
Point_location _pl(_pm); Point_location _pl(_pm);
@ -214,7 +214,7 @@ class Bench
try{ try{
this->start(); this->start();
insert_curves(_pm,ac.begin(),ac.end()); insert(_pm,ac.begin(),ac.end(),boost::false_type());
this->stop(); this->stop();
} }
@ -231,8 +231,8 @@ class Bench
if (!fail){this->summarize(_pm.number_of_vertices(),_pm.number_of_halfedges());} if (!fail){this->summarize(_pm.number_of_vertices(),_pm.number_of_halfedges());}
std::cout << "memory size after insert_curves()" << mem_sizer.virtual_size () << std::endl; std::cout << "memory size after insert()" << mem_sizer.virtual_size () << std::endl;
std::cout << "memory resident size after insert_curves()" << mem_sizer.resident_size () << std::endl; std::cout << "memory resident size after insert()" << mem_sizer.resident_size () << std::endl;
} }

View File

@ -195,7 +195,7 @@ Bench bench(Htmlfilename,Texfilename,Dxffilename[i]);
// // for (typename ArcContainer::const_iterator it=ac.begin(); // // for (typename ArcContainer::const_iterator it=ac.begin();
// // it != ac.end(); ++it) { // // it != ac.end(); ++it) {
// // //insert(_pm,_pl,*it); // // //insert(_pm,_pl,*it);
// // insert_curves(_pm,*it,_pl); // // insert(_pm,*it,_pl);
// // }; // // };
// // bench.stop(); // // bench.stop();
// // bench.summarize(_pm.number_of_vertices(),_pm.number_of_halfedges()); // // bench.summarize(_pm.number_of_vertices(),_pm.number_of_halfedges());

View File

@ -29,13 +29,13 @@ private:
int i; int i;
typedef std::size_t size_type; typedef std::size_t size_type;
CGAL::Memory_sizer mem_sizer; CGAL::Memory_sizer mem_sizer;
char* Dxffile; std::string Dxffile;
bool ONLY_DXF; bool ONLY_DXF;
double MemBefore,MemAfter; double MemBefore,MemAfter;
public: public:
Bench(const bool only_dxf=false, char *fhtml="benchmarks.html", char* ftex="benchmarks.tex",char* Dxffilename=""): Bench(const bool only_dxf=false, const char *fhtml="benchmarks.html", const char* ftex="benchmarks.tex",const char* Dxffilename=""):
htmlout(fhtml,std::ios::app), htmlout(fhtml,std::ios::app),
texout(ftex,std::ios::app){ texout(ftex,std::ios::app){
i=0; i=0;
@ -161,7 +161,7 @@ private:
void summarize(int vertices,int hedges){ void summarize(int vertices,int hedges){
int temp; int temp;
temp=CGAL::Interval_nt<>::number_of_failures(); // temp=CGAL::Interval_nt<>::number_of_failures();
numof_f_fails = temp - numof_f_fails; numof_f_fails = temp - numof_f_fails;
std::cout << " numbers_of_filter_fails : " << numof_f_fails << std::endl; std::cout << " numbers_of_filter_fails : " << numof_f_fails << std::endl;
@ -188,7 +188,7 @@ private:
<< " Time (sec): " << utime.tv_sec << std::endl << " Time (sec): " << utime.tv_sec << std::endl
<< " (usec): " << std::setw(6) << std::setfill('0') << " (usec): " << std::setw(6) << std::setfill('0')
<< utime.tv_usec << std::endl; << utime.tv_usec << std::endl;
numof_f_fails = CGAL::Interval_nt<>::number_of_failures(); // numof_f_fails = CGAL::Interval_nt<>::number_of_failures();
} }
void fail(void){ void fail(void){
@ -213,13 +213,13 @@ private:
typedef typename CGAL::Arr_naive_point_location<Pmwx> Point_location; typedef typename CGAL::Arr_naive_point_location<Pmwx> Point_location;
std::cout << "memory size before construction" << mem_sizer.virtual_size() << std::endl; std::cout << "memory size before construction" << mem_sizer.virtual_size() << std::endl;
std::cout << "memory resident size before insert_curves()" << mem_sizer.resident_size () << std::endl; std::cout << "memory resident size before insert()" << mem_sizer.resident_size () << std::endl;
MemBefore = mem_sizer.virtual_size ()/1000000; MemBefore = mem_sizer.virtual_size ()/1000000;
Pmwx _pm; Pmwx _pm;
Point_location _pl(_pm); Point_location _pl(_pm);
try{ try{
this->start(); this->start();
insert_curves(_pm,ac.begin(),ac.end()); insert(_pm,ac.begin(),ac.end(),boost::false_type());
this->stop(); this->stop();
} catch (std::exception &e) { } catch (std::exception &e) {
this->fail(); this->fail();
@ -236,8 +236,8 @@ private:
MemAfter = mem_sizer.virtual_size ()/1000000; MemAfter = mem_sizer.virtual_size ()/1000000;
std::cout << "memory size after insert_curves()" << mem_sizer.virtual_size () << std::endl; std::cout << "memory size after insert()" << mem_sizer.virtual_size () << std::endl;
std::cout << "memory resident size after insert_curves()" << mem_sizer.resident_size () << std::endl; std::cout << "memory resident size after insert()" << mem_sizer.resident_size () << std::endl;
_pm.clear(); _pm.clear();
} }
@ -282,7 +282,7 @@ template <class CK,class Traits,class ArcContainer>
} }
template <class CK,class Traits,class ArcContainer> template <class CK,class Traits,class ArcContainer>
void dfx(char* Dfxfile){ void dfx(const char* Dfxfile){
i=4; i=4;
ArcContainer arc; ArcContainer arc;
@ -316,7 +316,7 @@ template <class CK,class Traits,class ArcContainer>
} }
public: public:
template <class CK,class Traits,class ArcContainer> template <class CK,class Traits,class ArcContainer>
void Compute(char* dxffile){ void Compute(const char* dxffile){
if(!ONLY_DXF){ if(!ONLY_DXF){
this->grid<CK,Traits,ArcContainer>(); this->grid<CK,Traits,ArcContainer>();
this->grid2<CK,Traits,ArcContainer>(); this->grid2<CK,Traits,ArcContainer>();
@ -351,12 +351,12 @@ public:
} }
template <class CK,class Traits,class ArcContainer> template <class CK,class Traits,class ArcContainer>
void Compute_dxf(char* dxffile){ void Compute_dxf(const char* dxffile){
this->dfx<CK,Traits,ArcContainer>(dxffile); this->dfx<CK,Traits,ArcContainer>(dxffile);
this->close_row(); this->close_row();
} }
void kernel(char* kernel){ void kernel(const char* kernel){
this->open_row(); this->open_row();
this->open_cell(); this->open_cell();
htmlout << kernel; htmlout << kernel;
@ -365,8 +365,8 @@ template <class CK,class Traits,class ArcContainer>
} }
void newDxfFilename(char* Dxffilename=""){ void newDxfFilename(const char* Dxffilename=""){
char* newDxf = Dxffilename; const char* newDxf = Dxffilename;
if(!ONLY_DXF){ if(!ONLY_DXF){
htmlout<< "<tr bgcolor=\"gray\"><td>Kernel</td><td>grid I</td><td>grid II</td><td>random double</td><td>Dxf input is: "<< newDxf <<"</td><td> rotation </td></tr>" htmlout<< "<tr bgcolor=\"gray\"><td>Kernel</td><td>grid I</td><td>grid II</td><td>random double</td><td>Dxf input is: "<< newDxf <<"</td><td> rotation </td></tr>"

View File

@ -10,12 +10,12 @@
#include <CGAL/Algebraic_kernel_for_circles_2_2.h> #include <CGAL/Algebraic_kernel_for_circles_2_2.h>
#include <CGAL/intersections.h> #include <CGAL/intersections.h>
#include <CGAL/Circular_kernel_2.h> #include <CGAL/Circular_kernel_2.h>
#include <CGAL/Arr_circular_arc_traits.h> #include <CGAL/Arr_circular_arc_traits_2.h>
#include <CGAL/Lazy_circular_kernel_2.h> #include <CGAL/Lazy_circular_kernel_2.h>
#include <CGAL/Filtered_bbox_circular_kernel_2.h> #include <CGAL/Filtered_bbox_circular_kernel_2.h>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
#include <CGAL/Arr_naive_point_location.h> #include <CGAL/Arr_naive_point_location.h>
#include <CGAL/Arr_circular_line_arc_traits.h> #include <CGAL/Arr_circular_line_arc_traits_2.h>
#include <CGAL/Timer.h> #include <CGAL/Timer.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
@ -23,19 +23,20 @@
#include <fstream> #include <fstream>
#include <iomanip> #include <iomanip>
#include <boost/type_traits.hpp>
// CIRCULAR KERNEL TYPEDEFS // CIRCULAR KERNEL TYPEDEFS
typedef CGAL::MP_Float RT; typedef CGAL::MP_Float RT;
typedef CGAL::Quotient<RT> NT1; typedef CGAL::Quotient<RT> NT1;
typedef CGAL::Cartesian<NT1> Linear_k1; typedef CGAL::Cartesian<NT1> Linear_k1;
typedef CGAL::Algebraic_kernel_for_circles_2_2<NT1> Algebraic_k1; typedef CGAL::Algebraic_kernel_for_circles_2_2<NT1> Algebraic_k1;
typedef CGAL::Circular_kernel_2<Linear_k1, Algebraic_k1> CircularKernel; typedef CGAL::Circular_kernel_2<Linear_k1, Algebraic_k1> CircularKernel;
typedef CGAL::Arr_circular_arc_traits<CircularKernel> CircularK_CA_Traits; typedef CGAL::Arr_circular_arc_traits_2<CircularKernel> CircularK_CA_Traits;
typedef CircularKernel::Circular_arc_2 CircularKArc; typedef CircularKernel::Circular_arc_2 CircularKArc;
typedef std::vector<CircularKArc> CircularKArcContainer; typedef std::vector<CircularKArc> CircularKArcContainer;
typedef CircularKernel::Circular_arc_2 Circular_arc_2; typedef CircularKernel::Circular_arc_2 Circular_arc_2;
typedef CircularKernel::Line_arc_2 Line_arc_2; typedef CircularKernel::Line_arc_2 Line_arc_2;
typedef CGAL::Arr_circular_line_arc_traits<CircularKernel, typedef CGAL::Arr_circular_line_arc_traits_2<CircularKernel> CircularK_Variant_Traits;
Line_arc_2,Circular_arc_2> CircularK_Variant_Traits;
typedef boost::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc; typedef boost::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc;
typedef std::vector<CircularKVarArc> CircularKVarArcContainer; typedef std::vector<CircularKVarArc> CircularKVarArcContainer;
@ -45,20 +46,20 @@ typedef CGAL::Cartesian<NT3> Linear_k3;
typedef CGAL::Algebraic_kernel_for_circles_2_2<NT3> Algebraic_k3; typedef CGAL::Algebraic_kernel_for_circles_2_2<NT3> Algebraic_k3;
typedef CGAL::Circular_kernel_2 <Linear_k3,Algebraic_k3> CK3_; typedef CGAL::Circular_kernel_2 <Linear_k3,Algebraic_k3> CK3_;
typedef CGAL::Lazy_circular_kernel_2<CircularKernel,CK3_> LazyCurvedK; typedef CGAL::Lazy_circular_kernel_2<CircularKernel,CK3_> LazyCurvedK;
typedef CGAL::Arr_circular_arc_traits<LazyCurvedK> LazyCurvedK_CA_Traits; typedef CGAL::Arr_circular_arc_traits_2<LazyCurvedK> LazyCurvedK_CA_Traits;
typedef LazyCurvedK::Circular_arc_2 LazyArc; typedef LazyCurvedK::Circular_arc_2 LazyArc;
typedef std::vector<LazyArc> LazyArcContainer; typedef std::vector<LazyArc> LazyArcContainer;
typedef LazyCurvedK::Circular_arc_2 Circular_arc_3; typedef LazyCurvedK::Circular_arc_2 Circular_arc_3;
typedef LazyCurvedK::Line_arc_2 Line_arc_3; typedef LazyCurvedK::Line_arc_2 Line_arc_3;
typedef boost::variant<Circular_arc_3,Line_arc_3 > LazyVarArc; typedef boost::variant<Circular_arc_3,Line_arc_3 > LazyVarArc;
typedef std::vector<LazyVarArc> LazyVarContainer; typedef std::vector<LazyVarArc> LazyVarContainer;
typedef CGAL::Arr_circular_line_arc_traits<LazyCurvedK, //~ typedef CGAL::Arr_circular_line_arc_traits_2<LazyCurvedK,Line_arc_3,Circular_arc_3> LazyCurvedK_Variant_Traits;
Line_arc_3,Circular_arc_3> LazyCurvedK_Variant_Traits; typedef CGAL::Arr_circular_line_arc_traits_2<LazyCurvedK> LazyCurvedK_Variant_Traits;
// BBOX TYPEDEFS // BBOX TYPEDEFS
typedef CGAL::Filtered_bbox_circular_kernel_2<CircularKernel> typedef CGAL::Filtered_bbox_circular_kernel_2<CircularKernel>
BBCircularKernel ; BBCircularKernel ;
typedef CGAL::Arr_circular_arc_traits<BBCircularKernel> typedef CGAL::Arr_circular_arc_traits_2<BBCircularKernel>
BBCircularKernel_CA_Traits; BBCircularKernel_CA_Traits;
typedef BBCircularKernel::Circular_arc_2 typedef BBCircularKernel::Circular_arc_2
BBCircularKernelArc; BBCircularKernelArc;
@ -72,13 +73,12 @@ typedef boost::variant<Circular_arc_6,Line_arc_6 >
BBCircVarArc; BBCircVarArc;
typedef std::vector<BBCircVarArc> typedef std::vector<BBCircVarArc>
BBCircVarContainer; BBCircVarContainer;
typedef CGAL::Arr_circular_line_arc_traits<BBCircularKernel, typedef CGAL::Arr_circular_line_arc_traits_2<BBCircularKernel> BBCircVariantTraits;
Line_arc_6,Circular_arc_6> BBCircVariantTraits;
// BBOX(LAZY) // BBOX(LAZY)
typedef CGAL::Filtered_bbox_circular_kernel_2<LazyCurvedK> typedef CGAL::Filtered_bbox_circular_kernel_2<LazyCurvedK>
BBLazyKernel ; BBLazyKernel ;
typedef CGAL::Arr_circular_arc_traits<BBLazyKernel> typedef CGAL::Arr_circular_arc_traits_2<BBLazyKernel>
BBLazyKernel_CA_Traits; BBLazyKernel_CA_Traits;
typedef BBLazyKernel::Circular_arc_2 typedef BBLazyKernel::Circular_arc_2
BBLazyKernelArc; BBLazyKernelArc;
@ -92,11 +92,10 @@ typedef boost::variant<Circular_arc_lazybb,Line_arc_lazybb >
BBLazyVarArc; BBLazyVarArc;
typedef std::vector<BBLazyVarArc> typedef std::vector<BBLazyVarArc>
BBLazyVarContainer; BBLazyVarContainer;
typedef CGAL::Arr_circular_line_arc_traits<BBLazyKernel, typedef CGAL::Arr_circular_line_arc_traits_2<BBLazyKernel> BBLazyVariantTraits;
Line_arc_lazybb,Circular_arc_lazybb> BBLazyVariantTraits;
template <class CK,class Traits,class ArcContainer> template <class CK,class Traits,class ArcContainer>
void do_main(char *s) { void do_main(const char *s) {
// TYPEDEFS // TYPEDEFS
typedef typename CK::Circular_arc_2 C2; typedef typename CK::Circular_arc_2 C2;
@ -120,7 +119,7 @@ void do_main(char *s) {
struct rusage before, after; struct rusage before, after;
struct timeval utime, stime; struct timeval utime, stime;
getrusage(RUSAGE_SELF,&before); getrusage(RUSAGE_SELF,&before);
insert_curves(_pm,ac.begin(),ac.end()); insert(_pm,ac.begin(),ac.end(),boost::false_type());
getrusage(RUSAGE_SELF,&after); getrusage(RUSAGE_SELF,&after);
timersub(&(after.ru_utime),&(before.ru_utime),&utime); timersub(&(after.ru_utime),&(before.ru_utime),&utime);
timersub(&(after.ru_stime),&(before.ru_stime),&stime); timersub(&(after.ru_stime),&(before.ru_stime),&stime);
@ -157,7 +156,7 @@ void do_main(int k) {
if(k == 0) { if(k == 0) {
for(cx = 0.0; cx <= 10.0; cx += 0.5) { for(cx = 0.0; cx <= 10.0; cx += 0.5) {
for(cy = 0.0; cy <= 10.0; cy += 0.5) { for(cy = 0.0; cy <= 10.0; cy += 0.5) {
ac.push_back(typename CK::Construct_circle_2()(Point_2(cx,cy),rft)); ac.push_back(typename CK::Circular_arc_2 ( typename CK::Circle_2(Point_2(cx,cy),rft) ) );
} }
} }
} }
@ -166,14 +165,14 @@ void do_main(int k) {
if(k == 1) { if(k == 1) {
for(cx = 0.0; cx <= 0.2; cx += 0.01) { for(cx = 0.0; cx <= 0.2; cx += 0.01) {
for(cy = 0.0; cy <= 0.2; cy += 0.01) { for(cy = 0.0; cy <= 0.2; cy += 0.01) {
ac.push_back(typename CK::Construct_circle_2()(Point_2(cx,cy),rft)); ac.push_back(typename CK::Circular_arc_2 ( typename CK::Circle_2(Point_2(cx,cy),rft) ));
} }
} }
} }
// ONE CIRCLE // ONE CIRCLE
if(k == 2) { if(k == 2) {
ac.push_back(typename CK::Construct_circle_2()(Point_2(0,0),5)); ac.push_back(typename CK::Circular_arc_2 ( typename CK::Circle_2(Point_2(0,0),5) ));
} }
// RANDOM CASE // RANDOM CASE
@ -185,7 +184,7 @@ void do_main(int k) {
double x = theRandom.get_double(0.0,1.0); double x = theRandom.get_double(0.0,1.0);
double y = theRandom.get_double(0.0,1.0); double y = theRandom.get_double(0.0,1.0);
double r = theRandom.get_double(0.00001,1.0); double r = theRandom.get_double(0.00001,1.0);
ac.push_back(typename CK::Construct_circle_2()(Point_2(x,y),FT(r))); ac.push_back(typename CK::Circular_arc_2 ( typename CK::Circle_2(Point_2(x,y),FT(r)) ));
} }
} }
@ -194,10 +193,10 @@ void do_main(int k) {
double h = (std::sqrt(3.0)+0.01); double h = (std::sqrt(3.0)+0.01);
for(cx = 0.0; cx <= 40.4; cx += 2.01) { for(cx = 0.0; cx <= 40.4; cx += 2.01) {
for(cy = h; cy <= h*20; cy += h*2) { for(cy = h; cy <= h*20; cy += h*2) {
ac.push_back(typename CK::Construct_circle_2()(Point_2(cx+1.0,cy),rft)); ac.push_back(typename CK::Circular_arc_2 ( typename CK::Circle_2(Point_2(cx+1.0,cy),rft) ));
} }
for(cy = 0.0; cy <= h*20.0; cy += h*2) { for(cy = 0.0; cy <= h*20.0; cy += h*2) {
ac.push_back(typename CK::Construct_circle_2()(Point_2(cx,cy),rft)); ac.push_back(typename CK::Circular_arc_2 ( typename CK::Circle_2(Point_2(cx,cy),rft)));
} }
} }
} }
@ -210,7 +209,7 @@ void do_main(int k) {
struct rusage before, after; struct rusage before, after;
struct timeval utime, stime; struct timeval utime, stime;
getrusage(RUSAGE_SELF,&before); getrusage(RUSAGE_SELF,&before);
insert_curves(_pm,ac.begin(),ac.end()); insert(_pm,ac.begin(),ac.end(),boost::false_type());
getrusage(RUSAGE_SELF,&after); getrusage(RUSAGE_SELF,&after);
timersub(&(after.ru_utime),&(before.ru_utime),&utime); timersub(&(after.ru_utime),&(before.ru_utime),&utime);
timersub(&(after.ru_stime),&(before.ru_stime),&stime); timersub(&(after.ru_stime),&(before.ru_stime),&stime);
@ -228,7 +227,7 @@ void do_main(int k) {
int main(int argc, char* argv[]){ int main(int argc, char* argv[]){
char* dxf_filename[] = { "DXF/51.dxf", const char* dxf_filename[] = { "DXF/51.dxf",
"DXF/cad_l1.dxf", "DXF/cad_l1.dxf",
"DXF/cad_l2.dxf", "DXF/cad_l2.dxf",
"DXF/che_mod1.dxf", "DXF/che_mod1.dxf",

View File

@ -18,18 +18,20 @@
#include <CGAL/intersections.h> #include <CGAL/intersections.h>
#include <CGAL/Circular_kernel_2.h> #include <CGAL/Circular_kernel_2.h>
#include <CGAL/Arr_circular_arc_traits.h> #include <CGAL/Arr_circular_arc_traits_2.h>
//#include <CGAL/Circular_arc_traits_tracer.h> //#include <CGAL/Circular_arc_traits_tracer.h>
#include <CGAL/Lazy_circular_kernel_2.h> #include <CGAL/Lazy_circular_kernel_2.h>
#ifdef CIRCULAR_KERNEL_2_FILTERED_HEXAGON
#include <CGAL/Filtered_hexagon_circular_kernel_2.h> #include <CGAL/Filtered_hexagon_circular_kernel_2.h>
#endif
#include <CGAL/Filtered_bbox_circular_kernel_2.h> #include <CGAL/Filtered_bbox_circular_kernel_2.h>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
#include <CGAL/Arr_naive_point_location.h> #include <CGAL/Arr_naive_point_location.h>
#include <CGAL/Arr_circular_line_arc_traits.h> #include <CGAL/Arr_circular_line_arc_traits_2.h>
#include <CGAL/Random.h> #include <CGAL/Random.h>
@ -39,9 +41,9 @@
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ //char* Dxffilename[]={"myFirst.dxf","cad_l1.dxf"}; { //char* Dxffilename[]={"myFirst.dxf","cad_l1.dxf"};
char* Dxffilename[]={"myFirst.dxf","minimask0.dxf","minimask1.dxf","mask0.dxf","mask1.dxf","smallpainttrack.dxf","mask0_25.dxf","mask0_5.dxf","cad_l2.dxf","cad_l1.dxf","CIOnZDraw.dxf","che_mod1.dxf","elekonta.dxf","painttrack.dxf","netlist_signal_1.dxf","51.dxf"}; const char* Dxffilename[]={"myFirst.dxf","minimask0.dxf","minimask1.dxf","mask0.dxf","mask1.dxf","smallpainttrack.dxf","mask0_25.dxf","mask0_5.dxf","cad_l2.dxf","cad_l1.dxf","CIOnZDraw.dxf","che_mod1.dxf","elekonta.dxf","painttrack.dxf","netlist_signal_1.dxf","51.dxf"};
char* Htmlfilename; std::string Htmlfilename;
char* Texfilename; std::string Texfilename;
char exten[4]; char exten[4];
int i; int i;
i=0; i=0;
@ -154,7 +156,7 @@ Bench bench; //If you want create table with all datasets you supose to use th
typedef CGAL::Circular_kernel_2<Linear_k1, Algebraic_k1> CircularKernel; typedef CGAL::Circular_kernel_2<Linear_k1, Algebraic_k1> CircularKernel;
// #ifndef CGAL_CURVED_KERNEL_DEBUG // #ifndef CGAL_CURVED_KERNEL_DEBUG
typedef CGAL::Arr_circular_arc_traits<CircularKernel> CircularK_CA_Traits; typedef CGAL::Arr_circular_arc_traits_2<CircularKernel> CircularK_CA_Traits;
// #else // #else
// typedef CGAL::Circular_arc_traits<CircularKernel> Traits0; // typedef CGAL::Circular_arc_traits<CircularKernel> Traits0;
// typedef CGAL::Circular_arc_traits_tracer<Traits0> CircularK_CA_Traits; // typedef CGAL::Circular_arc_traits_tracer<Traits0> CircularK_CA_Traits;
@ -169,7 +171,7 @@ Bench bench; //If you want create table with all datasets you supose to use th
typedef CircularKernel::Circular_arc_2 Circular_arc_2; typedef CircularKernel::Circular_arc_2 Circular_arc_2;
typedef CircularKernel::Line_arc_2 Line_arc_2; typedef CircularKernel::Line_arc_2 Line_arc_2;
typedef CGAL::Arr_circular_line_arc_traits<CircularKernel,Line_arc_2,Circular_arc_2> CircularK_Variant_Traits; typedef CGAL::Arr_circular_line_arc_traits_2<CircularKernel> CircularK_Variant_Traits;
typedef boost::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc; typedef boost::variant< Circular_arc_2, Line_arc_2 > CircularKVarArc;
typedef std::vector<CircularKVarArc> CircularKVarArcContainer; typedef std::vector<CircularKVarArc> CircularKVarArcContainer;
@ -203,7 +205,7 @@ bench.Compute_no_dxf<CircularKernel,CircularK_Variant_Traits,CircularKVarArcCont
typedef CGAL::Lazy_circular_kernel_2<CK2_,CK3_> LazyCurvedK; typedef CGAL::Lazy_circular_kernel_2<CK2_,CK3_> LazyCurvedK;
// #ifndef CGAL_CURVED_KERNEL_DEBUG // #ifndef CGAL_CURVED_KERNEL_DEBUG
typedef CGAL::Arr_circular_arc_traits<LazyCurvedK> LazyCurvedK_CA_Traits; typedef CGAL::Arr_circular_arc_traits_2<LazyCurvedK> LazyCurvedK_CA_Traits;
// #else // #else
// typedef CGAL::Circular_arc_traits<LazyCurved_k> Traits0_2; // typedef CGAL::Circular_arc_traits<LazyCurved_k> Traits0_2;
// typedef CGAL::Circular_arc_traits_tracer<Traits0_2> LazyCurved_kTraits; // typedef CGAL::Circular_arc_traits_tracer<Traits0_2> LazyCurved_kTraits;
@ -221,7 +223,7 @@ bench.Compute_no_dxf<CircularKernel,CircularK_Variant_Traits,CircularKVarArcCont
typedef LazyCurvedK::Line_arc_2 Line_arc_3; typedef LazyCurvedK::Line_arc_2 Line_arc_3;
typedef boost::variant<Circular_arc_3,Line_arc_3 > LazyVarArc; typedef boost::variant<Circular_arc_3,Line_arc_3 > LazyVarArc;
typedef std::vector<LazyVarArc> LazyVarContainer; typedef std::vector<LazyVarArc> LazyVarContainer;
typedef CGAL::Arr_circular_line_arc_traits<LazyCurvedK,Line_arc_3,Circular_arc_3> LazyCurvedK_Variant_Traits; typedef CGAL::Arr_circular_line_arc_traits_2<LazyCurvedK> LazyCurvedK_Variant_Traits;
bench.kernel("LazyKVar"); bench.kernel("LazyKVar");
@ -239,7 +241,7 @@ bench.Compute_no_dxf<CircularKernel,CircularK_Variant_Traits,CircularKVarArcCont
typedef CGAL::Filtered_hexagon_circular_kernel_2<CircularKernel> CircularKernelHexagon; typedef CGAL::Filtered_hexagon_circular_kernel_2<CircularKernel> CircularKernelHexagon;
// #ifndef CGAL_CURVED_KERNEL_DEBUG // #ifndef CGAL_CURVED_KERNEL_DEBUG
typedef CGAL::Arr_circular_arc_traits<CircularKernelHexagon> CircularKernHex_CA_Traits; typedef CGAL::Arr_circular_arc_traits_2<CircularKernelHexagon> CircularKernHex_CA_Traits;
// #else // #else
// typedef CGAL::Circular_arc_traits<CircularKernelHexagon> Traits0_3; // typedef CGAL::Circular_arc_traits<CircularKernelHexagon> Traits0_3;
// typedef CGAL::Circular_arc_traits_tracer<Traits0_3> CircularKernHex_CA_Traits; // typedef CGAL::Circular_arc_traits_tracer<Traits0_3> CircularKernHex_CA_Traits;
@ -256,7 +258,7 @@ bench.Compute_no_dxf<CircularKernel,CircularK_Variant_Traits,CircularKVarArcCont
typedef CircularKernelHexagon::Line_arc_2 Line_arc_4; typedef CircularKernelHexagon::Line_arc_2 Line_arc_4;
typedef boost::variant< Circular_arc_4, Line_arc_4 > CircularKernHexVarArc; typedef boost::variant< Circular_arc_4, Line_arc_4 > CircularKernHexVarArc;
typedef std::vector<CircularKernHexVarArc> CircularKernHexVarArcContainer; typedef std::vector<CircularKernHexVarArc> CircularKernHexVarArcContainer;
typedef CGAL::Arr_circular_line_arc_traits<CircularKernelHexagon,Circular_arc_4,Line_arc_4> CircularKernHex_Variant_Traits; typedef CGAL::Arr_circular_line_arc_traits_2<CircularKernelHexagon> CircularKernHex_Variant_Traits;
bench.kernel("CK Hex VarTraits"); bench.kernel("CK Hex VarTraits");
@ -275,7 +277,7 @@ bench.Compute_no_dxf<CircularKernel,CircularK_Variant_Traits,CircularKVarArcCont
typedef CGAL::Filtered_hexagon_circular_kernel_2<LazyCurvedK> LazyKernelHexagon; typedef CGAL::Filtered_hexagon_circular_kernel_2<LazyCurvedK> LazyKernelHexagon;
// #ifndef CGAL_CURVED_KERNEL_DEBUG // #ifndef CGAL_CURVED_KERNEL_DEBUG
typedef CGAL::Arr_circular_arc_traits<LazyKernelHexagon> LazyKernelHexagon_CA_Traits; typedef CGAL::Arr_circular_arc_traits_2<LazyKernelHexagon> LazyKernelHexagon_CA_Traits;
// #else // #else
// typedef CGAL::Circular_arc_traits<LazyKernelHexagon> Traits0_4; // typedef CGAL::Circular_arc_traits<LazyKernelHexagon> Traits0_4;
// typedef CGAL::Circular_arc_traits_tracer<Traits0_4> LazyKernelHexagon_CA_Traits; // typedef CGAL::Circular_arc_traits_tracer<Traits0_4> LazyKernelHexagon_CA_Traits;
@ -291,7 +293,7 @@ bench.Compute_no_dxf<CircularKernel,CircularK_Variant_Traits,CircularKVarArcCont
typedef LazyKernelHexagon::Line_arc_2 Line_arc_5; typedef LazyKernelHexagon::Line_arc_2 Line_arc_5;
typedef boost::variant<Circular_arc_5,Line_arc_5 > HxLazyVarArc; typedef boost::variant<Circular_arc_5,Line_arc_5 > HxLazyVarArc;
typedef std::vector<HxLazyVarArc> HxLazyVarContainer; typedef std::vector<HxLazyVarArc> HxLazyVarContainer;
typedef CGAL::Arr_circular_line_arc_traits<LazyKernelHexagon,Line_arc_5,Circular_arc_5> HxLazyVariantTraits; typedef CGAL::Arr_circular_line_arc_traits_2<LazyKernelHexagon> HxLazyVariantTraits;
bench.kernel("LazyK Hex VarTraits") ; bench.kernel("LazyK Hex VarTraits") ;
@ -308,7 +310,7 @@ bench.Compute_no_dxf<LazyKernelHexagon,HxLazyVariantTraits,HxLazyVarContainer>()
typedef CGAL::Filtered_bbox_circular_kernel_2<CircularKernel> BBCircularKernel ; typedef CGAL::Filtered_bbox_circular_kernel_2<CircularKernel> BBCircularKernel ;
// #ifndef CGAL_CURVED_KERNEL_DEBUG // #ifndef CGAL_CURVED_KERNEL_DEBUG
typedef CGAL::Arr_circular_arc_traits<BBCircularKernel> BBCircularKernel_CA_Traits; typedef CGAL::Arr_circular_arc_traits_2<BBCircularKernel> BBCircularKernel_CA_Traits;
// #else // #else
// typedef CGAL::Circular_arc_traits<BBCircularKernel> Traits0_5; // typedef CGAL::Circular_arc_traits<BBCircularKernel> Traits0_5;
// typedef CGAL::Circular_arc_traits_tracer<Traits0_5> BBCircularKernel_CA_Traits; // typedef CGAL::Circular_arc_traits_tracer<Traits0_5> BBCircularKernel_CA_Traits;
@ -323,7 +325,7 @@ bench.Compute_no_dxf<LazyKernelHexagon,HxLazyVariantTraits,HxLazyVarContainer>()
typedef BBCircularKernel::Line_arc_2 Line_arc_6; typedef BBCircularKernel::Line_arc_2 Line_arc_6;
typedef boost::variant<Circular_arc_6,Line_arc_6 > BBCircVarArc; typedef boost::variant<Circular_arc_6,Line_arc_6 > BBCircVarArc;
typedef std::vector<BBCircVarArc> BBCircVarContainer; typedef std::vector<BBCircVarArc> BBCircVarContainer;
typedef CGAL::Arr_circular_line_arc_traits<BBCircularKernel,Line_arc_6,Circular_arc_6> BBCircVariantTraits; typedef CGAL::Arr_circular_line_arc_traits_2<BBCircularKernel> BBCircVariantTraits;
bench.kernel("CK BBox VarTraits") ; bench.kernel("CK BBox VarTraits") ;
@ -340,7 +342,7 @@ bench.Compute_no_dxf<LazyKernelHexagon,HxLazyVariantTraits,HxLazyVarContainer>()
typedef CGAL::Filtered_bbox_circular_kernel_2<LazyCurvedK> BBLazyCurvedK; typedef CGAL::Filtered_bbox_circular_kernel_2<LazyCurvedK> BBLazyCurvedK;
// #ifndef CGAL_CURVED_KERNEL_DEBUG // #ifndef CGAL_CURVED_KERNEL_DEBUG
typedef CGAL::Arr_circular_arc_traits<BBLazyCurvedK> BBLazyCurvedK_CA_Traits; typedef CGAL::Arr_circular_arc_traits_2<BBLazyCurvedK> BBLazyCurvedK_CA_Traits;
// #else // #else
// typedef CGAL::Circular_arc_traits<BBLazyCurvedK> Traits0_6; // typedef CGAL::Circular_arc_traits<BBLazyCurvedK> Traits0_6;
// typedef CGAL::Circular_arc_traits_tracer<Traits0_6> BBLazyCurvedK_CA_Traits; // typedef CGAL::Circular_arc_traits_tracer<Traits0_6> BBLazyCurvedK_CA_Traits;
@ -357,7 +359,7 @@ bench.Compute_no_dxf<LazyKernelHexagon,HxLazyVariantTraits,HxLazyVarContainer>()
typedef BBLazyCurvedK::Line_arc_2 Line_arc_7; typedef BBLazyCurvedK::Line_arc_2 Line_arc_7;
typedef boost::variant<Circular_arc_7,Line_arc_7 > BBLazyVarArc; typedef boost::variant<Circular_arc_7,Line_arc_7 > BBLazyVarArc;
typedef std::vector< BBLazyVarArc> BBLazyVarContainer; typedef std::vector< BBLazyVarArc> BBLazyVarContainer;
typedef CGAL::Arr_circular_line_arc_traits<BBLazyCurvedK,Line_arc_7,Circular_arc_7> BBLazyVariantTraits; typedef CGAL::Arr_circular_line_arc_traits_2<BBLazyCurvedK> BBLazyVariantTraits;
bench.kernel("LLazyK BBox VarTraits") ; bench.kernel("LLazyK BBox VarTraits") ;

View File

@ -208,7 +208,7 @@ class Bench
typedef typename CGAL::Arrangement_2<Traits> Pmwx; typedef typename CGAL::Arrangement_2<Traits> Pmwx;
typedef typename CGAL::Arr_naive_point_location<Pmwx> Point_location; typedef typename CGAL::Arr_naive_point_location<Pmwx> Point_location;
std::cout << "memory size before construction" << mem_sizer.virtual_size() << std::endl; std::cout << "memory size before construction" << mem_sizer.virtual_size() << std::endl;
std::cout << "memory resident size before insert_curves()" << mem_sizer.resident_size () << std::endl; std::cout << "memory resident size before insert()" << mem_sizer.resident_size () << std::endl;
Pmwx _pm; Pmwx _pm;
Point_location _pl(_pm); Point_location _pl(_pm);
@ -217,7 +217,7 @@ class Bench
this->start(); this->start();
for (typename ArcContainer::const_iterator it=ac.begin(); for (typename ArcContainer::const_iterator it=ac.begin();
it != ac.end(); ++it) { it != ac.end(); ++it) {
insert_curve(_pm,*it,_pl); insert(_pm,*it,_pl,boost::false_type());
}; };
this->stop(); this->stop();
} }
@ -234,8 +234,8 @@ class Bench
if (!fail){this->summarize(_pm.number_of_vertices(),_pm.number_of_halfedges());} if (!fail){this->summarize(_pm.number_of_vertices(),_pm.number_of_halfedges());}
_pm.clear(); _pm.clear();
std::cout << "memory size after insert_curves()" << mem_sizer.virtual_size () << std::endl; std::cout << "memory size after insert()" << mem_sizer.virtual_size () << std::endl;
std::cout << "memory resident size after insert_curves()" << mem_sizer.resident_size () << std::endl; std::cout << "memory resident size after insert()" << mem_sizer.resident_size () << std::endl;
} }

View File

@ -1,66 +0,0 @@
# Created by the script cgal_create_makefile
# This is the makefile for compiling a CGAL application.
#---------------------------------------------------------------------#
# include platform specific settings
#---------------------------------------------------------------------#
# Choose the right include file from the <cgalroot>/make directory.
# CGAL_MAKEFILE = ENTER_YOUR_INCLUDE_MAKEFILE_HERE
#-DNDEBUG \
#-O2 -fprofile-arcs -ftest-coverage \
#-DCGAL_PROFILE \
#-g
include $(CGAL_MAKEFILE)
#---------------------------------------------------------------------#
# compiler flags
#---------------------------------------------------------------------#
CXXFLAGS = \
-DNDEBUG \
-O2 \
-I../include \
$(TESTSUITE_CXXFLAGS) \
$(EXTRA_FLAGS) \
$(CGAL_CXXFLAGS) \
$(LONG_NAME_PROBLEM_CXXFLAGS)
#---------------------------------------------------------------------#
# linker flags
#---------------------------------------------------------------------#
LIBPATH = \
$(CGAL_LIBPATH)
LDFLAGS = \
$(LONG_NAME_PROBLEM_LDFLAGS) \
$(CGAL_LDFLAGS)
#---------------------------------------------------------------------#
# target entries
#---------------------------------------------------------------------#
all: \
benchmark_CK2$(EXE_EXT)\
benchmarks_arrangement$(EXE_EXT)
benchmarks_arrangement$(EXE_EXT): benchmarks_arrangement$(OBJ_EXT)
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)benchmarks_arrangement benchmarks_arrangement$(OBJ_EXT) $(LDFLAGS)
benchmark_CK2$(EXE_EXT): benchmark_CK2$(OBJ_EXT)
$(CGAL_CXX) $(LIBPATH) $(EXE_OPT)benchmark_CK2 benchmark_CK2$(OBJ_EXT) $(LDFLAGS)
clean: \
benchmarks_arrangement.clean\
benchmark_CK2.clean
#---------------------------------------------------------------------#
# suffix rules
#---------------------------------------------------------------------#
.cpp$(OBJ_EXT):
$(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $<

View File

@ -93,7 +93,13 @@ struct Circular_kernel_2
>, >,
Circular_kernel_2<LinearKernel,AlgebraicKernel> Circular_kernel_2<LinearKernel,AlgebraicKernel>
> >
{}; {
// for Lazy hexagons/bbox kernels
// Please remove this if you consider it to be sloppy
struct Circular_tag{};
typedef Circular_tag Definition_tag;
//
};
} //namespace CGAL } //namespace CGAL

View File

@ -63,8 +63,8 @@ template <class CK>
typedef typename CK::Compare_x_2 Compare_x_2; typedef typename CK::Compare_x_2 Compare_x_2;
typedef typename CK::Compare_y_2 Compare_y_2; typedef typename CK::Compare_y_2 Compare_y_2;
typedef typename CK::Compare_xy_2 Compare_xy_2; typedef typename CK::Compare_xy_2 Compare_xy_2;
typedef typename CK::Compute_Circular_x_2 Compute_Circular_x_2; typedef typename CK::Compute_circular_x_2 Compute_circular_x_2;
typedef typename CK::Compute_Circular_y_2 Compute_Circular_y_2; typedef typename CK::Compute_circular_y_2 Compute_circular_y_2;
typedef Hexagon_functors::Construct_circular_source_vertex_2<Self> Construct_circular_source_vertex_2; typedef Hexagon_functors::Construct_circular_source_vertex_2<Self> Construct_circular_source_vertex_2;
typedef Hexagon_functors::Construct_circular_target_vertex_2<Self> Construct_circular_target_vertex_2; typedef Hexagon_functors::Construct_circular_target_vertex_2<Self> Construct_circular_target_vertex_2;
typedef Hexagon_functors::Construct_circular_min_vertex_2<Self> Construct_circular_min_vertex_2; typedef Hexagon_functors::Construct_circular_min_vertex_2<Self> Construct_circular_min_vertex_2;

View File

@ -166,10 +166,6 @@ public:
Lazy_make_x_monotone_2 <Kernel,typename AK::C, typename EK::C>, \ Lazy_make_x_monotone_2 <Kernel,typename AK::C, typename EK::C>, \
typename boost::mpl::if_<boost::is_same<typename AK::C, typename AK::Make_xy_monotone_2>, \ typename boost::mpl::if_<boost::is_same<typename AK::C, typename AK::Make_xy_monotone_2>, \
Lazy_make_x_monotone_2 <Kernel,typename AK::C, typename EK::C>, \ Lazy_make_x_monotone_2 <Kernel,typename AK::C, typename EK::C>, \
typename boost::mpl::if_<boost::is_same<typename AK::C, typename AK::Advanced_make_x_monotone_2>, \
Lazy_advanced_make_x_monotone_2 <Kernel,typename AK::C, typename EK::C>, \
typename boost::mpl::if_<boost::is_same<typename AK::C, typename AK::Advanced_make_xy_monotone_2>, \
Lazy_advanced_make_x_monotone_2 <Kernel,typename AK::C, typename EK::C>, \
typename boost::mpl::if_<boost::is_same<typename AK::C, typename AK::Split_2>, \ typename boost::mpl::if_<boost::is_same<typename AK::C, typename AK::Split_2>, \
Lazy_functor_2_2 <Kernel, typename AK::C, typename EK::C>, \ Lazy_functor_2_2 <Kernel, typename AK::C, typename EK::C>, \
typename boost::mpl::if_<boost::is_same<typename AK::C::result_type, Bbox_2>, \ typename boost::mpl::if_<boost::is_same<typename AK::C::result_type, Bbox_2>, \
@ -178,7 +174,7 @@ public:
Lazy_construction_nt<Kernel,typename AK::C, typename EK::C>,\ Lazy_construction_nt<Kernel,typename AK::C, typename EK::C>,\
typename boost::mpl::if_<boost::is_same<typename AK::C::result_type, Object >,\ typename boost::mpl::if_<boost::is_same<typename AK::C::result_type, Object >,\
Lazy_construction_object<Kernel,typename AK::C, typename EK::C>,\ Lazy_construction_object<Kernel,typename AK::C, typename EK::C>,\
Lazy_construction<Kernel,typename AK::C, typename EK::C> >::type >::type >::type >::type >::type >::type >::type >::type >::type C; \ Lazy_construction<Kernel,typename AK::C, typename EK::C> >::type >::type >::type >::type >::type >::type >::type C; \
C Cf() const { return C(); } C Cf() const { return C(); }

View File

@ -47,17 +47,17 @@ make_lazy_CK(const Object& eto)
object_cast<std::pair<typename EK::Circular_arc_point_2, object_cast<std::pair<typename EK::Circular_arc_point_2,
unsigned > >(&eto))){ unsigned > >(&eto))){
return make_object(std::make_pair(typename LK::Circular_arc_point_2( return make_object(std::make_pair(typename LK::Circular_arc_point_2(
new Lazy_construct_rep_0<typename AK::Circular_arc_point_2, new Lazy_rep_0<typename AK::Circular_arc_point_2,
typename EK::Circular_arc_point_2, E2A>(ptr->first)),ptr->second)); typename EK::Circular_arc_point_2, E2A>(ptr->first)),ptr->second));
} else if(const typename EK::Circular_arc_2* ptr = } else if(const typename EK::Circular_arc_2* ptr =
object_cast<typename EK::Circular_arc_2>(&eto)){ object_cast<typename EK::Circular_arc_2>(&eto)){
return make_object(typename LK::Circular_arc_2( return make_object(typename LK::Circular_arc_2(
new Lazy_construct_rep_0<typename AK::Circular_arc_2, new Lazy_rep_0<typename AK::Circular_arc_2,
typename EK::Circular_arc_2, E2A>(*ptr))); typename EK::Circular_arc_2, E2A>(*ptr)));
} else if(const typename EK::Line_arc_2* ptr = } else if(const typename EK::Line_arc_2* ptr =
object_cast<typename EK::Line_arc_2>(&eto)){ object_cast<typename EK::Line_arc_2>(&eto)){
return make_object(typename LK::Line_arc_2( return make_object(typename LK::Line_arc_2(
new Lazy_construct_rep_0<typename AK::Line_arc_2, new Lazy_rep_0<typename AK::Line_arc_2,
typename EK::Line_arc_2, E2A>(*ptr))); typename EK::Line_arc_2, E2A>(*ptr)));
} else{ } else{
std::cerr << "object_cast inside Lazy_construction_rep::operator() failed. It needs more else if's" << std::endl; std::cerr << "object_cast inside Lazy_construction_rep::operator() failed. It needs more else if's" << std::endl;
@ -94,7 +94,7 @@ public:
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
try { try {
Protect_FPU_rounding<Protection> P; Protect_FPU_rounding<Protection> P;
Lazy_vector lv(new Lazy_construct_rep_with_vector_2<AC, EC, E2A, L1, L2>(ac, ec, l1, l2)); Lazy_vector lv(new Lazy_rep_with_vector_2<AC, EC, E2A, L1, L2>(ac, ec, l1, l2));
for(unsigned int i = 0; i < lv.approx().size(); i++){ for(unsigned int i = 0; i < lv.approx().size(); i++){
@ -103,21 +103,21 @@ public:
if((temp_p=object_cast<std::pair<typename AK::Circular_arc_point_2, if((temp_p=object_cast<std::pair<typename AK::Circular_arc_point_2,
unsigned > >(& (lv.approx()[i])))){ unsigned > >(& (lv.approx()[i])))){
*it = make_object(std::make_pair(typename LK::Circular_arc_point_2( *it = make_object(std::make_pair(typename LK::Circular_arc_point_2(
new Lazy_construct_rep_1<Ith<typename AK::Circular_arc_point_2>, new Lazy_rep_1<Ith<typename AK::Circular_arc_point_2>,
Ith<typename EK::Circular_arc_point_2>, E2A, Ith<typename EK::Circular_arc_point_2>, E2A,
Lazy_vector>(Ith<typename AK::Circular_arc_point_2>(i,false), Lazy_vector>(Ith<typename AK::Circular_arc_point_2>(i,false),
Ith<typename EK::Circular_arc_point_2>(i,false), lv)),temp_p->second)); Ith<typename EK::Circular_arc_point_2>(i,false), lv)),temp_p->second));
++it; ++it;
} else if(object_cast<typename AK::Circular_arc_2>(& (lv.approx()[i]))){ } else if(object_cast<typename AK::Circular_arc_2>(& (lv.approx()[i]))){
*it = make_object(typename LK::Circular_arc_2( *it = make_object(typename LK::Circular_arc_2(
new Lazy_construct_rep_1<Ith<typename AK::Circular_arc_2>, new Lazy_rep_1<Ith<typename AK::Circular_arc_2>,
Ith<typename EK::Circular_arc_2>,E2A, Ith<typename EK::Circular_arc_2>,E2A,
Lazy_vector>(Ith<typename AK::Circular_arc_2>(i), Lazy_vector>(Ith<typename AK::Circular_arc_2>(i),
Ith<typename EK::Circular_arc_2>(i), lv))); Ith<typename EK::Circular_arc_2>(i), lv)));
++it; ++it;
} else if(object_cast<typename AK::Line_arc_2>(& (lv.approx()[i]))){ } else if(object_cast<typename AK::Line_arc_2>(& (lv.approx()[i]))){
*it = make_object(typename LK::Line_arc_2( *it = make_object(typename LK::Line_arc_2(
new Lazy_construct_rep_1<Ith<typename AK::Line_arc_2>, new Lazy_rep_1<Ith<typename AK::Line_arc_2>,
Ith<typename EK::Line_arc_2>,E2A, Ith<typename EK::Line_arc_2>,E2A,
Lazy_vector>(Ith<typename AK::Line_arc_2>(i), Lazy_vector>(Ith<typename AK::Line_arc_2>(i),
Ith<typename EK::Line_arc_2>(i), lv))); Ith<typename EK::Line_arc_2>(i), lv)));
@ -172,20 +172,20 @@ public:
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
try { try {
Protect_FPU_rounding<Protection> P; Protect_FPU_rounding<Protection> P;
Lazy_vector lv(new Lazy_construct_rep_with_vector_1<AC, EC, E2A, L1>(ac, ec, l1)); Lazy_vector lv(new Lazy_rep_with_vector_1<AC, EC, E2A, L1>(ac, ec, l1));
// lv.approx() is a std::vector<Object([AK::Point_2,AK::Segment_2])> // lv.approx() is a std::vector<Object([AK::Point_2,AK::Segment_2])>
// that is, when we get here we have constructed all approximate results // that is, when we get here we have constructed all approximate results
for(unsigned int i = 0; i < lv.approx().size(); i++){ for(unsigned int i = 0; i < lv.approx().size(); i++){
if(object_cast<typename AK::Circular_arc_2>(& (lv.approx()[i]))){ if(object_cast<typename AK::Circular_arc_2>(& (lv.approx()[i]))){
*it = make_object(typename LK::Circular_arc_2( *it = make_object(typename LK::Circular_arc_2(
new Lazy_construct_rep_1<Ith<typename AK::Circular_arc_2>, new Lazy_rep_1<Ith<typename AK::Circular_arc_2>,
Ith<typename EK::Circular_arc_2>,E2A, Ith<typename EK::Circular_arc_2>,E2A,
Lazy_vector>(Ith<typename AK::Circular_arc_2>(i), Lazy_vector>(Ith<typename AK::Circular_arc_2>(i),
Ith<typename EK::Circular_arc_2>(i), lv))); Ith<typename EK::Circular_arc_2>(i), lv)));
++it; ++it;
} else if(object_cast<typename AK::Line_arc_2>(& (lv.approx()[i]))){ } else if(object_cast<typename AK::Line_arc_2>(& (lv.approx()[i]))){
*it = make_object(typename LK::Line_arc_2( *it = make_object(typename LK::Line_arc_2(
new Lazy_construct_rep_1<Ith<typename AK::Line_arc_2>, new Lazy_rep_1<Ith<typename AK::Line_arc_2>,
Ith<typename EK::Line_arc_2>,E2A, Ith<typename EK::Line_arc_2>,E2A,
Lazy_vector>(Ith<typename AK::Line_arc_2>(i), Lazy_vector>(Ith<typename AK::Line_arc_2>(i),
Ith<typename EK::Line_arc_2>(i), lv))); Ith<typename EK::Line_arc_2>(i), lv)));
@ -240,20 +240,20 @@ public:
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
try { try {
Protect_FPU_rounding<Protection> P; Protect_FPU_rounding<Protection> P;
Lazy_vector lv(new Lazy_construct_rep_with_vector_1<AC, EC, E2A, L1>(ac, ec, l1)); Lazy_vector lv(new Lazy_rep_with_vector_1<AC, EC, E2A, L1>(ac, ec, l1));
// lv.approx() is a std::vector<Object([AK::Point_2,AK::Segment_2])> // lv.approx() is a std::vector<Object([AK::Point_2,AK::Segment_2])>
// that is, when we get here we have constructed all approximate results // that is, when we get here we have constructed all approximate results
for(unsigned int i = 0; i < lv.approx().size(); i++){ for(unsigned int i = 0; i < lv.approx().size(); i++){
if(object_cast<typename AK::Circular_arc_2>(& (lv.approx()[i].first))){ if(object_cast<typename AK::Circular_arc_2>(& (lv.approx()[i].first))){
*it = std::make_pair(make_object(typename LK::Circular_arc_2( *it = std::make_pair(make_object(typename LK::Circular_arc_2(
new Lazy_construct_rep_1<Ith<typename AK::Circular_arc_2>, new Lazy_rep_1<Ith<typename AK::Circular_arc_2>,
Ith<typename EK::Circular_arc_2>,E2A, Ith<typename EK::Circular_arc_2>,E2A,
Lazy_vector>(Ith<typename AK::Circular_arc_2>(i), Lazy_vector>(Ith<typename AK::Circular_arc_2>(i),
Ith<typename EK::Circular_arc_2>(i), lv))),lv.approx()[i].second); Ith<typename EK::Circular_arc_2>(i), lv))),lv.approx()[i].second);
++it; ++it;
} else if(object_cast<typename AK::Line_arc_2>(& (lv.approx()[i].first))){ } else if(object_cast<typename AK::Line_arc_2>(& (lv.approx()[i].first))){
*it = std::make_pair(make_object(typename LK::Line_arc_2( *it = std::make_pair(make_object(typename LK::Line_arc_2(
new Lazy_construct_rep_1<Ith<typename AK::Line_arc_2>, new Lazy_rep_1<Ith<typename AK::Line_arc_2>,
Ith<typename EK::Line_arc_2>,E2A, Ith<typename EK::Line_arc_2>,E2A,
Lazy_vector>(Ith<typename AK::Line_arc_2>(i), Lazy_vector>(Ith<typename AK::Line_arc_2>(i),
Ith<typename EK::Line_arc_2>(i), lv))),lv.approx()[i].second); Ith<typename EK::Line_arc_2>(i), lv))),lv.approx()[i].second);
@ -315,30 +315,30 @@ template <typename L1>
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
try { try {
Protect_FPU_rounding<Protection> P; Protect_FPU_rounding<Protection> P;
Lazy_object lo(new Lazy_construct_rep_1<AC, EC, E2A, L1>(ac, ec, l1)); Lazy_object lo(new Lazy_rep_1<AC, EC, E2A, L1>(ac, ec, l1));
std::pair<typename AK::Circular_arc_point_2, unsigned> *temp_p; std::pair<typename AK::Circular_arc_point_2, unsigned> *temp_p;
if((temp_p=object_cast<std::pair<typename AK::Circular_arc_point_2, unsigned > >(& (lo.approx())))){ if((temp_p=object_cast<std::pair<typename AK::Circular_arc_point_2, unsigned > >(& (lo.approx())))){
typedef Lazy_construct_rep_1<Object_cast<typename AK::Circular_arc_point_2>, typedef Lazy_rep_1<Object_cast<typename AK::Circular_arc_point_2>,
Object_cast<typename EK::Circular_arc_point_2>, E2A, Lazy_object> Lcr; Object_cast<typename EK::Circular_arc_point_2>, E2A, Lazy_object> Lcr;
Lcr * lcr = new Lcr(Object_cast<typename AK::Circular_arc_point_2>(), Lcr * lcr = new Lcr(Object_cast<typename AK::Circular_arc_point_2>(),
Object_cast<typename EK::Circular_arc_point_2>(), lo); Object_cast<typename EK::Circular_arc_point_2>(), lo);
return make_object(std::make_pair(typename LK::Circular_arc_point_2(lcr),temp_p->second)); return make_object(std::make_pair(typename LK::Circular_arc_point_2(lcr),temp_p->second));
} else if(object_cast<typename AK::Circular_arc_point_2>(& (lo.approx()))){ } else if(object_cast<typename AK::Circular_arc_point_2>(& (lo.approx()))){
typedef Lazy_construct_rep_1<Object_cast<typename AK::Circular_arc_point_2>, typedef Lazy_rep_1<Object_cast<typename AK::Circular_arc_point_2>,
Object_cast<typename EK::Circular_arc_point_2>, E2A, Lazy_object> Lcr; Object_cast<typename EK::Circular_arc_point_2>, E2A, Lazy_object> Lcr;
Lcr * lcr = new Lcr(Object_cast<typename AK::Circular_arc_point_2>(), Lcr * lcr = new Lcr(Object_cast<typename AK::Circular_arc_point_2>(),
Object_cast<typename EK::Circular_arc_point_2>(), lo); Object_cast<typename EK::Circular_arc_point_2>(), lo);
return make_object(typename LK::Circular_arc_point_2(lcr)); return make_object(typename LK::Circular_arc_point_2(lcr));
} else if(object_cast<typename AK::Circular_arc_2>(& (lo.approx()))){ } else if(object_cast<typename AK::Circular_arc_2>(& (lo.approx()))){
typedef Lazy_construct_rep_1<Object_cast<typename AK::Circular_arc_2>, typedef Lazy_rep_1<Object_cast<typename AK::Circular_arc_2>,
Object_cast<typename EK::Circular_arc_2>, E2A, Lazy_object> Lcr; Object_cast<typename EK::Circular_arc_2>, E2A, Lazy_object> Lcr;
Lcr * lcr = new Lcr(Object_cast<typename AK::Circular_arc_2>(), Lcr * lcr = new Lcr(Object_cast<typename AK::Circular_arc_2>(),
Object_cast<typename EK::Circular_arc_2>(), lo); Object_cast<typename EK::Circular_arc_2>(), lo);
return make_object(typename LK::Circular_arc_2(lcr));} return make_object(typename LK::Circular_arc_2(lcr));}
else if(object_cast<typename AK::Line_arc_2>(& (lo.approx()))){ else if(object_cast<typename AK::Line_arc_2>(& (lo.approx()))){
typedef Lazy_construct_rep_1<Object_cast<typename AK::Line_arc_2>, typedef Lazy_rep_1<Object_cast<typename AK::Line_arc_2>,
Object_cast<typename EK::Line_arc_2>, E2A, Lazy_object> Lcr; Object_cast<typename EK::Line_arc_2>, E2A, Lazy_object> Lcr;
Lcr * lcr = new Lcr(Object_cast<typename AK::Line_arc_2>(), Lcr * lcr = new Lcr(Object_cast<typename AK::Line_arc_2>(),
Object_cast<typename EK::Line_arc_2>(), lo); Object_cast<typename EK::Line_arc_2>(), lo);
@ -364,31 +364,31 @@ template <typename L1>
CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
try { try {
Protect_FPU_rounding<Protection> P; Protect_FPU_rounding<Protection> P;
Lazy_object lo(new Lazy_construct_rep_2<AC, EC, E2A, L1, L2>(ac, ec, l1, l2)); Lazy_object lo(new Lazy_rep_2<AC, EC, E2A, L1, L2>(ac, ec, l1, l2));
std::pair<typename AK::Circular_arc_point_2, unsigned> *temp_p; std::pair<typename AK::Circular_arc_point_2, unsigned> *temp_p;
if((temp_p=object_cast<std::pair<typename AK::Circular_arc_point_2, unsigned > >(& (lo.approx())))){ if((temp_p=object_cast<std::pair<typename AK::Circular_arc_point_2, unsigned > >(& (lo.approx())))){
typedef Lazy_construct_rep_1<Object_cast<typename AK::Circular_arc_point_2>, typedef Lazy_rep_1<Object_cast<typename AK::Circular_arc_point_2>,
Object_cast<typename EK::Circular_arc_point_2>, E2A, Lazy_object> Lcr; Object_cast<typename EK::Circular_arc_point_2>, E2A, Lazy_object> Lcr;
Lcr * lcr = new Lcr(Object_cast<typename AK::Circular_arc_point_2>(), Lcr * lcr = new Lcr(Object_cast<typename AK::Circular_arc_point_2>(),
Object_cast<typename EK::Circular_arc_point_2>(), lo); Object_cast<typename EK::Circular_arc_point_2>(), lo);
return make_object(std::make_pair(typename LK::Circular_arc_point_2(lcr),temp_p->second)); return make_object(std::make_pair(typename LK::Circular_arc_point_2(lcr),temp_p->second));
} else if(object_cast<typename AK::Circular_arc_point_2>(& (lo.approx()))){ } else if(object_cast<typename AK::Circular_arc_point_2>(& (lo.approx()))){
typedef Lazy_construct_rep_1<Object_cast<typename AK::Circular_arc_point_2>, typedef Lazy_rep_1<Object_cast<typename AK::Circular_arc_point_2>,
Object_cast<typename EK::Circular_arc_point_2>, E2A, Lazy_object> Lcr; Object_cast<typename EK::Circular_arc_point_2>, E2A, Lazy_object> Lcr;
Lcr * lcr = new Lcr(Object_cast<typename AK::Circular_arc_point_2>(), Lcr * lcr = new Lcr(Object_cast<typename AK::Circular_arc_point_2>(),
Object_cast<typename EK::Circular_arc_point_2>(), lo); Object_cast<typename EK::Circular_arc_point_2>(), lo);
return make_object(typename LK::Circular_arc_point_2(lcr)); return make_object(typename LK::Circular_arc_point_2(lcr));
} else if(object_cast<typename AK::Circular_arc_2>(& (lo.approx()))){ } else if(object_cast<typename AK::Circular_arc_2>(& (lo.approx()))){
typedef Lazy_construct_rep_1<Object_cast<typename AK::Circular_arc_2>, typedef Lazy_rep_1<Object_cast<typename AK::Circular_arc_2>,
Object_cast<typename EK::Circular_arc_2>, E2A, Lazy_object> Lcr; Object_cast<typename EK::Circular_arc_2>, E2A, Lazy_object> Lcr;
Lcr * lcr = new Lcr(Object_cast<typename AK::Circular_arc_2>(), Lcr * lcr = new Lcr(Object_cast<typename AK::Circular_arc_2>(),
Object_cast<typename EK::Circular_arc_2>(), lo); Object_cast<typename EK::Circular_arc_2>(), lo);
return make_object(typename LK::Circular_arc_2(lcr));} return make_object(typename LK::Circular_arc_2(lcr));}
else if(object_cast<typename AK::Line_arc_2>(& (lo.approx()))){ else if(object_cast<typename AK::Line_arc_2>(& (lo.approx()))){
typedef Lazy_construct_rep_1<Object_cast<typename AK::Line_arc_2>, typedef Lazy_rep_1<Object_cast<typename AK::Line_arc_2>,
Object_cast<typename EK::Line_arc_2>, E2A, Lazy_object> Lcr; Object_cast<typename EK::Line_arc_2>, E2A, Lazy_object> Lcr;
Lcr * lcr = new Lcr(Object_cast<typename AK::Line_arc_2>(), Lcr * lcr = new Lcr(Object_cast<typename AK::Line_arc_2>(),
Object_cast<typename EK::Line_arc_2>(), lo); Object_cast<typename EK::Line_arc_2>(), lo);

View File

@ -90,7 +90,13 @@ struct Circular_kernel_2
>, >,
Circular_kernel_2<LinearKernel,AlgebraicKernel> Circular_kernel_2<LinearKernel,AlgebraicKernel>
> >
{}; {
// for Lazy hexagons/bbox kernels
// Please remove this if you consider it to be sloppy
struct Circular_tag{};
typedef Circular_tag Definition_tag;
//
};
} //namespace CGAL } //namespace CGAL