Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Measuring byte size of structures that use Lazy_exact_nt

Subject: CGAL users discussion list

List archive

[cgal-discuss] Measuring byte size of structures that use Lazy_exact_nt


Chronological Thread 
  • From: Costas Tsirogiannis <>
  • To:
  • Subject: [cgal-discuss] Measuring byte size of structures that use Lazy_exact_nt
  • Date: Mon, 23 May 2011 14:45:06 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=t4s1SCmMXvABnWbTrHta4+2K8FVNBT8acktWvczKcxpnTsEAB78c5qWFDhDrH8sh0Y vmXnBCnMMpYkjI08rnF/VAZo1WlyGeI9srqeqnNVqJtO/yYEszaFEALMMRi5HYDM3Ta6 BYy0j1Fo0+X3ZVUHE/QEWnJARdEOfUe9Pe9Ks=


 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?     




Archive powered by MHonArc 2.6.16.

Top of Page