gmp prime testing
Torbjorn Granlund
tege@swox.com
04 Nov 2002 15:27:46 +0100
Jason Moxham <J.L.Moxham@maths.soton.ac.uk> writes:
> > Currently gmp has prime tables to 1000 , which takes 168*2 bytes , prime
> > table to 65536 would take 13K , prime difference to 65536 would take 6.4K
> > . if this is too much
>
> Don't know. I'm hoping Torbjorn will make that decision. :-)
yes
I have code that adds primes tables up to 65536 for GMP 4.2, just not
yet checked in.
> > construct_and_use_prime_table(global_prime_table_pointer,limits);
>
> PARI does something like that, it's nice and flexible for
> applications.
>
> > you would call this at a "thread safe time"
>
> Yes, we don't want to get intimate with the thread manager.
>
> > ul mpz_trial_div(mpz_srcptr N , ul start , ul stop)
>
> Sounds fair to me, if Torbjorn likes it.
Might make sense. What is it supposed to return?
Any factor, or 1 (or 0?) if no factor is found.
Not that we wouldn't want to guarantee prime factors,
we might want to accumulate several factors and then use gcd
to find out if they divide N.
--
Torbjörn