Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

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


Chronological Thread 
  • From: Marc Glisse <>
  • To:
  • Subject: Re: [cgal-discuss] Measuring byte size of structures that use Lazy_exact_nt
  • Date: Mon, 23 May 2011 15:05:10 +0200 (CEST)

On Mon, 23 May 2011, Costas Tsirogiannis wrote:

 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?

There is an undocumented (so don't rely on it) but public method is_lazy().

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 would need to walk the whole tree for that, which is not easily done. If your program has mostly just this structure in memory, your best bet is to ask your implementation how much memory it has allocated (see mallinfo with glibc).

--
Marc Glisse



Archive powered by MHonArc 2.6.16.

Top of Page