On 03/23/2017 03:59 PM, mauriciojz wrote:

> Occasionally I have to calculate the sum of a large set of rational numbers.

> The problem is that I use /Lazy_exact_nt<CGAL::Gmpq>/, which sometimes

> results in a /segfault/ due to the number of stored operations. Is there a

> nicer way to force the lazy number type to dump these stored operations

> besides calling a ".exact()" every now and then? Is it more interesting to

> just use /CGAL::Gmpq/ while performing the sum and then construct its lazy

> version in the end?

>

It depends what you want to do. What do you want to do with your some of

rational. If at the end you need the exact value, then you should

definitely directly use Gmpq. Each operation with Lazy_exact_nt is

constructing a node in the dag. Calling exact() is the only way to

reduce the size of the dag. We can think of a more elaborate strategy

but again it depends on what your needs.

Sebastien.

> Thank you.

>

>

>

> --

> View this message in context:

http://cgal-discuss.949826.n4.nabble.com/Summing-a-large-set-of-Lazy-exact-nt-CGAL-Gmpq-numbers-tp4662600.html> Sent from the cgal-discuss mailing list archive at Nabble.com.

>

--

You are currently subscribed to cgal-discuss.

To unsubscribe or access the archives, go to

https://sympa.inria.fr/sympa/info/cgal-discuss