change name of mpz_practical_prime to mpz_likely_prime

This commit is contained in:
jasonmoxham 2009-09-07 15:49:49 +00:00
parent 01b88f04be
commit fac12816e5
10 changed files with 129 additions and 129 deletions

View File

@ -171,7 +171,7 @@ MPZ_OBJECTS = mpz/abs$U.lo mpz/add$U.lo mpz/add_ui$U.lo \
mpz/fits_ulong$U.lo mpz/fits_ushort$U.lo mpz/gcd$U.lo \
mpz/gcd_ui$U.lo mpz/gcdext$U.lo mpz/get_d$U.lo mpz/get_d_2exp$U.lo \
mpz/get_si$U.lo mpz/get_str$U.lo mpz/get_ui$U.lo mpz/getlimbn$U.lo \
mpz/hamdist$U.lo mpz/practical_prime_p$U.lo mpz/probable_prime_p$U.lo \
mpz/hamdist$U.lo mpz/likely_prime_p$U.lo mpz/probable_prime_p$U.lo \
mpz/import$U.lo mpz/init$U.lo mpz/init2$U.lo mpz/inp_raw$U.lo \
mpz/inp_str$U.lo mpz/invert$U.lo \
mpz/ior$U.lo mpz/iset$U.lo mpz/iset_d$U.lo mpz/iset_si$U.lo \

View File

@ -128,7 +128,7 @@ am__DEPENDENCIES_2 = mpz/abs$U.lo mpz/add$U.lo mpz/add_ui$U.lo \
mpz/fits_ushort$U.lo mpz/gcd$U.lo mpz/gcd_ui$U.lo \
mpz/gcdext$U.lo mpz/get_d$U.lo mpz/get_d_2exp$U.lo \
mpz/get_si$U.lo mpz/get_str$U.lo mpz/get_ui$U.lo \
mpz/getlimbn$U.lo mpz/hamdist$U.lo mpz/practical_prime_p$U.lo \
mpz/getlimbn$U.lo mpz/hamdist$U.lo mpz/likely_prime_p$U.lo \
mpz/probable_prime_p$U.lo mpz/import$U.lo mpz/init$U.lo \
mpz/init2$U.lo mpz/inp_raw$U.lo mpz/inp_str$U.lo \
mpz/invert$U.lo mpz/ior$U.lo mpz/iset$U.lo mpz/iset_d$U.lo \
@ -557,7 +557,7 @@ MPZ_OBJECTS = mpz/abs$U.lo mpz/add$U.lo mpz/add_ui$U.lo \
mpz/fits_ulong$U.lo mpz/fits_ushort$U.lo mpz/gcd$U.lo \
mpz/gcd_ui$U.lo mpz/gcdext$U.lo mpz/get_d$U.lo mpz/get_d_2exp$U.lo \
mpz/get_si$U.lo mpz/get_str$U.lo mpz/get_ui$U.lo mpz/getlimbn$U.lo \
mpz/hamdist$U.lo mpz/practical_prime_p$U.lo mpz/probable_prime_p$U.lo \
mpz/hamdist$U.lo mpz/likely_prime_p$U.lo mpz/probable_prime_p$U.lo \
mpz/import$U.lo mpz/init$U.lo mpz/init2$U.lo mpz/inp_raw$U.lo \
mpz/inp_str$U.lo mpz/invert$U.lo \
mpz/ior$U.lo mpz/iset$U.lo mpz/iset_d$U.lo mpz/iset_si$U.lo \

View File

@ -24,7 +24,7 @@ END-INFO-DIR-ENTRY

Indirect:
mpir.info-1: 990
mpir.info-2: 300547
mpir.info-2: 300536

Tag Table:
(Indirect)
@ -65,110 +65,110 @@ Node: Integer Division97714
Node: Integer Exponentiation104143
Node: Integer Roots105005
Node: Number Theoretic Functions106832
Node: Integer Comparisons114984
Node: Integer Logic and Bit Fiddling116363
Node: I/O of Integers118977
Node: Integer Random Numbers121592
Node: Integer Import and Export123368
Node: Miscellaneous Integer Functions127373
Node: Integer Special Functions129234
Node: Rational Number Functions132405
Node: Initializing Rationals133600
Node: Rational Conversions135846
Node: Rational Arithmetic137578
Node: Comparing Rationals138915
Node: Applying Integer Functions140283
Node: I/O of Rationals141767
Node: Floating-point Functions143630
Node: Initializing Floats146518
Node: Assigning Floats150216
Node: Simultaneous Float Init & Assign152784
Node: Converting Floats154314
Node: Float Arithmetic157275
Node: Float Comparison159321
Node: I/O of Floats160673
Node: Miscellaneous Float Functions162999
Node: Low-level Functions164900
Node: Random Number Functions185339
Node: Random State Initialization186409
Node: Random State Seeding188472
Node: Random State Miscellaneous189862
Node: Formatted Output190504
Node: Formatted Output Strings190750
Node: Formatted Output Functions195990
Node: C++ Formatted Output200067
Node: Formatted Input202754
Node: Formatted Input Strings202991
Node: Formatted Input Functions207653
Node: C++ Formatted Input210626
Node: C++ Class Interface212534
Node: C++ Interface General213539
Node: C++ Interface Integers216622
Node: C++ Interface Rationals220056
Node: C++ Interface Floats223735
Node: C++ Interface Random Numbers229030
Node: C++ Interface Limitations231160
Node: BSD Compatible Functions234006
Node: Custom Allocation234224
Node: Language Bindings238416
Node: Algorithms242432
Node: Multiplication Algorithms243137
Node: Basecase Multiplication244072
Node: Karatsuba Multiplication245984
Node: Toom 3-Way Multiplication249614
Node: FFT Multiplication256023
Node: Other Multiplication261361
Node: Division Algorithms263847
Node: Single Limb Division264195
Node: Basecase Division267115
Node: Divide and Conquer Division268319
Node: Exact Division270557
Node: Exact Remainder273725
Node: Small Quotient Division276018
Node: Greatest Common Divisor Algorithms277617
Node: Binary GCD277891
Node: Accelerated GCD280570
Node: Extended GCD282369
Node: Jacobi Symbol284040
Node: Powering Algorithms284957
Node: Normal Powering Algorithm285221
Node: Modular Powering Algorithm285750
Node: Root Extraction Algorithms286814
Node: Square Root Algorithm287130
Node: Nth Root Algorithm289273
Node: Perfect Square Algorithm290059
Node: Perfect Power Algorithm292146
Node: Radix Conversion Algorithms292768
Node: Binary to Radix293145
Node: Radix to Binary297076
Node: Other Algorithms299008
Node: Prime Testing Algorithm299362
Node: Factorial Algorithm300547
Node: Binomial Coefficients Algorithm301951
Node: Fibonacci Numbers Algorithm302846
Node: Lucas Numbers Algorithm305322
Node: Random Number Algorithms306044
Node: Assembler Coding308168
Node: Assembler Code Organisation309145
Node: Assembler Basics310118
Node: Assembler Carry Propagation311277
Node: Assembler Cache Handling313115
Node: Assembler Functional Units315283
Node: Assembler Floating Point316904
Node: Assembler SIMD Instructions320687
Node: Assembler Software Pipelining321676
Node: Assembler Loop Unrolling322744
Node: Assembler Writing Guide324964
Node: Internals327734
Node: Integer Internals328248
Node: Rational Internals330505
Node: Float Internals331745
Node: Raw Output Internals339073
Node: C++ Interface Internals340268
Node: Contributors343567
Node: References348501
Node: GNU Free Documentation License353557
Node: Concept Index376004
Node: Function Index422002
Node: Integer Comparisons114973
Node: Integer Logic and Bit Fiddling116352
Node: I/O of Integers118966
Node: Integer Random Numbers121581
Node: Integer Import and Export123357
Node: Miscellaneous Integer Functions127362
Node: Integer Special Functions129223
Node: Rational Number Functions132394
Node: Initializing Rationals133589
Node: Rational Conversions135835
Node: Rational Arithmetic137567
Node: Comparing Rationals138904
Node: Applying Integer Functions140272
Node: I/O of Rationals141756
Node: Floating-point Functions143619
Node: Initializing Floats146507
Node: Assigning Floats150205
Node: Simultaneous Float Init & Assign152773
Node: Converting Floats154303
Node: Float Arithmetic157264
Node: Float Comparison159310
Node: I/O of Floats160662
Node: Miscellaneous Float Functions162988
Node: Low-level Functions164889
Node: Random Number Functions185328
Node: Random State Initialization186398
Node: Random State Seeding188461
Node: Random State Miscellaneous189851
Node: Formatted Output190493
Node: Formatted Output Strings190739
Node: Formatted Output Functions195979
Node: C++ Formatted Output200056
Node: Formatted Input202743
Node: Formatted Input Strings202980
Node: Formatted Input Functions207642
Node: C++ Formatted Input210615
Node: C++ Class Interface212523
Node: C++ Interface General213528
Node: C++ Interface Integers216611
Node: C++ Interface Rationals220045
Node: C++ Interface Floats223724
Node: C++ Interface Random Numbers229019
Node: C++ Interface Limitations231149
Node: BSD Compatible Functions233995
Node: Custom Allocation234213
Node: Language Bindings238405
Node: Algorithms242421
Node: Multiplication Algorithms243126
Node: Basecase Multiplication244061
Node: Karatsuba Multiplication245973
Node: Toom 3-Way Multiplication249603
Node: FFT Multiplication256012
Node: Other Multiplication261350
Node: Division Algorithms263836
Node: Single Limb Division264184
Node: Basecase Division267104
Node: Divide and Conquer Division268308
Node: Exact Division270546
Node: Exact Remainder273714
Node: Small Quotient Division276007
Node: Greatest Common Divisor Algorithms277606
Node: Binary GCD277880
Node: Accelerated GCD280559
Node: Extended GCD282358
Node: Jacobi Symbol284029
Node: Powering Algorithms284946
Node: Normal Powering Algorithm285210
Node: Modular Powering Algorithm285739
Node: Root Extraction Algorithms286803
Node: Square Root Algorithm287119
Node: Nth Root Algorithm289262
Node: Perfect Square Algorithm290048
Node: Perfect Power Algorithm292135
Node: Radix Conversion Algorithms292757
Node: Binary to Radix293134
Node: Radix to Binary297065
Node: Other Algorithms298997
Node: Prime Testing Algorithm299351
Node: Factorial Algorithm300536
Node: Binomial Coefficients Algorithm301940
Node: Fibonacci Numbers Algorithm302835
Node: Lucas Numbers Algorithm305311
Node: Random Number Algorithms306033
Node: Assembler Coding308157
Node: Assembler Code Organisation309134
Node: Assembler Basics310107
Node: Assembler Carry Propagation311266
Node: Assembler Cache Handling313104
Node: Assembler Functional Units315272
Node: Assembler Floating Point316893
Node: Assembler SIMD Instructions320676
Node: Assembler Software Pipelining321665
Node: Assembler Loop Unrolling322733
Node: Assembler Writing Guide324953
Node: Internals327723
Node: Integer Internals328237
Node: Rational Internals330494
Node: Float Internals331734
Node: Raw Output Internals339062
Node: C++ Interface Internals340257
Node: Contributors343556
Node: References348490
Node: GNU Free Documentation License353546
Node: Concept Index375993
Node: Function Index421991

End Tag Table

View File

@ -2587,15 +2587,15 @@ File: mpir.info, Node: Number Theoretic Functions, Next: Integer Comparisons,
*This function interface is preliminary and may change in the
future.*
-- Function: int mpz_practical_prime_p (mpz_t N, gmp_randstate_t
STATE, unsigned long DIV)
Determine whether N is practically a prime , ie you can consider
it a prime for practical purposies. return true if N can be
considered prime , or return 0 if N is definitely composite.
-- Function: int mpz_likely_prime_p (mpz_t N, gmp_randstate_t STATE,
unsigned long DIV)
Determine whether N is likely a prime , ie you can consider it a
prime for practical purposies. return true if N can be considered
prime , or return 0 if N is definitely composite.
This function does some trial divisions to speed up the average
case , then some probabilistic primality tests.Practical in the
sense of this function means for "Factoring".
case , then some probabilistic primality tests.Likely in the sense
of this function means for "Factoring".
DIV can be used to inform the function that trial division up to
DIV has allready been performed on N and so N has NO divisors <=

View File

@ -2867,6 +2867,8 @@ Function and Type Index
(line 105)
* mpz_legendre: Number Theoretic Functions.
(line 119)
* mpz_likely_prime_p: Number Theoretic Functions.
(line 25)
* mpz_lucnum2_ui: Number Theoretic Functions.
(line 170)
* mpz_lucnum_ui: Number Theoretic Functions.
@ -2897,8 +2899,6 @@ Function and Type Index
(line 8)
* mpz_powm_ui: Integer Exponentiation.
(line 10)
* mpz_practical_prime_p: Number Theoretic Functions.
(line 25)
* mpz_probab_prime_p: Number Theoretic Functions.
(line 41)
* mpz_probable_prime_p: Number Theoretic Functions.

View File

@ -3423,15 +3423,15 @@ allready been performed on @var{n} and so @var{n} has NO divisors <= @var{div}
@strong{This function interface is preliminary and may change in the future.}
@end deftypefun
@deftypefun int mpz_practical_prime_p (mpz_t @var{n}, gmp_randstate_t @var{state}, unsigned long @var{div})
@deftypefun int mpz_likely_prime_p (mpz_t @var{n}, gmp_randstate_t @var{state}, unsigned long @var{div})
@cindex Prime testing functions
@cindex Probable prime testing functions
Determine whether @var{n} is practically a prime , ie you can consider it a prime for practical purposies.
Determine whether @var{n} is likely a prime , ie you can consider it a prime for practical purposies.
return true if @var{n} can be considered prime , or return 0 if
@var{n} is definitely composite.
This function does some trial divisions to speed up the average case , then some probabilistic
primality tests.Practical in the sense of this function means for "Factoring".
primality tests.Likely in the sense of this function means for "Factoring".
@var{div} can be used to inform the function that trial division up to @var{div} has
allready been performed on @var{n} and so @var{n} has NO divisors <= @var{div}

View File

@ -1034,8 +1034,8 @@ __GMP_DECLSPEC int mpz_probab_prime_p __GMP_PROTO ((mpz_srcptr, int)) __GMP_ATTR
#define mpz_probable_prime_p __gmpz_probable_prime_p
__GMP_DECLSPEC int mpz_probable_prime_p __GMP_PROTO ((mpz_srcptr,gmp_randstate_t, int,unsigned long));
#define mpz_practical_prime_p __gmpz_practical_prime_p
__GMP_DECLSPEC int mpz_practical_prime_p __GMP_PROTO ((mpz_srcptr,gmp_randstate_t, unsigned long));
#define mpz_likely_prime_p __gmpz_likely_prime_p
__GMP_DECLSPEC int mpz_likely_prime_p __GMP_PROTO ((mpz_srcptr,gmp_randstate_t, unsigned long));
#define mpz_realloc2 __gmpz_realloc2
__GMP_DECLSPEC void mpz_realloc2 __GMP_PROTO ((mpz_ptr, unsigned long));

View File

@ -45,7 +45,7 @@ libmpz_la_SOURCES = aors.h aors_ui.h fits_s.h mul_i.h \
invert.c ior.c iset.c iset_d.c iset_si.c iset_str.c iset_ui.c \
jacobi.c kronsz.c kronuz.c kronzs.c kronzu.c \
lcm.c lcm_ui.c lucnum_ui.c lucnum2_ui.c millerrabin.c nextprobprime.c \
practical_prime_p.c probable_prime_p.c \
likely_prime_p.c probable_prime_p.c \
mod.c mul.c mul_2exp.c mul_si.c mul_ui.c n_pow_ui.c neg.c nextprime.c \
out_raw.c out_str.c perfpow.c perfsqr.c popcount.c pow_ui.c powm.c \
powm_ui.c pprime_p.c nthroot.c \

View File

@ -85,7 +85,7 @@ am_libmpz_la_OBJECTS = add.lo add_ui.lo abs.lo aorsmul.lo aorsmul_i.lo \
iset_d.lo iset_si.lo iset_str.lo iset_ui.lo jacobi.lo \
kronsz.lo kronuz.lo kronzs.lo kronzu.lo lcm.lo lcm_ui.lo \
lucnum_ui.lo lucnum2_ui.lo millerrabin.lo nextprobprime.lo \
practical_prime_p.lo probable_prime_p.lo mod.lo mul.lo \
likely_prime_p.lo probable_prime_p.lo mod.lo mul.lo \
mul_2exp.lo mul_si.lo mul_ui.lo n_pow_ui.lo neg.lo \
nextprime.lo out_raw.lo out_str.lo perfpow.lo perfsqr.lo \
popcount.lo pow_ui.lo powm.lo powm_ui.lo pprime_p.lo \
@ -288,7 +288,7 @@ libmpz_la_SOURCES = aors.h aors_ui.h fits_s.h mul_i.h \
invert.c ior.c iset.c iset_d.c iset_si.c iset_str.c iset_ui.c \
jacobi.c kronsz.c kronuz.c kronzs.c kronzu.c \
lcm.c lcm_ui.c lucnum_ui.c lucnum2_ui.c millerrabin.c nextprobprime.c \
practical_prime_p.c probable_prime_p.c \
likely_prime_p.c probable_prime_p.c \
mod.c mul.c mul_2exp.c mul_si.c mul_ui.c n_pow_ui.c neg.c nextprime.c \
out_raw.c out_str.c perfpow.c perfsqr.c popcount.c pow_ui.c powm.c \
powm_ui.c pprime_p.c nthroot.c \

View File

@ -22,13 +22,13 @@ Boston, MA 02110-1301, USA.
#include "mpir.h"
#include "gmp-impl.h"
// could have another parameter to specify what practical means
// could have another parameter to specify what likely means
// ie for factoring , for RSA
// or to state that we have allready done trial div
// could call it mpz_practical_composite_p then when true we could return more info about it , ie a factor
// could call it mpz_likely_composite_p then when true we could return more info about it , ie a factor
int
mpz_practical_prime_p (mpz_srcptr N, gmp_randstate_t STATE, unsigned long td)
mpz_likely_prime_p (mpz_srcptr N, gmp_randstate_t STATE, unsigned long td)
{
int d, t, r;
mpz_t base, nm1, x, e, n;