John Cremona on Wed, 17 Sep 2014 15:52:52 +0200


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

Re: Detecting whether PARI has been initialized


Bill, that is *not* helpful.  The solution we propose is to have a
global variable, set to 0 on startup (automatically), set to 1 in
pari_init() and to 0 in pari_close().

If eclib (which includes mwrank) is broken by a change in pthe pari
library, I will have to eliminate the dependency (which I only use for
integer factorization anyway at present) and use FLINT instead.

John

On 17 September 2014 14:43, Bill Allombert
<Bill.Allombert@math.u-bordeaux.fr> wrote:
> On Wed, Sep 17, 2014 at 02:09:24PM +0200, Jeroen Demeyer wrote:
>> Dear pari-dev,
>>
>> what is the recommended way to detect whether or not pari_init() has
>> already been called? This is useful for libraries which might
>> interact which other libraries which have initialized PARI.
>
> I would say it is not recommended.
>
>> John Cremona's eclib for example does
>>
>>   if (!bot) {
>>     pari_init(1000000, 1000000);
>>   }
>>
>> which doesn't work anymore with the latest master.
>
> It did not work before either: if
> the user did
> pari_init()
> ...
> pari_close()
> before calling eclib,
> the test would fail.
>
> The only reason the test seemed worked is that unitialized global variables like
> bot are initialized by 0 by the runtime.
>
> Cheers,
> Bill.
>