2009-08-17 05:03:35 -04:00
|
|
|
/* mpz_nextprime(x,y) - compute the next probable prime > y and store that in x
|
2008-06-25 03:33:36 -04:00
|
|
|
|
2009-08-17 05:03:35 -04:00
|
|
|
Copyright 2009 Jason Moxham
|
2008-06-25 03:33:36 -04:00
|
|
|
|
2009-08-17 05:03:35 -04:00
|
|
|
This file is part of the MPIR Library.
|
2008-06-25 03:33:36 -04:00
|
|
|
|
2009-08-17 05:03:35 -04:00
|
|
|
The MPIR Library is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as published
|
|
|
|
by the Free Software Foundation; either version 2.1 of the License, or (at
|
|
|
|
your option) any later version.
|
2008-06-25 03:33:36 -04:00
|
|
|
|
2009-08-17 05:03:35 -04:00
|
|
|
The MPIR Library is distributed in the hope that it will be useful, but
|
2008-06-25 03:33:36 -04:00
|
|
|
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
|
|
License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License
|
2009-08-17 05:03:35 -04:00
|
|
|
along with the MPIR Library; see the file COPYING.LIB. If not, write
|
|
|
|
to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
2008-06-25 03:33:36 -04:00
|
|
|
|
2009-02-12 05:24:24 -05:00
|
|
|
#include "mpir.h"
|
2008-06-25 03:33:36 -04:00
|
|
|
#include "gmp-impl.h"
|
|
|
|
|
2009-08-17 07:53:22 -04:00
|
|
|
|
|
|
|
// This function is Obsolete 17/8/2009
|
2009-08-17 05:03:35 -04:00
|
|
|
void mpz_nextprime(mpz_ptr x,mpz_srcptr y)
|
|
|
|
{gmp_randstate_t rnd;
|
2008-06-25 03:33:36 -04:00
|
|
|
|
2009-08-17 05:03:35 -04:00
|
|
|
gmp_randinit_default(rnd);
|
2009-09-07 15:56:58 -04:00
|
|
|
mpz_next_likely_prime(x,y,rnd);
|
2009-08-17 05:03:35 -04:00
|
|
|
gmp_randclear(rnd);
|
|
|
|
return;}
|