Jeroen Demeyer on Tue, 28 Sep 2004 14:16:15 +0200

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

Re: storing primes found by factor.

On Mon, Sep 27, 2004 at 04:31:50PM +0200, Bill Allombert wrote:
> Hello PARI-dev,
> Here a patch that add a new default, factor_add_primes 
> (turned on by default) that make factorint to automatically call
> addprimes on primes factor found larger than 2^24.  
> In particular if you stop a factorisation you can get the factors
> already found using addprimes(), and they will be automatically
> reused if you restart it.
> As for the code, some one more familiar with the ifac machinery should
> check that it is working properly, namely it should never addprimes()
> factors that are not (BSW pseudo-)primes. I hope the '!(hint & 8)'
> achieve that goal.


This is certainly not a bad idea, but isn't there the risk that it will
fill up the stack after hours of computations, possibly involving a lot
of factorizations?
Maybe you should bound the memory taken by such added primes, maybe the
default factor_add_primes could be the size in bytes of all these
primes.  Shouldn't be too hard too implement, except that these primes
are perhaps stored in between the manually added primes?