diff options
Diffstat (limited to 'math/prng')
-rw-r--r-- | math/prng/distinfo | 17 | ||||
-rw-r--r-- | math/prng/patches/patch-src_anti.c | 22 | ||||
-rw-r--r-- | math/prng/patches/patch-src_compound.c | 13 | ||||
-rw-r--r-- | math/prng/patches/patch-src_cons.c | 22 | ||||
-rw-r--r-- | math/prng/patches/patch-src_dicg.c | 31 | ||||
-rw-r--r-- | math/prng/patches/patch-src_eicg.c | 22 | ||||
-rw-r--r-- | math/prng/patches/patch-src_external.c | 76 | ||||
-rw-r--r-- | math/prng/patches/patch-src_file.c | 22 | ||||
-rw-r--r-- | math/prng/patches/patch-src_icg.c | 22 | ||||
-rw-r--r-- | math/prng/patches/patch-src_lcg.c | 22 | ||||
-rw-r--r-- | math/prng/patches/patch-src_meicg.c | 22 | ||||
-rw-r--r-- | math/prng/patches/patch-src_mt19937.c | 31 | ||||
-rw-r--r-- | math/prng/patches/patch-src_prng.h | 23 | ||||
-rw-r--r-- | math/prng/patches/patch-src_qcg.c | 22 | ||||
-rw-r--r-- | math/prng/patches/patch-src_sub.c | 22 | ||||
-rw-r--r-- | math/prng/patches/patch-src_support.c | 13 |
16 files changed, 401 insertions, 1 deletions
diff --git a/math/prng/distinfo b/math/prng/distinfo index 868390b2961..74bb062de3c 100644 --- a/math/prng/distinfo +++ b/math/prng/distinfo @@ -1,5 +1,20 @@ -$NetBSD: distinfo,v 1.1.1.1 2010/02/19 13:56:53 wiz Exp $ +$NetBSD: distinfo,v 1.2 2012/11/01 19:42:01 joerg Exp $ SHA1 (prng-3.0.2.tar.gz) = 02175da3f49a16bcf7eee70b53564f05941232d4 RMD160 (prng-3.0.2.tar.gz) = e7d885a74751e8d9c906279516a025a152d4c12e Size (prng-3.0.2.tar.gz) = 497047 bytes +SHA1 (patch-src_anti.c) = 9c59690cb330c618b45a8b661004a28da80f11b1 +SHA1 (patch-src_compound.c) = 4b2bf6f4a7e17edf9af7196904dec25172e68888 +SHA1 (patch-src_cons.c) = 96101503051eb6794c008ce9b46fc205726d6fcd +SHA1 (patch-src_dicg.c) = 81fae8bbee6797bba7649b3ddac7f268127511e8 +SHA1 (patch-src_eicg.c) = 020993311c7d67c5a5bc3768f4cab97681b8d218 +SHA1 (patch-src_external.c) = 0ec01f81c6c6960ce1b75da0bbbaf274b578aff2 +SHA1 (patch-src_file.c) = 6e1379a28155ba7b084c2105233a5fd1acd553cc +SHA1 (patch-src_icg.c) = 5af81ada3c1772f88b316b83fde4813cad907ce1 +SHA1 (patch-src_lcg.c) = 15aee3bb2ecc01697d3edc68d5824e27db22c4c3 +SHA1 (patch-src_meicg.c) = aa40178f4d02f923513de7c5bc155f25c7624bee +SHA1 (patch-src_mt19937.c) = 1b97825840ad0fa797219f45c5256276eb9231f0 +SHA1 (patch-src_prng.h) = 2f719fcbb151c08b2731246688911a4b49f4baad +SHA1 (patch-src_qcg.c) = 16d7f5dca829264c62ca7ca97f5c9ddc50186117 +SHA1 (patch-src_sub.c) = 0c01b28efdbf772c6345fbaa707a0514b625beca +SHA1 (patch-src_support.c) = 78eb361b56f378cf390400bd5f48ff2fb5c751f5 diff --git a/math/prng/patches/patch-src_anti.c b/math/prng/patches/patch-src_anti.c new file mode 100644 index 00000000000..1965e141a6a --- /dev/null +++ b/math/prng/patches/patch-src_anti.c @@ -0,0 +1,22 @@ +$NetBSD: patch-src_anti.c,v 1.1 2012/11/01 19:42:01 joerg Exp $ + +--- src/anti.c.orig 2012-10-30 20:00:10.000000000 +0000 ++++ src/anti.c +@@ -82,7 +82,7 @@ void prng_anti_reset(struct prng *gen) + * gen: Pointer to a struct prng. + * + */ +-inline double prng_anti_get_next(struct prng *gen) ++double prng_anti_get_next(struct prng *gen) + { + return (1. - prng_get_next(gen->data.anti_data.prng)); + } +@@ -114,7 +114,7 @@ void prng_anti_get_array(struct prng *ge + * + */ + /* +-inline prng_num prng_anti_get_next_int(struct prng *gen) ++prng_num prng_anti_get_next_int(struct prng *gen) + ... undefined !!! + */ + diff --git a/math/prng/patches/patch-src_compound.c b/math/prng/patches/patch-src_compound.c new file mode 100644 index 00000000000..26d165989b3 --- /dev/null +++ b/math/prng/patches/patch-src_compound.c @@ -0,0 +1,13 @@ +$NetBSD: patch-src_compound.c,v 1.1 2012/11/01 19:42:01 joerg Exp $ + +--- src/compound.c.orig 2012-10-30 20:00:16.000000000 +0000 ++++ src/compound.c +@@ -105,7 +105,7 @@ void prng_compound_seed(struct prng *gen + * gen: Pointer to a struct prng. + * + */ +-inline double prng_compound_get_next(struct prng *gen) ++double prng_compound_get_next(struct prng *gen) + { + int i; + double sum = 0.0; diff --git a/math/prng/patches/patch-src_cons.c b/math/prng/patches/patch-src_cons.c new file mode 100644 index 00000000000..3e953c960ca --- /dev/null +++ b/math/prng/patches/patch-src_cons.c @@ -0,0 +1,22 @@ +$NetBSD: patch-src_cons.c,v 1.1 2012/11/01 19:42:01 joerg Exp $ + +--- src/cons.c.orig 2012-10-30 20:00:14.000000000 +0000 ++++ src/cons.c +@@ -89,7 +89,7 @@ void prng_con_reset(struct prng *gen) + * gen: Pointer to a struct prng. + * + */ +-inline double prng_con_get_next(struct prng *gen) ++double prng_con_get_next(struct prng *gen) + { + return(prng_get_next(gen->data.con_data.prng)); + } +@@ -119,7 +119,7 @@ void prng_con_get_array(struct prng *gen + * gen: Pointer to a struct prng. + * + */ +-inline prng_num prng_con_get_next_int(struct prng *gen) ++prng_num prng_con_get_next_int(struct prng *gen) + { + return(prng_get_next_int(gen->data.con_data.prng)); + } diff --git a/math/prng/patches/patch-src_dicg.c b/math/prng/patches/patch-src_dicg.c new file mode 100644 index 00000000000..51ca3835903 --- /dev/null +++ b/math/prng/patches/patch-src_dicg.c @@ -0,0 +1,31 @@ +$NetBSD: patch-src_dicg.c,v 1.1 2012/11/01 19:42:01 joerg Exp $ + +--- src/dicg.c.orig 2012-10-30 20:00:40.000000000 +0000 ++++ src/dicg.c +@@ -441,7 +441,7 @@ t->pton[29] = 1073741823; + * Algorithm by Karin Schaber and Otmar Lendl. + * + */ +-inline prng_num prng_dicg_multiply(int k,prng_num c, prng_num d) ++prng_num prng_dicg_multiply(int k,prng_num c, prng_num d) + { + int i; + struct mtable *t; +@@ -593,7 +593,7 @@ void prng_dicg_seed(struct prng *gen,prn + * gen: Pointer to a struct prng. + * + */ +-inline prng_num prng_dicg_get_next_int(struct prng *gen) /* DUMMY !!!!*/ ++prng_num prng_dicg_get_next_int(struct prng *gen) /* DUMMY !!!!*/ + { + s_prng_num inv, current, prod; + +@@ -619,7 +619,7 @@ inline prng_num prng_dicg_get_next_int(s + * gen: Pointer to a struct prng. + * + */ +-inline double prng_dicg_get_next(struct prng *gen) ++double prng_dicg_get_next(struct prng *gen) + { + return(prng_dicg_get_next_int(gen) * gen->data.dicg_data.inv_p); + } diff --git a/math/prng/patches/patch-src_eicg.c b/math/prng/patches/patch-src_eicg.c new file mode 100644 index 00000000000..50a68ea62ed --- /dev/null +++ b/math/prng/patches/patch-src_eicg.c @@ -0,0 +1,22 @@ +$NetBSD: patch-src_eicg.c,v 1.1 2012/11/01 19:42:01 joerg Exp $ + +--- src/eicg.c.orig 2012-10-30 20:00:38.000000000 +0000 ++++ src/eicg.c +@@ -120,7 +120,7 @@ void prng_eicg_seed(struct prng *gen,prn + * gen: Pointer to a struct prng. + * + */ +-inline prng_num prng_eicg_get_next_int(struct prng *gen) ++prng_num prng_eicg_get_next_int(struct prng *gen) + { + prng_num old; + +@@ -138,7 +138,7 @@ inline prng_num prng_eicg_get_next_int(s + * gen: Pointer to a struct prng. + * + */ +-inline double prng_eicg_get_next(struct prng *gen) ++double prng_eicg_get_next(struct prng *gen) + { + return(prng_eicg_get_next_int(gen) * gen->data.eicg_data.inv_p); + } diff --git a/math/prng/patches/patch-src_external.c b/math/prng/patches/patch-src_external.c new file mode 100644 index 00000000000..5d429b75a83 --- /dev/null +++ b/math/prng/patches/patch-src_external.c @@ -0,0 +1,76 @@ +$NetBSD: patch-src_external.c,v 1.1 2012/11/01 19:42:01 joerg Exp $ + +--- src/external.c.orig 2012-10-30 20:00:20.000000000 +0000 ++++ src/external.c +@@ -139,7 +139,7 @@ static unsigned int tt800_mag01[2]= + * gen: Pointer to a struct prng. + * + */ +-inline prng_num prng_tt800_get_next_int(struct prng *gen) ++prng_num prng_tt800_get_next_int(struct prng *gen) + { + unsigned int y; + struct tt800_state *g; +@@ -189,7 +189,7 @@ return(y); + * gen: Pointer to a struct prng. + * + */ +-inline double prng_tt800_get_next(struct prng *gen) ++double prng_tt800_get_next(struct prng *gen) + { + return(prng_tt800_get_next_int(gen) * TT800_INV_MOD); + } +@@ -223,7 +223,7 @@ struct ctg_state + * gen: Pointer to a struct prng. + * + */ +-inline prng_num prng_ctg_get_next_int(struct prng *gen) ++prng_num prng_ctg_get_next_int(struct prng *gen) + { + unsigned int b; + struct ctg_state *g; +@@ -247,7 +247,7 @@ return(g->s1 ^ g->s2 ^ g->s3); + * gen: Pointer to a struct prng. + * + */ +-inline double prng_ctg_get_next(struct prng *gen) ++double prng_ctg_get_next(struct prng *gen) + { + return(prng_ctg_get_next_int(gen) * 2.3283064365e-10); + } +@@ -285,7 +285,7 @@ struct mrg_state + * gen: Pointer to a struct prng. + * + */ +-inline prng_num prng_mrg_get_next_int(struct prng *gen) ++prng_num prng_mrg_get_next_int(struct prng *gen) + { + int h,p1,p5; + struct mrg_state *g; +@@ -312,7 +312,7 @@ return(g->x1); + * gen: Pointer to a struct prng. + * + */ +-inline double prng_mrg_get_next(struct prng *gen) ++double prng_mrg_get_next(struct prng *gen) + { + return(prng_mrg_get_next_int(gen) * 4.656612873077393e-10); + } +@@ -350,7 +350,7 @@ struct cmrg_state + * gen: Pointer to a struct prng. + * + */ +-inline prng_num prng_cmrg_get_next_int(struct prng *gen) ++prng_num prng_cmrg_get_next_int(struct prng *gen) + { + int h, p12, p13, p21, p23; + struct cmrg_state *g; +@@ -385,7 +385,7 @@ else + * gen: Pointer to a struct prng. + * + */ +-inline double prng_cmrg_get_next(struct prng *gen) ++double prng_cmrg_get_next(struct prng *gen) + { + return(prng_cmrg_get_next_int(gen) * 4.656612873077393e-10); + } diff --git a/math/prng/patches/patch-src_file.c b/math/prng/patches/patch-src_file.c new file mode 100644 index 00000000000..1f53ede9c09 --- /dev/null +++ b/math/prng/patches/patch-src_file.c @@ -0,0 +1,22 @@ +$NetBSD: patch-src_file.c,v 1.1 2012/11/01 19:42:01 joerg Exp $ + +--- src/file.c.orig 2012-10-30 20:00:18.000000000 +0000 ++++ src/file.c +@@ -88,7 +88,7 @@ void prng_file_reset(struct prng *gen) + * gen: Pointer to a struct prng. + * + */ +-inline double prng_afile_get_next(struct prng *gen) ++double prng_afile_get_next(struct prng *gen) + { + double d; + char line[64]; +@@ -135,7 +135,7 @@ void prng_afile_get_array(struct prng *g + * gen: Pointer to a struct prng. + * + */ +-inline double prng_bfile_get_next(struct prng *gen) ++double prng_bfile_get_next(struct prng *gen) + { + prng_num n; + diff --git a/math/prng/patches/patch-src_icg.c b/math/prng/patches/patch-src_icg.c new file mode 100644 index 00000000000..6b7536d0086 --- /dev/null +++ b/math/prng/patches/patch-src_icg.c @@ -0,0 +1,22 @@ +$NetBSD: patch-src_icg.c,v 1.1 2012/11/01 19:42:01 joerg Exp $ + +--- src/icg.c.orig 2012-10-30 20:00:34.000000000 +0000 ++++ src/icg.c +@@ -110,7 +110,7 @@ void prng_icg_seed(struct prng *gen,prng + * gen: Pointer to a struct prng. + * + */ +-inline prng_num prng_icg_get_next_int(struct prng *gen) ++prng_num prng_icg_get_next_int(struct prng *gen) + { + s_prng_num inv, current, prod; + +@@ -135,7 +135,7 @@ inline prng_num prng_icg_get_next_int(st + * gen: Pointer to a struct prng. + * + */ +-inline double prng_icg_get_next(struct prng *gen) ++double prng_icg_get_next(struct prng *gen) + { + return(prng_icg_get_next_int(gen) * gen->data.icg_data.inv_p); + } diff --git a/math/prng/patches/patch-src_lcg.c b/math/prng/patches/patch-src_lcg.c new file mode 100644 index 00000000000..53efc8dccac --- /dev/null +++ b/math/prng/patches/patch-src_lcg.c @@ -0,0 +1,22 @@ +$NetBSD: patch-src_lcg.c,v 1.1 2012/11/01 19:42:01 joerg Exp $ + +--- src/lcg.c.orig 2012-10-30 20:00:32.000000000 +0000 ++++ src/lcg.c +@@ -111,7 +111,7 @@ void prng_lcg_seed(struct prng *gen,prng + * gen: Pointer to a struct prng. + * + */ +-inline prng_num prng_lcg_get_next_int(struct prng *gen) ++prng_num prng_lcg_get_next_int(struct prng *gen) + { + s_prng_num ax, current; + +@@ -130,7 +130,7 @@ inline prng_num prng_lcg_get_next_int(st + * gen: Pointer to a struct prng. + * + */ +-inline double prng_lcg_get_next(struct prng *gen) ++double prng_lcg_get_next(struct prng *gen) + { + return(prng_lcg_get_next_int(gen) * gen->data.lcg_data.inv_p); + } diff --git a/math/prng/patches/patch-src_meicg.c b/math/prng/patches/patch-src_meicg.c new file mode 100644 index 00000000000..8fa4c64462f --- /dev/null +++ b/math/prng/patches/patch-src_meicg.c @@ -0,0 +1,22 @@ +$NetBSD: patch-src_meicg.c,v 1.1 2012/11/01 19:42:01 joerg Exp $ + +--- src/meicg.c.orig 2012-10-30 20:00:30.000000000 +0000 ++++ src/meicg.c +@@ -106,7 +106,7 @@ void prng_meicg_seed(struct prng *gen,pr + * gen: Pointer to a struct prng. + * + */ +-inline prng_num prng_meicg_get_next_int(struct prng *gen) ++prng_num prng_meicg_get_next_int(struct prng *gen) + { + s_prng_num an, sum, inv, n; + +@@ -144,7 +144,7 @@ inline prng_num prng_meicg_get_next_int( + * gen: Pointer to a struct prng. + * + */ +-inline double prng_meicg_get_next(struct prng *gen) ++double prng_meicg_get_next(struct prng *gen) + { + return(prng_meicg_get_next_int(gen) * gen->data.meicg_data.inv_p); + } diff --git a/math/prng/patches/patch-src_mt19937.c b/math/prng/patches/patch-src_mt19937.c new file mode 100644 index 00000000000..b2457a88b16 --- /dev/null +++ b/math/prng/patches/patch-src_mt19937.c @@ -0,0 +1,31 @@ +$NetBSD: patch-src_mt19937.c,v 1.1 2012/11/01 19:42:01 joerg Exp $ + +--- src/mt19937.c.orig 2012-10-30 20:00:22.000000000 +0000 ++++ src/mt19937.c +@@ -137,7 +137,7 @@ + * seed: used for initializing array + * + */ +-inline void prng_mt19937_seed( struct prng *gen, prng_num seed ) ++void prng_mt19937_seed( struct prng *gen, prng_num seed ) + { + int i; + +@@ -172,7 +172,7 @@ void prng_mt19937_reset(struct prng *gen + * gen: Pointer to a struct prng. + * + */ +-inline prng_num prng_mt19937_get_next_int(struct prng *gen) ++prng_num prng_mt19937_get_next_int(struct prng *gen) + { + #define MT gen->data.mt19937_data.mt + #define MTI gen->data.mt19937_data.mti +@@ -220,7 +220,7 @@ inline prng_num prng_mt19937_get_next_in + * gen: Pointer to a struct prng. + * + */ +-inline double prng_mt19937_get_next(struct prng *gen) ++double prng_mt19937_get_next(struct prng *gen) + { + /* reals: [0,1)-interval */ + /* multiply with 1. / 2^32 */ diff --git a/math/prng/patches/patch-src_prng.h b/math/prng/patches/patch-src_prng.h new file mode 100644 index 00000000000..c3a284303ff --- /dev/null +++ b/math/prng/patches/patch-src_prng.h @@ -0,0 +1,23 @@ +$NetBSD: patch-src_prng.h,v 1.1 2012/11/01 19:42:01 joerg Exp $ + +--- src/prng.h.orig 2001-11-06 20:04:41.000000000 +0000 ++++ src/prng.h +@@ -405,8 +405,7 @@ struct prng *prng_external_init(struct p + + /* INLINE fnk def. for mult_mod, I don't know if this works for non-GCC */ + +-#ifdef __GNUC__ +-extern __inline__ prng_num mult_mod(prng_num s,struct mult_mod_struct *mm) ++static __inline__ prng_num mult_mod(prng_num s,struct mult_mod_struct *mm) + { + s_prng_num s_tmp; + +@@ -437,8 +436,5 @@ switch(mm->algorithm) + /* not reached */ + return(0); + } +-#else /* rely on function in support.h */ +-prng_num mult_mod(prng_num s,struct mult_mod_struct *mm); +-#endif + + #endif /* __PRNG_H__ */ diff --git a/math/prng/patches/patch-src_qcg.c b/math/prng/patches/patch-src_qcg.c new file mode 100644 index 00000000000..bb6dfe4ed23 --- /dev/null +++ b/math/prng/patches/patch-src_qcg.c @@ -0,0 +1,22 @@ +$NetBSD: patch-src_qcg.c,v 1.1 2012/11/01 19:42:01 joerg Exp $ + +--- src/qcg.c.orig 2012-10-30 20:00:28.000000000 +0000 ++++ src/qcg.c +@@ -107,7 +107,7 @@ void prng_qcg_seed(struct prng *gen,prng + * gen: Pointer to a struct prng. + * + */ +-inline prng_num prng_qcg_get_next_int(struct prng *gen) ++prng_num prng_qcg_get_next_int(struct prng *gen) + { + s_prng_num current, sum, square, q_term, l_term; + +@@ -150,7 +150,7 @@ inline prng_num prng_qcg_get_next_int(st + * gen: Pointer to a struct prng. + * + */ +-inline double prng_qcg_get_next(struct prng *gen) ++double prng_qcg_get_next(struct prng *gen) + { + return(prng_qcg_get_next_int(gen) * gen->data.qcg_data.inv_p); + } diff --git a/math/prng/patches/patch-src_sub.c b/math/prng/patches/patch-src_sub.c new file mode 100644 index 00000000000..21cf50fed2c --- /dev/null +++ b/math/prng/patches/patch-src_sub.c @@ -0,0 +1,22 @@ +$NetBSD: patch-src_sub.c,v 1.1 2012/11/01 19:42:01 joerg Exp $ + +--- src/sub.c.orig 2012-10-30 20:00:12.000000000 +0000 ++++ src/sub.c +@@ -89,7 +89,7 @@ void prng_sub_reset(struct prng *gen) + * gen: Pointer to a struct prng. + * + */ +-inline double prng_sub_get_next(struct prng *gen) ++double prng_sub_get_next(struct prng *gen) + { + prng_num j; + double tmp; +@@ -127,7 +127,7 @@ void prng_sub_get_array(struct prng *gen + * gen: Pointer to a struct prng. + * + */ +-inline prng_num prng_sub_get_next_int(struct prng *gen) ++prng_num prng_sub_get_next_int(struct prng *gen) + { + prng_num j,tmp; + diff --git a/math/prng/patches/patch-src_support.c b/math/prng/patches/patch-src_support.c new file mode 100644 index 00000000000..770efc2ceaf --- /dev/null +++ b/math/prng/patches/patch-src_support.c @@ -0,0 +1,13 @@ +$NetBSD: patch-src_support.c,v 1.1 2012/11/01 19:42:01 joerg Exp $ + +--- src/support.c.orig 2012-10-30 20:02:12.000000000 +0000 ++++ src/support.c +@@ -449,7 +449,7 @@ for(mask = ~0; mask; mask >>= 1) /* ~0 + } + } + +-#ifndef __cplusplus ++#if 0 + /* + * Modular Multiplication. Uses the precalculated values from mult_mod_setup. + * |