|
Packit |
5c3484 |
/* Mersenne Twister pseudo-random number generator defines.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
Copyright 2002, 2003 Free Software Foundation, Inc.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
This file is part of the GNU MP Library.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
The GNU MP Library is free software; you can redistribute it and/or modify
|
|
Packit |
5c3484 |
it under the terms of either:
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
* the GNU Lesser General Public License as published by the Free
|
|
Packit |
5c3484 |
Software Foundation; either version 3 of the License, or (at your
|
|
Packit |
5c3484 |
option) any later version.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
or
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
* the GNU General Public License as published by the Free Software
|
|
Packit |
5c3484 |
Foundation; either version 2 of the License, or (at your option) any
|
|
Packit |
5c3484 |
later version.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
or both in parallel, as here.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
The GNU MP Library is distributed in the hope that it will be useful, but
|
|
Packit |
5c3484 |
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
Packit |
5c3484 |
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
Packit |
5c3484 |
for more details.
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
You should have received copies of the GNU General Public License and the
|
|
Packit |
5c3484 |
GNU Lesser General Public License along with the GNU MP Library. If not,
|
|
Packit |
5c3484 |
see https://www.gnu.org/licenses/. */
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
/* Number of extractions used to warm the buffer up. */
|
|
Packit |
5c3484 |
#define WARM_UP 2000
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
/* Period parameters. */
|
|
Packit |
5c3484 |
#define N 624
|
|
Packit |
5c3484 |
#define M 397
|
|
Packit |
5c3484 |
#define MATRIX_A 0x9908B0DF /* Constant vector a. */
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
/* State structure for MT. */
|
|
Packit |
5c3484 |
typedef struct
|
|
Packit |
5c3484 |
{
|
|
Packit |
5c3484 |
gmp_uint_least32_t mt[N]; /* State array. */
|
|
Packit |
5c3484 |
int mti; /* Index of current value. */
|
|
Packit |
5c3484 |
} gmp_rand_mt_struct;
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
|
|
Packit |
5c3484 |
void __gmp_mt_recalc_buffer (gmp_uint_least32_t *);
|
|
Packit |
5c3484 |
void __gmp_randget_mt (gmp_randstate_t, mp_ptr, unsigned long int);
|
|
Packit |
5c3484 |
void __gmp_randclear_mt (gmp_randstate_t);
|
|
Packit |
5c3484 |
void __gmp_randiset_mt (gmp_randstate_ptr, gmp_randstate_srcptr);
|