diff options
author | Linus Nordberg <linus@nordberg.se> | 1999-05-20 17:01:27 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 1999-05-20 17:01:27 +0200 |
commit | 1c6cad664feb7f196941b4e7c1c813cbfd265b58 (patch) | |
tree | cc06ed608dbf1c64adaee3cd03672372dbdd78d5 | |
parent | 7b05db5728122c820c2065cb654bb7fc961d2a29 (diff) | |
download | gmp-1c6cad664feb7f196941b4e7c1c813cbfd265b58.tar.gz |
Add _ui variants of random funcs.
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | Makefile.in | 15 | ||||
-rw-r--r-- | gmp-impl.h | 9 | ||||
-rw-r--r-- | gmp.h | 10 | ||||
-rwxr-xr-x | make.bat | 3 | ||||
-rw-r--r-- | rand.c | 5 | ||||
-rw-r--r-- | randclr.c | 2 | ||||
-rw-r--r-- | randcm.c | 3 | ||||
-rw-r--r-- | randlc.c | 3 |
9 files changed, 47 insertions, 14 deletions
@@ -1,8 +1,17 @@ 1999-05-20 Linus Nordberg <linus@swox.se> * Makefile.in: Rename randi.c --> rand.c, randi_lc.c --> randlc.c, - randicom.c --> randcm.c. + randicom.c --> randcm.c. Add randui.c, randcmui.c, randlcui.c. * make.bat: Ditto. + + * gmp.h: Add prototypes for gmp_rand_init_ui() and + gmp_rand_init_lc_ui(). + + * gmp-impl.h: Add prototypes for __gmp_rand_init_common() and + __gmp_rand_init_common_ui(). + + * randlc.c, randcm.c, randclr.c, rand.c: Change #include of + <gmp.h> to "gmp.h". 1999-05-12 Torbjorn Granlund <tege@swox.com> diff --git a/Makefile.in b/Makefile.in index 1d6d61659..c24346719 100644 --- a/Makefile.in +++ b/Makefile.in @@ -47,12 +47,12 @@ LN = ln -s #### host and target specific makefile fragments come in here. ### -SRCS = memory.c mp_set_fns.c mp_clz_tab.c rand.c randclr.c randcm.c \ - randlc.c version.c stack-alloc.c mp_bpl.c extract-dbl.c \ - insert-dbl.c -OBJS = memory.o mp_set_fns.o mp_clz_tab.o rand.o randclr.o randcm.o \ - randlc.o version.o stack-alloc.o mp_bpl.o extract-dbl.o \ - insert-dbl.o +SRCS = memory.c mp_set_fns.c mp_clz_tab.c rand.c randui.c randclr.c randcm.c \ + randcmui.c randlc.c randlcui.c version.c stack-alloc.c mp_bpl.c \ + extract-dbl.c insert-dbl.c +OBJS = memory.o mp_set_fns.o mp_clz_tab.o rand.o randui.o randclr.o randcm.o \ + randcmui.o randlc.o randlcui.o version.o stack-alloc.o mp_bpl.o \ + extract-dbl.o insert-dbl.o FILES = gmp.h mp.h gmp-impl.h longlong.h urandom.h move-if-change \ mkinstalldirs INSTALL COPYING.LIB ChangeLog Makefile.in \ NEWS README SPEED TODO config.guess config.sub configure configure.in \ @@ -205,9 +205,12 @@ mp_bpl.o: $(srcdir)/mp_bpl.c mp_clz_tab.o: $(srcdir)/mp_clz_tab.c mp_set_fns.o: $(srcdir)/mp_set_fns.c $(H) rand.o: $(srcdir)/rand.c $(H) +randui.o: $(srcdir)/randui.c $(H) randclr.o: $(srcdir)/randclr.c $(H) randcm.o: $(srcdir)/randcm.c $(H) +randcmui.o: $(srcdir)/randcmui.c $(H) randlc.o: $(srcdir)/randlc.c $(H) +randlcui.o: $(srcdir)/randlcui.c $(H) stack-alloc.o: $(srcdir)/stack-alloc.c $(srcdir)/stack-alloc.h version.o: $(srcdir)/version.c diff --git a/gmp-impl.h b/gmp-impl.h index 8bac22e8f..4c815d3d2 100644 --- a/gmp-impl.h +++ b/gmp-impl.h @@ -448,6 +448,15 @@ void __gmpn_sqr_basecase _PROTO ((mp_ptr, mp_srcptr, mp_size_t)); void __gmpn_mul_n _PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_ptr)); void __gmpn_sqr _PROTO ((mp_ptr, mp_srcptr, mp_size_t, mp_ptr)); +void __gmp_rand_init_common _PROTO ((gmp_rand_state *s, + gmp_rand_algorithm alg, + unsigned long int size, + mpz_t seed)); +void __gmp_rand_init_common_ui _PROTO ((gmp_rand_state *s, + gmp_rand_algorithm alg, + unsigned long int size, + unsigned long int seed)); + extern int __gmp_junk; extern const int __gmp_0; #define DIVIDE_BY_ZERO (__gmp_junk = 10/__gmp_0) @@ -209,12 +209,22 @@ int gmp_rand_init _PROTO ((gmp_rand_state *s, gmp_rand_algorithm alg, unsigned long int size, mpz_t seed)); +int gmp_rand_init_ui _PROTO ((gmp_rand_state *s, + gmp_rand_algorithm alg, + unsigned long int size, + unsigned long int seed)); void gmp_rand_init_lc _PROTO ((gmp_rand_state *s, unsigned long int size, mpz_t seed, mpz_t a, unsigned long int c, mpz_t m)); +void gmp_rand_init_lc_ui _PROTO ((gmp_rand_state *s, + unsigned long int size, + unsigned long int seed, + unsigned long int a, + unsigned long int c, + unsigned long int m)); void gmp_rand_clear _PROTO ((gmp_rand_state *s)); /**************** Integer (i.e. Z) routines. ****************/ @@ -307,9 +307,12 @@ gcc -c -I. -Impn -I.. -fomit-frame-pointer -O mp_clz_tab.c gcc -c -I. -Impn -I.. -fomit-frame-pointer -O mp_set_fns.c
gcc -c -I. -Impn -I.. -fomit-frame-pointer -O stack-alloc.c
gcc -c -I. -Impn -I.. -fomit-frame-pointer -O rand.c
+gcc -c -I. -Impn -I.. -fomit-frame-pointer -O randui.c
gcc -c -I. -Impn -I.. -fomit-frame-pointer -O randclr.c
gcc -c -I. -Impn -I.. -fomit-frame-pointer -O randcm.c
+gcc -c -I. -Impn -I.. -fomit-frame-pointer -O randcmui.c
gcc -c -I. -Impn -I.. -fomit-frame-pointer -O randlc.c
+gcc -c -I. -Impn -I.. -fomit-frame-pointer -O randlcui.c
gcc -c -I. -Impn -I.. -fomit-frame-pointer -O version.c
deltree/y tmpdir
@@ -20,7 +20,7 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <stdlib.h> /* FIXME: For malloc(). */ -#include <gmp.h> +#include "gmp.h" /* Array of CL-schemes, ordered in increasing order for the first member (the 'bits' value). The 'm' entry is converted by @@ -46,9 +46,6 @@ static __gmp_rand_lc_scheme_struct __gmp_rand_scheme[] = 12345, /* c (adder) */ "0x80000000"}, /* m (modulo) = 2^31 */ - /* Testing. FIXME: Remove. */ - /* {32, "2", 1, "10"},*/ - /* The multipliers are all between 0.01m and 0.99m, and are congruent to 5 (mod 8). */ @@ -19,7 +19,7 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <gmp.h> +#include "gmp.h" void #if __STDC__ @@ -20,7 +20,8 @@ along with the GNU MP Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <gmp.h> +#include "gmp.h" +#include "gmp-impl.h" void #if __STDC__ @@ -22,7 +22,8 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include <stdlib.h> /* FIXME: For malloc(). */ -#include <gmp.h> +#include "gmp.h" +#include "gmp-impl.h" void #if __STDC__ |