Subject: CGAL users discussion list
List archive
- From: gereon <>
- To:
- Subject: [cgal-discuss] CGAL::to_double incredibly slow (using CORE)
- Date: Wed, 7 Dec 2011 03:50:50 -0800 (PST)
Hi,
I'm using cgal to calculate some intersections of Segments in 2d using the
kernel CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt on a
64bit linux (ubuntu 11.10). cgal is installed via the repository
(libcgal7-dev, version 3.8-1).
As I wanted to do some normalization of vectors, I had to use CGAL::sqrt and
therefore use CORE.
Now, the code is incredibly slow for some inputs. Take this code, TRACEOUT
being a simple macro outputting the code and the current time.
TRACEOUT("+ GCode::printRatio")
CDouble c = this->printed / this->moved;
cerr << "number is " << c << endl;
// c = 5.34;
TRACEOUT("~ GCode::printRatio::division")
double r = CGAL::to_double(c);
TRACEOUT("- GCode::printRatio")
printed and moved are of type CDouble, the typedef for FT. The division in
line 2 is instantaneously. the output in line 3 is weird: "number is" shows
up immediately, output of c takes several seconds.
Conversion to double takes several seconds as well, but is immediate if c is
set to 5.34 before.
Depending on the input, the runtime of the whole code varies from under half
a second to more than two minutes. Both inputs are however similar with
regard to their complexity (botch polygons with max. 10 lines).
I'm quite new to cgal (this is my first project with cgal) and I have no
idea why this happens. I hope somebody can give me a hint...
Thanks,
Gereon
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/CGAL-to-double-incredibly-slow-using-CORE-tp4168676p4168676.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] CGAL::to_double incredibly slow (using CORE), gereon, 12/07/2011
- Re: [cgal-discuss] CGAL::to_double incredibly slow (using CORE), Sebastien Loriot (GeometryFactory), 12/08/2011
- Re: [cgal-discuss] CGAL::to_double incredibly slow (using CORE), Gereon Kremer, 12/08/2011
- Re: [cgal-discuss] CGAL::to_double incredibly slow (using CORE), Sebastien Loriot (GeometryFactory), 12/08/2011
Archive powered by MHonArc 2.6.16.