[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gmp] enhancement request
From: |
Kevin Ryde |
Subject: |
Re: [Bug-gmp] enhancement request |
Date: |
12 Sep 2000 09:09:07 +1000 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) Emacs/20.5 |
address@hidden writes:
>
> > 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 was thinking of a size determined at runtime and put in _mp_prec
etc, just a declaration like that meaning the limbs are to be found
inline there. A new init would be needed of course.
> 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).
Would something like mpz_array_init suit? mpf_t's initialized that
way couldn't have their precision changed later, but would otherwise
be fully functional I think.