Subject: CGAL users discussion list
List archive
- From: Andreas Fabri <>
- To:
- Subject: Re: [cgal-discuss] Measuring byte size of structures that use Lazy_exact_nt
- Date: Mon, 23 May 2011 15:08:58 +0200
- Organization: GeometryFactory
On 23/05/2011 14:45, Costas Tsirogiannis wrote:
Greetings,
Suppose that one uses CGAL::Lazy_exact_nt<CGAL::Gmpq> as a number type
for some algorithm.
If one asks for the byte size of an object of this class, then what is
returned is a constant which is equal to the minimum number of bytes
that are needed to represent a Gmpq object + the size of the fixed
precision part of the number type.
On the other hand, If one asks for the PRECISE byte size of the exact
part + the approximate part of the lazy_exact number type if he uses a
function like this:
int byte_size( NT a)
{ return sizeof(CGAL::Lazy_exact_nt<CGAL::Gmpq>) -
sizeof(CGAL::Gmpq)+a.exact().size(); } (That I learned from a previous
question here, thanks :) )
But, in fact, the "exact().size()" function forces the exact part of
the object to be computed even if algebraic filtering was sufficient to
avoid this computation so far. Thus, then we get an overestimation of
what is computed by the algorithm. It's like a "schrodinger"
phenomenon: to read the byte-size, you have to force the computation of
the exact part.
Is there a way then to detect for a lazy_exact_nt object if the exact
part is not computed so far? In other words, given a geometric structure
whose coordinates are represented with this number type, can one
measure the number of bytes which are used for the structure's
representation, no more, no less?
You don't ask for the size of the representation. You ask for the size
of the representation with GMP.
When you have the GMP 1/3 you also only want to know that it takes 2 limbs, and not infinitely many characters if you write it as a string.
andreas
--
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project
phone: +33.492.954.912 skype: andreas.fabri
- [cgal-discuss] Measuring byte size of structures that use Lazy_exact_nt, Costas Tsirogiannis, 05/23/2011
- Re: [cgal-discuss] Measuring byte size of structures that use Lazy_exact_nt, Marc Glisse, 05/23/2011
- Re: [cgal-discuss] Measuring byte size of structures that use Lazy_exact_nt, Andreas Fabri, 05/23/2011
- Re: [cgal-discuss] Measuring byte size of structures that use Lazy_exact_nt, Costas Tsirogiannis, 05/23/2011
Archive powered by MHonArc 2.6.16.