[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: |
10 Sep 2000 07:04:49 +1000 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) Emacs/20.5 |
Benjamin V Hinkle <address@hidden> writes:
>
> I'm working on a wrapper for mpf for MATLAB, and I'm finding myself
> writing a layer on top of mpf that makes mpf objects more "position
> independent". By position independent I mean that the float occupies one
> continuous chunk of memory and you can copy that memory and have another
> legal float object (ie - the layer manages the internal pointers). This
> way a float behaves more like a double than the current mpf object.
>
> It's actually very simple to do this. The most obvious way is to put the
> limbs (_mp_limbs, say) right after the header structure and, when it
> needs to create a legal mpf object, sets the limb pointer _mp_d to
> &_mp_limbs. It's also easy to change the mpf routines to just take
> &_mp_limbs to get a pointer to the limbs instead of using _mp_d.
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'm wondering if anyone is working on such an mpf datatype and
> corresponding routines. If not then I'd like to work on it myself (if
> there is interest). Then I can get back to my original project of writing
> the MATLAB wrapper.
I'm not sure I can see what would be gained in a new style like that.
Is it to fit the inner workings of matlab somehow, ie. that it needs
to be copyable on a stack or something? If there's a lot of such
copying due to call-by-value semantics or whatever it could negatively
affect performance.