bug-gmp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gmp] enhancement request


From: bhinkle4
Subject: Re: [Bug-gmp] enhancement request
Date: Sat, 9 Sep 2000 21:11:53 -0400

Hi Kevin,

> Or just change "mp_ptr _mp_d" to "mp_limb_t _mp_d[1]", though not 
> with
> just one limb of space there of course but however many are actually
> needed.  Much of the code might work with just a recompilation.

I don't want to fix the precision at compile time, so unfortunately this
is not an option.

> I'm not sure I can see what would be gained in a new style like 
> that.

Basically, it's easier to keep track of one chunk of memory than two.
The biggest gain is when you are dealing with matrices or vectors of
floats, since then you can allocate the entire matrix at once and not
have to deal with lots of allocations as you initialize the elements of
the matrix. Note this pre-allocation technique would require a routine to
get the memory footprint of an entire mpf object of a given precision
(not hard, but also not available in the current gmp).
For now I've made some small additions to the mpf library to get this
functionality. I can email these changes to bug-gmp if this is the right
place for it. The change is just one source file.

-Ben

ps - I should say that I'm a MathWorks employee (the makers of Matlab),
though right now this is just a personal project. I used gmp2.0.2 in grad
school and loved it and I'm really glad to see it moving again.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]