diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2019-06-25 13:21:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-25 13:21:01 -0700 |
commit | 37a1ad069a800f5ef98286f25fb3fb632375168d (patch) | |
tree | 9cf8d4623be75cd7b2a467f430566df9b421f8a1 /numpy | |
parent | a1cd310ea6192945b7f4e452ad5794b291da77a5 (diff) | |
parent | 578cf428470b6bcaaf5198b63acdabc251512612 (diff) | |
download | numpy-37a1ad069a800f5ef98286f25fb3fb632375168d.tar.gz |
Merge pull request #13833 from mattip/remove-threefry
MAINT: remove ThreeFry BitGenerator
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/random/__init__.py | 4 | ||||
-rw-r--r-- | numpy/random/_pickle.py | 2 | ||||
-rw-r--r-- | numpy/random/philox.pyx | 2 | ||||
-rw-r--r-- | numpy/random/setup.py | 3 | ||||
-rw-r--r-- | numpy/random/src/philox/LICENSE.md | 2 | ||||
-rw-r--r-- | numpy/random/src/threefry/LICENSE.md | 31 | ||||
-rw-r--r-- | numpy/random/src/threefry/threefry-benchmark.c | 38 | ||||
-rw-r--r-- | numpy/random/src/threefry/threefry-orig.c | 83 | ||||
-rw-r--r-- | numpy/random/src/threefry/threefry-test-data-gen.c | 83 | ||||
-rw-r--r-- | numpy/random/src/threefry/threefry.c | 29 | ||||
-rw-r--r-- | numpy/random/src/threefry/threefry.h | 331 | ||||
-rw-r--r-- | numpy/random/tests/data/threefry-testset-1.csv | 1001 | ||||
-rw-r--r-- | numpy/random/tests/data/threefry-testset-2.csv | 1001 | ||||
-rw-r--r-- | numpy/random/tests/test_direct.py | 25 | ||||
-rw-r--r-- | numpy/random/tests/test_smoke.py | 14 | ||||
-rw-r--r-- | numpy/random/threefry.pyx | 466 |
16 files changed, 5 insertions, 3110 deletions
diff --git a/numpy/random/__init__.py b/numpy/random/__init__.py index cf4a874af..8240f691d 100644 --- a/numpy/random/__init__.py +++ b/numpy/random/__init__.py @@ -100,7 +100,6 @@ BitGenerator Streams that work with Generator MT19937 PCG64 Philox -ThreeFry Xoshiro256 Xoshiro512 ============================================= === @@ -167,13 +166,12 @@ from .generator import Generator from .mt19937 import MT19937 from .pcg64 import PCG64 from .philox import Philox -from .threefry import ThreeFry from .xoshiro256 import Xoshiro256 from .xoshiro512 import Xoshiro512 from .mtrand import RandomState __all__ += ['Generator', 'MT19937', 'Philox', 'PCG64', - 'ThreeFry', 'Xoshiro256', 'Xoshiro512', 'RandomState'] + 'Xoshiro256', 'Xoshiro512', 'RandomState'] def __RandomState_ctor(): diff --git a/numpy/random/_pickle.py b/numpy/random/_pickle.py index bb637a69c..d7f84f3d8 100644 --- a/numpy/random/_pickle.py +++ b/numpy/random/_pickle.py @@ -1,6 +1,5 @@ from .mtrand import RandomState from .philox import Philox -from .threefry import ThreeFry from .pcg64 import PCG64 from .xoshiro256 import Xoshiro256 from .xoshiro512 import Xoshiro512 @@ -11,7 +10,6 @@ from .mt19937 import MT19937 BitGenerators = {'MT19937': MT19937, 'PCG64': PCG64, 'Philox': Philox, - 'ThreeFry': ThreeFry, 'Xoshiro256': Xoshiro256, 'Xoshiro512': Xoshiro512 } diff --git a/numpy/random/philox.pyx b/numpy/random/philox.pyx index 91dd3e7dd..c89a52a99 100644 --- a/numpy/random/philox.pyx +++ b/numpy/random/philox.pyx @@ -102,8 +102,6 @@ cdef class Philox: directly consumable in Python and must be consumed by a ``Generator`` or similar object that supports low-level access. - See ``ThreeFry`` for a closely related PRNG. - **State and Seeding** The ``Philox`` state vector consists of a 2 256-bit values encoded as diff --git a/numpy/random/setup.py b/numpy/random/setup.py index f00373233..29f798180 100644 --- a/numpy/random/setup.py +++ b/numpy/random/setup.py @@ -85,8 +85,7 @@ def configuration(parent_package='', top_path=None): depends=['%s.pyx' % gen], define_macros=defs, ) - for gen in ['philox', 'threefry', 'xoshiro256', 'xoshiro512', - 'pcg64']: + for gen in ['philox', 'xoshiro256', 'xoshiro512', 'pcg64']: # gen.pyx, src/gen/gen.c _defs = defs + PCG64_DEFS if gen == 'pcg64' else defs config.add_extension(gen, diff --git a/numpy/random/src/philox/LICENSE.md b/numpy/random/src/philox/LICENSE.md index 4a9f6bb29..9738e44de 100644 --- a/numpy/random/src/philox/LICENSE.md +++ b/numpy/random/src/philox/LICENSE.md @@ -1,4 +1,4 @@ -# THREEFRY +# PHILOX Copyright 2010-2012, D. E. Shaw Research. All rights reserved. diff --git a/numpy/random/src/threefry/LICENSE.md b/numpy/random/src/threefry/LICENSE.md deleted file mode 100644 index 4a9f6bb29..000000000 --- a/numpy/random/src/threefry/LICENSE.md +++ /dev/null @@ -1,31 +0,0 @@ -# THREEFRY - -Copyright 2010-2012, D. E. Shaw Research. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions, and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright - notice, this list of conditions, and the following disclaimer in the - documentation and/or other materials provided with the distribution. - -* Neither the name of D. E. Shaw Research nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/numpy/random/src/threefry/threefry-benchmark.c b/numpy/random/src/threefry/threefry-benchmark.c deleted file mode 100644 index 5e2cfe844..000000000 --- a/numpy/random/src/threefry/threefry-benchmark.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Simple benchamrk command - * - * cl threefry-benchmark.c /Ox - * - * gcc threefry-benchmark.c -O3 -o threefry-benchmark - * - * Requires the Random123 directory containing header files to be located in the - * same directory (not included). - */ -#include "Random123/threefry.h" -#include <inttypes.h> -#include <stdio.h> -#include <time.h> - -#define N 1000000000 - -int main() { - threefry4x64_key_t ctr = {{0, 0, 0, 0}}; - threefry4x64_ctr_t key = {{0xDEADBEAF, 0, 0, 0}}; - threefry4x64_ctr_t out; - uint64_t count = 0, sum = 0; - int i, j; - clock_t begin = clock(); - for (i = 0; i < N / 4UL; i++) { - ctr.v[0]++; - out = threefry4x64_R(threefry4x64_rounds, ctr, key); - for (j = 0; j < 4; j++) { - sum += out.v[j]; - count++; - } - } - clock_t end = clock(); - double time_spent = (double)(end - begin) / CLOCKS_PER_SEC; - printf("0x%" PRIx64 "\ncount: %" PRIu64 "\n", sum, count); - printf("%" PRIu64 " randoms per second\n", - (uint64_t)(N / time_spent) / 1000000 * 1000000); -} diff --git a/numpy/random/src/threefry/threefry-orig.c b/numpy/random/src/threefry/threefry-orig.c deleted file mode 100644 index d27cfd797..000000000 --- a/numpy/random/src/threefry/threefry-orig.c +++ /dev/null @@ -1,83 +0,0 @@ -/* -Copyright (c) 2017, Pierre de Buyl - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -1. Redistributions of source code must retain the above copyright -notice, this list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its -contributors may be used to endorse or promote products derived from -this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - -#include "threefry.h" -#include <stdint.h> - -#define N_WORDS 2 -#define KEY_LENGTH 3 -#define C240 0x1BD11BDAA9FC1A22 -#define N_ROUNDS 20 -#define MASK 0xffffffffffffffff -#define DOUBLE_MULT 5.421010862427522e-20 - -static const int ROTATION[] = {16, 42, 12, 31, 16, 32, 24, 21}; - -uint64_t rotl_64(uint64_t x, int d) { return ((x << d) | (x >> (64 - d))); } - -threefry_t mix(threefry_t x, int R) { - x.c0 += x.c1; - x.c1 = rotl_64(x.c1, R) ^ x.c0; - return x; -} - -threefry_t threefry(threefry_t p, threefry_t k) { - uint64_t K[] = {k.c0, k.c1, C240 ^ k.c0 ^ k.c1}; - int rmod4, rdiv4; - threefry_t x; - x = p; - for (int r = 0; r < N_ROUNDS; r++) { - rmod4 = r % 4; - if (rmod4 == 0) { - rdiv4 = r / 4; - x.c0 += K[rdiv4 % KEY_LENGTH]; - x.c1 += K[(rdiv4 + 1) % KEY_LENGTH] + rdiv4; - } - x = mix(x, ROTATION[r % 8]); - } - x.c0 += K[(N_ROUNDS / 4) % KEY_LENGTH]; - x.c1 += K[(N_ROUNDS / 4 + 1) % KEY_LENGTH] + N_ROUNDS / 4; - return x; -} - -uint64_t threefry_uint64(threefry_t *c, threefry_t *k) { - threefry_t x; - x = threefry(*c, *k); - c->c0++; - return x.c0; -} - -double threefry_double(threefry_t *c, threefry_t *k) { - threefry_t x; - x = threefry(*c, *k); - c->c0++; - return x.c0 * DOUBLE_MULT; -} diff --git a/numpy/random/src/threefry/threefry-test-data-gen.c b/numpy/random/src/threefry/threefry-test-data-gen.c deleted file mode 100644 index 8514a227e..000000000 --- a/numpy/random/src/threefry/threefry-test-data-gen.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Generate testing csv files - * - * cl threefry-test-data-gen.c /Ox ../splitmix64/splitmix64.c /Ox - * threefry-test-data-gen.exe - * - * gcc threefry-test-data-gen.c ../splitmix64/splitmix64.c /Ox -o - * threefry-test-data-gen - * ./threefry-test-data-gen - * - * Requires the Random123 directory containing header files to be located in the - * same directory (not included). - * - */ - -#include "../splitmix64/splitmix64.h" -#include "Random123/threefry.h" -#include <inttypes.h> -#include <stdio.h> - -#define N 1000 - -int main() { - threefry4x64_key_t ctr = {{0, 0, 0, 0}}; - uint64_t state, seed = 0xDEADBEAF; - state = seed; - threefry4x64_ctr_t key = {{0}}; - threefry4x64_ctr_t out; - uint64_t store[N]; - int i, j; - for (i = 0; i < 4; i++) { - key.v[i] = splitmix64_next(&state); - } - for (i = 0; i < N / 4UL; i++) { - ctr.v[0]++; - out = threefry4x64_R(threefry4x64_rounds, ctr, key); - for (j = 0; j < 4; j++) { - store[i * 4 + j] = out.v[j]; - } - } - - FILE *fp; - fp = fopen("threefry-testset-1.csv", "w"); - if (fp == NULL) { - printf("Couldn't open file\n"); - return -1; - } - fprintf(fp, "seed, 0x%" PRIx64 "\n", seed); - for (i = 0; i < N; i++) { - fprintf(fp, "%d, 0x%" PRIx64 "\n", i, store[i]); - if (i == 999) { - printf("%d, 0x%" PRIx64 "\n", i, store[i]); - } - } - fclose(fp); - - ctr.v[0] = 0; - state = seed = 0; - for (i = 0; i < 4; i++) { - key.v[i] = splitmix64_next(&state); - } - for (i = 0; i < N / 4; i++) { - ctr.v[0]++; - out = threefry4x64_R(threefry4x64_rounds, ctr, key); - for (j = 0; j < 4; j++) { - store[i * 4 + j] = out.v[j]; - } - } - - fp = fopen("threefry-testset-2.csv", "w"); - if (fp == NULL) { - printf("Couldn't open file\n"); - return -1; - } - fprintf(fp, "seed, 0x%" PRIx64 "\n", seed); - for (i = 0; i < N; i++) { - fprintf(fp, "%d, 0x%" PRIx64 "\n", i, store[i]); - if (i == 999) { - printf("%d, 0x%" PRIx64 "\n", i, store[i]); - } - } - fclose(fp); -} diff --git a/numpy/random/src/threefry/threefry.c b/numpy/random/src/threefry/threefry.c deleted file mode 100644 index 55d3c022a..000000000 --- a/numpy/random/src/threefry/threefry.c +++ /dev/null @@ -1,29 +0,0 @@ -#include "threefry.h" - -extern NPY_INLINE uint64_t threefry_next64(threefry_state *state); - -extern NPY_INLINE uint32_t threefry_next32(threefry_state *state); - -extern void threefry_jump(threefry_state *state) { - /* Advances state as-if 2^128 draws were made */ - state->ctr->v[2]++; - if (state->ctr->v[2] == 0) { - state->ctr->v[3]++; - } -} - -extern void threefry_advance(uint64_t *step, threefry_state *state) { - int i, carry = 0; - uint64_t v_orig; - for (i = 0; i < 4; i++) { - if (carry == 1) { - state->ctr->v[i]++; - carry = state->ctr->v[i] == 0 ? 1 : 0; - } - v_orig = state->ctr->v[i]; - state->ctr->v[i] += step[i]; - if (state->ctr->v[i] < v_orig && carry == 0) { - carry = 1; - } - } -} diff --git a/numpy/random/src/threefry/threefry.h b/numpy/random/src/threefry/threefry.h deleted file mode 100644 index 596b57e12..000000000 --- a/numpy/random/src/threefry/threefry.h +++ /dev/null @@ -1,331 +0,0 @@ -/* -Adapted from random123's threefry.h -*/ -#ifndef _RANDOMDGEN__THREEFRY_H_ -#define _RANDOMDGEN__THREEFRY_H_ - -#include <inttypes.h> -#include "numpy/npy_common.h" - -#define THREEFRY_BUFFER_SIZE 4L - -enum r123_enum_threefry64x4 { - /* These are the R_256 constants from the Threefish reference sources - with names changed to R_64x4... */ - R_64x4_0_0 = 14, - R_64x4_0_1 = 16, - R_64x4_1_0 = 52, - R_64x4_1_1 = 57, - R_64x4_2_0 = 23, - R_64x4_2_1 = 40, - R_64x4_3_0 = 5, - R_64x4_3_1 = 37, - R_64x4_4_0 = 25, - R_64x4_4_1 = 33, - R_64x4_5_0 = 46, - R_64x4_5_1 = 12, - R_64x4_6_0 = 58, - R_64x4_6_1 = 22, - R_64x4_7_0 = 32, - R_64x4_7_1 = 32 -}; - -struct r123array4x64 { - uint64_t v[4]; -}; /* r123array4x64 */ - -typedef struct r123array4x64 threefry4x64_key_t; -typedef struct r123array4x64 threefry4x64_ctr_t; - -static NPY_INLINE uint64_t RotL_64(uint64_t x, unsigned int N); -static NPY_INLINE uint64_t RotL_64(uint64_t x, unsigned int N) { - return (x << (N & 63)) | (x >> ((64 - N) & 63)); -} - -static NPY_INLINE threefry4x64_ctr_t threefry4x64_R(unsigned int Nrounds, - threefry4x64_ctr_t in, - threefry4x64_key_t k); -static NPY_INLINE threefry4x64_ctr_t threefry4x64_R(unsigned int Nrounds, - threefry4x64_ctr_t in, - threefry4x64_key_t k) { - threefry4x64_ctr_t X; - uint64_t ks[4 + 1]; - int i; - ks[4] = ((0xA9FC1A22) + (((uint64_t)(0x1BD11BDA)) << 32)); - for (i = 0; i < 4; i++) { - ks[i] = k.v[i]; - X.v[i] = in.v[i]; - ks[4] ^= k.v[i]; - } - X.v[0] += ks[0]; - X.v[1] += ks[1]; - X.v[2] += ks[2]; - X.v[3] += ks[3]; - if (Nrounds > 0) { - X.v[0] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_0_0); - X.v[1] ^= X.v[0]; - X.v[2] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_0_1); - X.v[3] ^= X.v[2]; - } - if (Nrounds > 1) { - X.v[0] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_1_0); - X.v[3] ^= X.v[0]; - X.v[2] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_1_1); - X.v[1] ^= X.v[2]; - } - if (Nrounds > 2) { - X.v[0] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_2_0); - X.v[1] ^= X.v[0]; - X.v[2] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_2_1); - X.v[3] ^= X.v[2]; - } - if (Nrounds > 3) { - X.v[0] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_3_0); - X.v[3] ^= X.v[0]; - X.v[2] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_3_1); - X.v[1] ^= X.v[2]; - } - if (Nrounds > 3) { - X.v[0] += ks[1]; - X.v[1] += ks[2]; - X.v[2] += ks[3]; - X.v[3] += ks[4]; - X.v[4 - 1] += 1; - } - if (Nrounds > 4) { - X.v[0] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_4_0); - X.v[1] ^= X.v[0]; - X.v[2] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_4_1); - X.v[3] ^= X.v[2]; - } - if (Nrounds > 5) { - X.v[0] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_5_0); - X.v[3] ^= X.v[0]; - X.v[2] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_5_1); - X.v[1] ^= X.v[2]; - } - if (Nrounds > 6) { - X.v[0] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_6_0); - X.v[1] ^= X.v[0]; - X.v[2] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_6_1); - X.v[3] ^= X.v[2]; - } - if (Nrounds > 7) { - X.v[0] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_7_0); - X.v[3] ^= X.v[0]; - X.v[2] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_7_1); - X.v[1] ^= X.v[2]; - } - if (Nrounds > 7) { - X.v[0] += ks[2]; - X.v[1] += ks[3]; - X.v[2] += ks[4]; - X.v[3] += ks[0]; - X.v[4 - 1] += 2; - } - if (Nrounds > 8) { - X.v[0] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_0_0); - X.v[1] ^= X.v[0]; - X.v[2] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_0_1); - X.v[3] ^= X.v[2]; - } - if (Nrounds > 9) { - X.v[0] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_1_0); - X.v[3] ^= X.v[0]; - X.v[2] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_1_1); - X.v[1] ^= X.v[2]; - } - if (Nrounds > 10) { - X.v[0] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_2_0); - X.v[1] ^= X.v[0]; - X.v[2] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_2_1); - X.v[3] ^= X.v[2]; - } - if (Nrounds > 11) { - X.v[0] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_3_0); - X.v[3] ^= X.v[0]; - X.v[2] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_3_1); - X.v[1] ^= X.v[2]; - } - if (Nrounds > 11) { - X.v[0] += ks[3]; - X.v[1] += ks[4]; - X.v[2] += ks[0]; - X.v[3] += ks[1]; - X.v[4 - 1] += 3; - } - if (Nrounds > 12) { - X.v[0] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_4_0); - X.v[1] ^= X.v[0]; - X.v[2] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_4_1); - X.v[3] ^= X.v[2]; - } - if (Nrounds > 13) { - X.v[0] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_5_0); - X.v[3] ^= X.v[0]; - X.v[2] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_5_1); - X.v[1] ^= X.v[2]; - } - if (Nrounds > 14) { - X.v[0] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_6_0); - X.v[1] ^= X.v[0]; - X.v[2] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_6_1); - X.v[3] ^= X.v[2]; - } - if (Nrounds > 15) { - X.v[0] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_7_0); - X.v[3] ^= X.v[0]; - X.v[2] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_7_1); - X.v[1] ^= X.v[2]; - } - if (Nrounds > 15) { - X.v[0] += ks[4]; - X.v[1] += ks[0]; - X.v[2] += ks[1]; - X.v[3] += ks[2]; - X.v[4 - 1] += 4; - } - if (Nrounds > 16) { - X.v[0] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_0_0); - X.v[1] ^= X.v[0]; - X.v[2] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_0_1); - X.v[3] ^= X.v[2]; - } - if (Nrounds > 17) { - X.v[0] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_1_0); - X.v[3] ^= X.v[0]; - X.v[2] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_1_1); - X.v[1] ^= X.v[2]; - } - if (Nrounds > 18) { - X.v[0] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_2_0); - X.v[1] ^= X.v[0]; - X.v[2] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_2_1); - X.v[3] ^= X.v[2]; - } - if (Nrounds > 19) { - X.v[0] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_3_0); - X.v[3] ^= X.v[0]; - X.v[2] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_3_1); - X.v[1] ^= X.v[2]; - } - if (Nrounds > 19) { - X.v[0] += ks[0]; - X.v[1] += ks[1]; - X.v[2] += ks[2]; - X.v[3] += ks[3]; - X.v[4 - 1] += 5; - } - /* Maximum of 20 rounds */ - if (Nrounds > 20) { - X.v[0] += X.v[1]; - X.v[1] = RotL_64(X.v[1], R_64x4_4_0); - X.v[1] ^= X.v[0]; - X.v[2] += X.v[3]; - X.v[3] = RotL_64(X.v[3], R_64x4_4_1); - X.v[3] ^= X.v[2]; - } - return X; -} -enum r123_enum_threefry4x64 { threefry4x64_rounds = 20 }; - -typedef struct s_threefry_state { - threefry4x64_key_t *ctr; - threefry4x64_ctr_t *key; - int buffer_pos; - uint64_t buffer[THREEFRY_BUFFER_SIZE]; - int has_uint32; - uint32_t uinteger; -} threefry_state; - -static NPY_INLINE uint64_t threefry_next(threefry_state *state) { - int i; - threefry4x64_ctr_t ct; - uint64_t out; - if (state->buffer_pos < THREEFRY_BUFFER_SIZE) { - out = state->buffer[state->buffer_pos]; - state->buffer_pos++; - return out; - } - /* generate 4 new uint64_t */ - state->ctr->v[0]++; - /* Handle carry */ - if (state->ctr->v[0] == 0) { - state->ctr->v[1]++; - if (state->ctr->v[1] == 0) { - state->ctr->v[2]++; - if (state->ctr->v[2] == 0) { - state->ctr->v[3]++; - } - } - } - ct = threefry4x64_R(threefry4x64_rounds, *state->ctr, *state->key); - for (i = 0; i < 4; i++) { - state->buffer[i] = ct.v[i]; - } - state->buffer_pos = 1; - return state->buffer[0]; -} - -static NPY_INLINE uint64_t threefry_next64(threefry_state *state) { - return threefry_next(state); -} - -static NPY_INLINE uint32_t threefry_next32(threefry_state *state) { - uint64_t next; - if (state->has_uint32) { - state->has_uint32 = 0; - return state->uinteger; - } - next = threefry_next(state); - - state->has_uint32 = 1; - state->uinteger = (uint32_t)(next >> 32); - return (uint32_t)(next & 0xffffffff); -} - -extern void threefry_jump(threefry_state *state); - -extern void threefry_advance(uint64_t *step, threefry_state *state); - -#endif diff --git a/numpy/random/tests/data/threefry-testset-1.csv b/numpy/random/tests/data/threefry-testset-1.csv deleted file mode 100644 index ddfa736dc..000000000 --- a/numpy/random/tests/data/threefry-testset-1.csv +++ /dev/null @@ -1,1001 +0,0 @@ -seed, 0xdeadbeaf -0, 0x8dfd999efc587d2e -1, 0x3bf6c47ed872597f -2, 0xd82537743662be19 -3, 0x46103c1408067361 -4, 0x7346b65b404eb9fe -5, 0x4b83687af205cda8 -6, 0xc9cccc1fc1c330 -7, 0xf1998771158a2109 -8, 0xda5dc10ad259dbda -9, 0x4646e487520d8e1 -10, 0x159fc0e3e691e0af -11, 0xe2776a537d1a14db -12, 0xc1c7a9c84e1ebeae -13, 0x884ac2384b510f2 -14, 0x4884b09c9a60131 -15, 0xb13a1cda0d508af4 -16, 0xc3d21a2f212bfce4 -17, 0xa3b801d11d523597 -18, 0x1032f052626e5c62 -19, 0xd3b97f4372f6b7d8 -20, 0xd2982ca1c2af2372 -21, 0x13be3d71202f619 -22, 0xdace9f84ef1ddfa6 -23, 0x111bf9b9cd36c31a -24, 0x1ccc5e5be7281a26 -25, 0xa4cd1aa57030bafd -26, 0x99e30fc07a8990a3 -27, 0x9bfa5257d8e64ba2 -28, 0xfab6cdc7f1ed5221 -29, 0x85a4cf41ee744f97 -30, 0x1bfa09917b2906ae -31, 0xda161ec1288b8909 -32, 0x6b1b3ca2bd91573 -33, 0xcef3a71775de82e9 -34, 0xe8ca72781abf1c22 -35, 0x5b8b673b060631ad -36, 0x6658737a84dfe2a7 -37, 0x65a2254b602bb09f -38, 0x5ee6bfeadda0b432 -39, 0x8f3e8af494aeb36f -40, 0xd1c29d016aa72890 -41, 0xfd96891840f0e51d -42, 0x6103cebcf8398a46 -43, 0x7d899055702823a0 -44, 0xf9597bb3dce6d7e0 -45, 0x85b3bf105f26219 -46, 0xedfe4b32a28e4386 -47, 0x74f2415ce2908181 -48, 0x7de6c2f16372ca16 -49, 0xe2b29d517e17feb5 -50, 0x30d7ffc292038441 -51, 0xad4522ce80cf4c1b -52, 0xa9c79bfa1f31b5d -53, 0xc2f17eaf6c6fb057 -54, 0x27938c6a95a6663b -55, 0x239db1ec714acc17 -56, 0x8df60daf4949f4bd -57, 0xb2f6b97d127209d4 -58, 0xad58961f74c8596b -59, 0x6e920c60d6460627 -60, 0xc3839f29e9ce8be0 -61, 0x339161e608237aa3 -62, 0xf148b8d4fef7386d -63, 0x2cf8bd6438b2a52 -64, 0xa1e432e4a618e741 -65, 0x56e1e56517151ed5 -66, 0x61e528b5a3f6d4ce -67, 0xcddea3f49d6ded23 -68, 0xf966618d29452959 -69, 0x5d4fb65eb30e8f28 -70, 0x4a913ea38620fee5 -71, 0xa00f4c5528a3b760 -72, 0x1ac5a2ce0486d8ab -73, 0x521ca18c998b8d5 -74, 0xb0779142f4d0bd69 -75, 0x22f054d9131f1fe8 -76, 0x8c45b6c48016430d -77, 0xbefe70d6c6f8727e -78, 0xc581436cc4c2c0ea -79, 0x5864d0268e18ee15 -80, 0xca47fe47d22aa5e6 -81, 0xdffdbbc0db7ad425 -82, 0x2ae423bd73de5d15 -83, 0xb83b4651838308bc -84, 0x16fa5f72b53c5d6 -85, 0xa0b6cb353724ac01 -86, 0x64d4dc2db97a7d36 -87, 0x79ccd3dd98b33cdb -88, 0xadda2d6132e73ebe -89, 0x7d1a82eff9dba6ce -90, 0xc27defdc4f9c42a7 -91, 0xe12bcf2300cc0585 -92, 0xdbc65c0ee8511e31 -93, 0xaa9a1edff55c22cc -94, 0xc007f355f38dc50c -95, 0x4fbed1aca4bf4222 -96, 0xf137a501255f8852 -97, 0x416ce22d2c6b8e4d -98, 0x5f9fc6ca7a7e9000 -99, 0x9133f67a9222cbf -100, 0xb5fad01321365bfe -101, 0xe3e971e5481249d1 -102, 0xb2950204c847bc0a -103, 0x7ea97815ffa7d45a -104, 0x482c5be26c8bdf3b -105, 0xe42e7e3114197d0a -106, 0x3b74ae3e10f20ae7 -107, 0x92a5e6eca6ce4c38 -108, 0x951ef146ac76378 -109, 0x282f71a81cf08455 -110, 0x3f267412ad1483a5 -111, 0xa5b91846efa301ef -112, 0xaa31cdcfd08603b5 -113, 0x2e16b10730082c4f -114, 0xbdf14631f750e96 -115, 0xd008abe07ede91b6 -116, 0x994ee56c08ff60bd -117, 0x53f0ce17c7c350b9 -118, 0x4c6f01008b3f93 -119, 0x575ee5e7fa184714 -120, 0x83ef0302e14bdc0d -121, 0x5bf2a34323954dab -122, 0xb489e8c4c51a8683 -123, 0x4c9e9801a6acaa07 -124, 0xe9d2e19c20612fe0 -125, 0x2ee2ca0a4d83aa46 -126, 0x19d3a90895d7773c -127, 0x4130367c3abf9b1a -128, 0x1163968e394a67a1 -129, 0x67ffcbbfe478276c -130, 0xd57b578ec019ce0c -131, 0xb455156a987ea010 -132, 0xa9b429ce5f337432 -133, 0xff84cf0f673cc4c4 -134, 0xf034b32b302d0953 -135, 0x9bb6bc59375bbf53 -136, 0x44a2d4bc278da710 -137, 0x78023c9fc08e6247 -138, 0x6b27a1397bd5d278 -139, 0x193758c805b28105 -140, 0x28b88044af4b5313 -141, 0xdf32108c3da9cbc9 -142, 0x6cdb5ffbc5b589e1 -143, 0x702d9691e509de76 -144, 0x405cba179f3db3b5 -145, 0x73d44e0be3ac8048 -146, 0xf9d578eed861f37d -147, 0x9d04541aaacab238 -148, 0xce4507880b30adca -149, 0xaec02613164bec9a -150, 0x346180904e9beade -151, 0x624adb9e18bf4dca -152, 0x3ad2ab92b1f11b23 -153, 0x7d5ae064eee4f228 -154, 0x4e2bb6e3851953c2 -155, 0x55bedadf90ddfa04 -156, 0x4f9422b9142c837b -157, 0xeb5592fb0a763ead -158, 0x3ecb85424422c74a -159, 0x119bbfa61eb2222d -160, 0x6505a8c9e46616bf -161, 0x57bb55ae533b24c5 -162, 0xd6cee34b85233f67 -163, 0x7ea146f8a6edccf3 -164, 0x76615fab897424c1 -165, 0x6d79fe83053e2769 -166, 0xa2759466a39a899d -167, 0xc71216f7edc5fa52 -168, 0xbad1fec86d6684f6 -169, 0xd461ed7882597a5b -170, 0xa437d1518e84a43d -171, 0x5f7d08235e202553 -172, 0xdd87bf84dd2ee070 -173, 0xf2be8b7cda72f89d -174, 0xb221c206f95bb237 -175, 0xbf0643fe5b908171 -176, 0x6bf7c1606a106580 -177, 0xdb356bbb10ea4eda -178, 0xe237835dd0d4690 -179, 0xe6c2fff624891ed0 -180, 0xe08936b04987ce88 -181, 0x2837dbe9582a2658 -182, 0x51d176aba32aba6b -183, 0x5e84cf73553b7d65 -184, 0x65ae1e2bfd16072a -185, 0xf1e5ba1a331380bc -186, 0xd635cc846b72af5 -187, 0x5b0ebda48c952d27 -188, 0x5e05122799559b71 -189, 0x58636876eda68987 -190, 0xbd7af40a48bec96e -191, 0x85c640b51a9f45f1 -192, 0x204a037b8e6e312c -193, 0x961e7967c267be6f -194, 0xa638d40cdc30c59c -195, 0x5a39715f059bdc4d -196, 0x672b41e8c97af455 -197, 0xd30fed911bba090f -198, 0x491a830b50c133b5 -199, 0xa17c651d10ef18d4 -200, 0x18c5ed30299ca860 -201, 0x422b896bb244bf22 -202, 0xc5f46ffd55ef2588 -203, 0x709cc6441b029ef2 -204, 0xf253dfa120c336c1 -205, 0xecaa82e7fbe74f55 -206, 0x2fd810efb17f6736 -207, 0xe7a25ab84fb25ed2 -208, 0xaf7193b55b4f2c68 -209, 0x2a759a4ee4a1ce66 -210, 0x16996f2d902284bb -211, 0x87d8c6d1879f76fd -212, 0xdc966392468278dc -213, 0xe41e4051d267adfe -214, 0x381a17ee5c0be0bf -215, 0x92f27f7e4d3316a8 -216, 0xcfc791e85c47d026 -217, 0xd3fdbf29fc4b3b9a -218, 0x42e5919e80dbe10 -219, 0xab84a06c93add70a -220, 0x4f09d5438a9cf6ed -221, 0x60e5a77f3e81cc62 -222, 0x86e0c8b80336e771 -223, 0x899c3c4372b18cd8 -224, 0x8e4b3213708a89e1 -225, 0x265ed6061b84ce2 -226, 0x80770e2169b55299 -227, 0x39fccaaf318d18b2 -228, 0xf1b996ca0a6b8dcb -229, 0x2d5a2497533e1bbf -230, 0x82e8bdbea5fd4825 -231, 0x96beae4bc404d6a3 -232, 0x6bd730a492452ec8 -233, 0xb64ebc3e1342d159 -234, 0xb1632475806f1236 -235, 0x2e753cfda372774b -236, 0xa071f3cfac5af1c2 -237, 0x2cf0268115fca199 -238, 0x79255186612c0e7b -239, 0x2ddda40d56bcea5d -240, 0xcae06b8e382dc2f3 -241, 0x4c4eeb5a29713cb9 -242, 0x9094b57b8a7d48e0 -243, 0xc770e33c1203b229 -244, 0x86d82971c2c93900 -245, 0x890e721300b7c4d3 -246, 0x3060aab5f8cac918 -247, 0xbe1eb72ed892942e -248, 0x7c9dd3cb08d8b96c -249, 0x5fd00ae5885d5de9 -250, 0x4417cce0c28a8c3f -251, 0x43cd3a2dc30b89de -252, 0xc2cb18532d9530fe -253, 0x28abfd68d23173ec -254, 0xc4d76303811fce07 -255, 0x59bd12a60ec03a -256, 0x34d7ccec03c71605 -257, 0x8b75d9264501f015 -258, 0x7cd57fab83c4a0a0 -259, 0x8da871dc3cbc9eab -260, 0xb584498a027618eb -261, 0xc6e40e951710b610 -262, 0x41178da78714af7e -263, 0xd23bf6c5d4f72956 -264, 0x96a7e56e7cd445aa -265, 0x9a0c33f1026bc110 -266, 0xa9e827283fabfb28 -267, 0xc5db920653ca6532 -268, 0x7d7c2798440bf4fa -269, 0x29c67ba6461f747a -270, 0xb8714cd0b123302c -271, 0xd3dbfaad42155417 -272, 0xbf7a42afb38e35b2 -273, 0xc68987e460f75e2b -274, 0xc1870d0d8b3749d1 -275, 0xedd865f6c4742810 -276, 0x97257a657fb3cabe -277, 0x7481e43145a8d41 -278, 0xd5bf38b5e9dafc7f -279, 0xd79afc7b1005e7a -280, 0x6ad40d65e9b5a5ad -281, 0x65075c2e32fff49d -282, 0xd1be9510a7f3b969 -283, 0xd07acc1e3f6eb257 -284, 0x41dfff9ffb08776b -285, 0x2521ba1b48ef458c -286, 0x178fdba8b65a61c5 -287, 0xf72679d974b82e5b -288, 0x723c29de610d0b12 -289, 0x84726f3e749c0c1 -290, 0x7316136529dbbb9d -291, 0x62d5c6fcfdd7b104 -292, 0x5ed0a981f49819f -293, 0xedc777d4f5085908 -294, 0xd1758061e06720f3 -295, 0xccdf37b1a089e664 -296, 0x4c7eccdfcc38b22e -297, 0x3af579b044760f54 -298, 0x4ebb096a5a14053d -299, 0xf84f1e6aea913534 -300, 0xab8187a201171f -301, 0x2fdd889a5b23ab70 -302, 0xae0894fe8c9356ce -303, 0x3c98be30e5ac171f -304, 0x566953af2a7a305d -305, 0xb15bb69ebd40f8bf -306, 0xeefca1ec57e47780 -307, 0x88e3d9a3377cd873 -308, 0x39ed63117f8e1ba5 -309, 0xeee20fabef374e5f -310, 0x836c24fbfe91a231 -311, 0x9de79447cb2301de -312, 0x8e3028226501f563 -313, 0xede195f88a8976fe -314, 0xfa67e7f210a9ea65 -315, 0x33a9286c9cc0519c -316, 0xf293cfc77d255e0 -317, 0xcfd8e6a385302439 -318, 0xf801e78f6bad9935 -319, 0x831bb783f70bac85 -320, 0xb85b9b1e1dcdf06 -321, 0xa41009e83579efac -322, 0x9095c71cf018e4d -323, 0x2ec789714277148c -324, 0x46067636a9ed2f33 -325, 0xd9385c2b49db3d95 -326, 0x69102374c36463aa -327, 0x94dec24132bb3042 -328, 0x81c5ff32132d8a4b -329, 0xa9cf7ef654a14c5c -330, 0xcea3e704414db905 -331, 0x9b8ad73d3cecbe73 -332, 0x59c3613f1f59c91f -333, 0x96becdd5d3d6eb7e -334, 0xe532174a0e32c691 -335, 0x52f9ef72eb3a0e0 -336, 0xc47812f381b1034d -337, 0x112ff07cbc1d95d7 -338, 0x8af49fc2e11d14e9 -339, 0x5f0bb0c8e6d38f37 -340, 0x5c92bc8be957afbd -341, 0xe8f175d0f89fd52c -342, 0x76223aa3b45638b3 -343, 0x3e68dc64b3402203 -344, 0x7a1da1d307e31444 -345, 0xd0eb8f54e2fab68c -346, 0x44182e518700331f -347, 0xf149093ac30a395c -348, 0xfd23f8f75c25fcfb -349, 0xfcf727ca90f9e4b7 -350, 0x85dc5c47fd81b61d -351, 0x72b726cf22d2f20e -352, 0x3f57ccd8f6a33bce -353, 0xe363ae312c97ec06 -354, 0xfde8b0a33423ee87 -355, 0xe8c89d34bb501e9d -356, 0xbd4d8774ebaf9046 -357, 0x40333dcde4e889d0 -358, 0x5c31d5695aaf7a18 -359, 0xc168172eafb6021b -360, 0x1bed01cec3613e8d -361, 0xdeb623f4effcfd6 -362, 0xd02f73c698f24935 -363, 0xbae9cb97df30d4b -364, 0x2c8dfe769edc25ee -365, 0x768041adc56396be -366, 0xf11f31e14bcc8f86 -367, 0x1cc1ac84b5a5eef8 -368, 0x7cd911d41054b0f8 -369, 0x60228e0c35106ce9 -370, 0xa92ac07cfd218b7a -371, 0x6e0ce56984fd6817 -372, 0x780b1c87423fef3f -373, 0x677be089b5bd8fd9 -374, 0x2454954f7e5c8c0d -375, 0xea1d3e8e67934975 -376, 0xd0199f2ad1c5b0bc -377, 0xa7961b7893a67372 -378, 0x28517fd857003446 -379, 0x69cfc7298d4f2aab -380, 0x14e673667c3a9c31 -381, 0x3d2326c751b57454 -382, 0x323f62bc000f68f6 -383, 0x58c1b8561f61d24 -384, 0xf4cb934358649f62 -385, 0xa4268dd0327460a4 -386, 0x922dcda4b4062a54 -387, 0xe1c77cc9775004a5 -388, 0x4d6648be23d1aae3 -389, 0x36e66b76d509f22f -390, 0x98a79de81ada9683 -391, 0x911308910ad0d0e6 -392, 0xa78a75232eb9c534 -393, 0xd1620acff1293f3b -394, 0xc2564f1312d27a65 -395, 0x70d5a4d369a56e95 -396, 0xa27a741994153da7 -397, 0x3fd84f4095c66967 -398, 0x8370c9ea207fa4dc -399, 0xffef37922d7c15d3 -400, 0x10bc39f6a7575b21 -401, 0x6ae92a96b97e1f1f -402, 0x8adfba7ab6ca7a72 -403, 0xdf1b40629ce3a3b -404, 0x55d0451d15de716f -405, 0x2bd54462ff147e0 -406, 0x676723dc7af24d1c -407, 0xc3a7f70b34988a83 -408, 0xe716a0967a8c69d6 -409, 0xaf124e06fc7cac59 -410, 0x7951c1b7294d532a -411, 0x543e87364c521abc -412, 0xff5c44c50d4ee584 -413, 0x4a20724584833ef2 -414, 0xf605912a8c86b52e -415, 0x58e76b9dfd4da8db -416, 0x2279cf8b4a4f8894 -417, 0x99e4535e58af23e3 -418, 0x98b357e92d197aec -419, 0xb665faf7ec3c5892 -420, 0x74ff68056822f96c -421, 0x2443b541f675a9fd -422, 0x2ddb1042d52c00ae -423, 0x53bce4d472853bbd -424, 0xddd12064af825de -425, 0xd9e451ebb7871b0b -426, 0x284e8b62b5140d39 -427, 0x392f6f741ec18b5c -428, 0x53c1471d27c62d28 -429, 0x957c668aaa12dcab -430, 0x905899dcc9c8d748 -431, 0x85b9cdbb0195492 -432, 0x3285475338298b0 -433, 0x362aec5454354816 -434, 0xaffcafd1179a163c -435, 0xe7303efbbc4f41fc -436, 0xe5bef7dc443e92f4 -437, 0xc30a00527a65fcad -438, 0x10f35ee768a411c5 -439, 0x46ab523cfd6f019f -440, 0xf96997ee80420b3c -441, 0xd6bd882bc6334bce -442, 0xce8082585fcccb74 -443, 0x10a585df3e216780 -444, 0x8bef43483e7359bb -445, 0xb88fc9f0de92ebab -446, 0x8f9f9ec7e1bcdc7f -447, 0xec0da8b08dbf8ab7 -448, 0x8967d7116f0ca59b -449, 0x3ec612e1c87c23ff -450, 0x5f4c5e66476f3c37 -451, 0x536d0ddad6830a22 -452, 0xce05b606110b2ff2 -453, 0xbc06b0392b8db2f4 -454, 0x109feccc811d2237 -455, 0x1c6d58cbd3717d5e -456, 0x4bf990f210d7046 -457, 0x98c0e58f2e655da2 -458, 0xe71155da62d7207f -459, 0xe619955157476acd -460, 0x5484ce353c85962d -461, 0x4f30e140971d815e -462, 0x1aee57fec03675c1 -463, 0x9d6ac96b29e5236d -464, 0xa8bc59565b8d58f9 -465, 0x888f185056d1ef52 -466, 0x32bf6f97834d5f3e -467, 0x4fda3ca53a0aad5e -468, 0xb06670f7d65dc538 -469, 0x3394e29fd0a067d1 -470, 0x29f7c702dcaa4d6b -471, 0xafc0eb498bafddbe -472, 0x5002c13e14be570 -473, 0x11b62a54a56e7468 -474, 0x15ae967503c5b445 -475, 0xa1282117755e25e4 -476, 0x247ae0993e30d491 -477, 0x328f519e2974c09d -478, 0x963e0c8c57e3a4e1 -479, 0xfd2d1a916eb9def2 -480, 0xa4625165c4cd23b6 -481, 0x935663b351deb205 -482, 0x4ec13ee6fd28c2ce -483, 0x57365950d55bcfeb -484, 0x36d56e4c073cb9a2 -485, 0xa3deb42d6419e3c7 -486, 0xc0a6b68eadab9a81 -487, 0xf99a94679e32a1e5 -488, 0xc42d64e664eb0375 -489, 0x323de13c4da53f9e -490, 0x548e4376950c3229 -491, 0x5d53452624beda53 -492, 0xdb8dbdc4d06fcbde -493, 0xcfae0fedb5744805 -494, 0x8d093170690f3ac5 -495, 0x31ad2ff1c80c20ac -496, 0x40c7570d7660805e -497, 0xdfc383cd341cc5fe -498, 0xa571fa523e56de7e -499, 0x5fe751124076e6aa -500, 0x6696c91142c1a338 -501, 0x5c2295e731cc37e4 -502, 0xea4759143aeafa7f -503, 0xf51103c2360f23d8 -504, 0x58a0e754c23434a0 -505, 0xc81291121fdac698 -506, 0x8679b3dc92d444dd -507, 0x9ec6662d4aecb616 -508, 0xb508daa350249f07 -509, 0xdaf489538ed15145 -510, 0xcb6bd65b1c81a90c -511, 0x7f5492214c7c11e8 -512, 0x875effe96d081ca9 -513, 0x1e35d4b75f19369 -514, 0x49029232ba45725b -515, 0xa73202231bebe958 -516, 0x8011e084a420d3fa -517, 0xe7ff845074367c35 -518, 0x3a9e9ddb2ff812c -519, 0x6f5e47f4aa71a356 -520, 0x91e5a3a77e5b008c -521, 0xad173c173829519f -522, 0xadf0a51b9dfe9e97 -523, 0xa8fb30c571be5e92 -524, 0xb78e79d25ff80064 -525, 0x120eeaa9accedc7c -526, 0x81020045a1ff2669 -527, 0x66a50f790048fefc -528, 0x933c1efb74bbabfd -529, 0xc5fc20f210302719 -530, 0x8151dec3094fabde -531, 0xd2213b923bf407aa -532, 0x78da0fc0b44771eb -533, 0xd3a628d7eaf1f5d0 -534, 0xf7e444d35eaaaea4 -535, 0x2e5a8469332422c0 -536, 0xc4e9e4166203bdc0 -537, 0x68b11509577357cc -538, 0x1c22ba556358f1a5 -539, 0x1130c889b5c71f31 -540, 0x68fd0def61e6a4d3 -541, 0xd91797bb9243ba7e -542, 0xa2230c8c22e607b4 -543, 0x777331fadde75233 -544, 0x5a10baebd665287c -545, 0xc6e37c206f8ef53f -546, 0x2153e16620a7a26f -547, 0x7c044870163ebd66 -548, 0x2a78dbc7b40026b5 -549, 0xe1b372326f13f738 -550, 0x1bd9ed17eb120bf8 -551, 0xd69aa5ce828d6f6a -552, 0xedb21795bc2fe078 -553, 0x9424cee925d04cb0 -554, 0x1487a67127236306 -555, 0xbb04e7bc49c9e892 -556, 0x7d2cb1fef10eb638 -557, 0xb2165be14331dfee -558, 0x608b006694436407 -559, 0xde51a803f31ecf58 -560, 0x2baad9e91021165 -561, 0xc5fdebb7bfe058d6 -562, 0x7d70f942899e39d0 -563, 0x6125c0830f211474 -564, 0x2b63c71b5e2257b0 -565, 0x38162d3452ce5a43 -566, 0x47d92f8500ecfe89 -567, 0xb4b0e8e986835907 -568, 0x64024e226440fdd3 -569, 0xef14e5e470056074 -570, 0xbd98e6483f249d13 -571, 0xb772dcbc1a4c59f3 -572, 0x39f88aee50df9b -573, 0xe1284ee3b725f8bc -574, 0x30b997b194c75fe4 -575, 0xcb8830869e416d6d -576, 0x96dda63deae7dd5f -577, 0x250cbc3004548474 -578, 0xd386e14eb6612f48 -579, 0x516613a018bc41ec -580, 0x3d38173562501913 -581, 0x8f95bbd2fe704484 -582, 0xeea5bc9616a584ec -583, 0x35a6ab8de8843dac -584, 0x9df0a94962efbd1 -585, 0xfdb0bd56c87735c2 -586, 0x8cfc1e372a8368f5 -587, 0x8b23d5fd3b5591d5 -588, 0xa67e55c12bf454d5 -589, 0xc1de05db8c87c9a7 -590, 0xc922075e71b9a176 -591, 0xb8411ab83c539350 -592, 0x6e3e5390e04bf51f -593, 0x265f5f4efd50c24b -594, 0xda4a0b190ed7e4bb -595, 0xe3b9badfb5f149f1 -596, 0x96b3c82ae413d007 -597, 0x6f0ad7739a6c754a -598, 0x8356ae17125221d -599, 0x7f54dbfd1bed2149 -600, 0x1db3446564c48acf -601, 0xeab66293c35e8bb3 -602, 0xec71de5e82111496 -603, 0x307d1ffb851f3ea3 -604, 0xe7763576290aa70a -605, 0xb54df18f36ec2901 -606, 0x1274c4c6b71070dc -607, 0xd5427bfaa1046f0 -608, 0x779d99339f644b2f -609, 0x408c3b4b6a634b96 -610, 0x1735ee7f87bb6851 -611, 0xa5780777c5f4d916 -612, 0x5bf9f4d091ee8ac -613, 0x72a16b375faacbed -614, 0x1cbcdedec43afe95 -615, 0x969f6bb71211f0d6 -616, 0x16205de04f90e353 -617, 0x3d8383b3ebca6fb0 -618, 0x10fdeba49ed28dc7 -619, 0x7db0d19d648a705b -620, 0x58e3c21bdcabf3d -621, 0x62a3082250cb2532 -622, 0xb253b1030f0b10ee -623, 0x83050c560043946 -624, 0xde988add6676546 -625, 0x40ff1d99d7afa3e5 -626, 0x2949dcd8f797c0d0 -627, 0x85b3588ea7d06109 -628, 0xe6158241a7818a08 -629, 0x874c0e4d8f133e8a -630, 0x802ef6fade0787ff -631, 0xc8f4c96631fd13bd -632, 0x1cc53ceabaae0621 -633, 0xa3a8215bac5844d0 -634, 0x3e9a46365495fca9 -635, 0x5b1a8b67d0cfff39 -636, 0xa4c00a256a7528d8 -637, 0xdb0dcabfeec2f50c -638, 0xb4b11e407e0ce53d -639, 0xf0290a216960acb5 -640, 0x647c256bc27149c1 -641, 0xa4c65fa3a1b3a384 -642, 0xcfc3a91aabff01f5 -643, 0x56af49b0be94e98d -644, 0x78192db16ba970bf -645, 0x8be6ab828ca60453 -646, 0xaec8783f7b08389f -647, 0xbf60b1a0a05822e9 -648, 0x773dcad583ad616a -649, 0x66c7c2accfe05b5e -650, 0xeaf428e3f8a86013 -651, 0xbafafbbea503ca83 -652, 0x12fbfe395a53b22 -653, 0x5b0803a9835dc747 -654, 0x6c104a7da8b0bb27 -655, 0xa8b88e467c4c4264 -656, 0xaf921baa5bf05a3b -657, 0x65ba0568bee94c6f -658, 0x20e4f7d26ae8126b -659, 0x1a21cdcb32a11571 -660, 0xb54cc85ddabf7169 -661, 0x7a96f253742c7ad -662, 0x6232ed42c7776d82 -663, 0x28617c73281c3332 -664, 0xdeb63b98b7f96fc0 -665, 0xa99b062863e06102 -666, 0xebf044bcefed86f0 -667, 0x6e3c394a7dcf0654 -668, 0xa8010615532d4185 -669, 0x7a848c300193a6c0 -670, 0x24cd4460125dc3ac -671, 0xcb7855b33cca6b82 -672, 0xcec13cf78f398d29 -673, 0x8ad170d6a9b257dd -674, 0x974e175bcd30d07d -675, 0xd354ce50f8f40865 -676, 0x4b28bba40a25dde4 -677, 0x6e7e9d53b8842846 -678, 0xa1a7effae10190df -679, 0xd04d564e0c0df5d5 -680, 0xffde7841dc21b687 -681, 0x9b1860198d2e41aa -682, 0x24a7d92cbcd7782d -683, 0xe87352efade1fe66 -684, 0x5f302e85b504b68f -685, 0xee93d343f09d8749 -686, 0xbfd683a06d5944ca -687, 0x325743a5a7dc38c7 -688, 0x7e96fe56f6884304 -689, 0x9bee81fb0adafed4 -690, 0x35e5b7dabf13f87f -691, 0xecb4fe689d3f2d62 -692, 0xc98df0a573051cca -693, 0x31344816b051aba -694, 0x6b74db489de2aeac -695, 0xbae6b717869cd684 -696, 0x9dbd5b6a5263c332 -697, 0xd2a84a6af9dd66dd -698, 0x6ec0ed649d6c0423 -699, 0x4fb425d69c495aa6 -700, 0x5f3c4bb82c849352 -701, 0xf936695a6db83ecf -702, 0x1850bca22a80a0e5 -703, 0xd682f6ac9f78d35f -704, 0x739ed6e0627599b8 -705, 0x2d1c3113339984bc -706, 0x1677a16b08764c69 -707, 0x1a46fe6b943eb342 -708, 0x45bc46da8e1ae218 -709, 0x6b899e934ca545d3 -710, 0xa49c7d04a14f01a -711, 0xf6cc946f76aee8f9 -712, 0xd57765ce52bc2626 -713, 0x9d5a611be45e54f8 -714, 0xc4e943fd1d93c8e8 -715, 0xf8bf900e053ae678 -716, 0x35fd93a2d3ca3ad0 -717, 0x28da11b273ad9626 -718, 0x4046bf1292aa4736 -719, 0xad2edd82a440e376 -720, 0x2d2e469cc5815e02 -721, 0x2bbdb981bd3477e1 -722, 0xf7e1ab492ae78b50 -723, 0xd8e8a2f1deb35bd3 -724, 0x38648d4e5ef1f775 -725, 0x66db82d34d00b6f -726, 0x29d9f8ee57bc77b0 -727, 0xdbd37997c9496231 -728, 0x99da76ed64137b55 -729, 0x41e94018a92a92af -730, 0xe9444b859466bc63 -731, 0x139ea8ec0363ec81 -732, 0xe5573db463b521eb -733, 0x91ee2c97612ff6ab -734, 0x17038e62d8d5547e -735, 0xdae84fda26485133 -736, 0xf32ca23f5fb0a2d9 -737, 0x874a456ee5fb95c2 -738, 0xdd0e839b975e3475 -739, 0x1d45382adaf65c68 -740, 0xe98fb57275e4f06b -741, 0x5680ec280f703935 -742, 0xeddec081cf938ff4 -743, 0xf6e156698ddc7f3f -744, 0x5653fb5f9493628d -745, 0x31128e4f1bb7abbc -746, 0x966392eb3ab3d294 -747, 0xc18f506c9bd5727f -748, 0x33f3861681488c3 -749, 0x88eea94d91f3ec4f -750, 0xc07df01a897cfcbe -751, 0x1273a8b06bb1a271 -752, 0x92eceeb94ee16b54 -753, 0x2372a2660388f673 -754, 0x12f0f9c80ae16123 -755, 0x192880a152ad8fd3 -756, 0x67ddde771ec9e527 -757, 0x29ef5b708626c4fa -758, 0xdf65824bc7e2f5d1 -759, 0xed186a843266c66d -760, 0x82bcae004f3c0011 -761, 0x3a00ac4e2aa8f1b8 -762, 0x14542fa617647e91 -763, 0xab833973b418a788 -764, 0xfff24c07ee1e1a8e -765, 0xc9483de3fa539f39 -766, 0x3ac2fe43b2865dd0 -767, 0x3fa95781cd250f59 -768, 0x306e75a4e686b37d -769, 0x6590018fe7123137 -770, 0x29fa6de7fe953978 -771, 0x235a7778eb3defcb -772, 0x4866fd1cbb1de581 -773, 0x66294fb38c3a4d1b -774, 0x2eba0e0b6a16a3a -775, 0xc416b8fce537f10e -776, 0x11b40b753610cf -777, 0xa800cb9afe30a55d -778, 0xc7843d545c02d7ae -779, 0x19d74191419fd649 -780, 0xed8d718b6f8c05bf -781, 0x321b3469a3b9f8dc -782, 0x558799f6b55c0ae0 -783, 0xb289b9140c769381 -784, 0xc96bb650d7a5d3e0 -785, 0xc2e92e33b8559b77 -786, 0xf4f5f6ae13188205 -787, 0x2ee80f197ec22d18 -788, 0x6d87c2241c3e6d63 -789, 0xd145a7a0a2e7b011 -790, 0xc62cd586690015a0 -791, 0x9f58724c6bb22eb5 -792, 0x1f4d76cccba65f65 -793, 0x2c8ef48d0ed3f00a -794, 0x4100357f24318944 -795, 0x99f50ea3b1e806b7 -796, 0x80b0b55abef2e2ba -797, 0x728eaa6f3dea3ff2 -798, 0xb9fe60138d05628a -799, 0x4670c98cb3b1c59a -800, 0xed88e42657806925 -801, 0xa5f002df4a0fccb8 -802, 0xec8c1a342c98136f -803, 0xa356077ed340cc9c -804, 0xe87cc8ce72c844df -805, 0x663b6b98d1b215f5 -806, 0xe8ad0986f0a51b9f -807, 0xf77e0dd6396d98ca -808, 0x16d0284cc96530d2 -809, 0x21dca6308157182d -810, 0x4e80e0e6a0023ddd -811, 0xec147ee76408744f -812, 0x7772e8a51336d259 -813, 0x5e951007cd864259 -814, 0x9921dd15ebef245d -815, 0xa094b493f836ae35 -816, 0xd7fab52dd503383 -817, 0x2b7f2d67820bfedf -818, 0x15a2ab3bb9a269eb -819, 0x92f10dfb889b32af -820, 0x38fd566d1787da48 -821, 0x2b1f206adf06f0f2 -822, 0x998729e56a03596b -823, 0x9caa4041b8b8284e -824, 0xfe10ef8016e923f2 -825, 0x5181ba35c1a28b42 -826, 0xeb61ed1495837bcc -827, 0x3a320559880e1a29 -828, 0xac1edb5359dd9260 -829, 0xd2ce3b57da95c407 -830, 0x4375b7b9f6fbba1d -831, 0x446ec944796ff6bb -832, 0xaec4b78b5e828092 -833, 0x58004da5a0c153e8 -834, 0x5a2a2fad35215a5b -835, 0xeaf28165ff768948 -836, 0xc082d63ddad8c91f -837, 0x283d10a4300609d2 -838, 0xd2b4552391560573 -839, 0x4fdbefb9e342f858 -840, 0xa43906a7198f7ef4 -841, 0xcef94695a5d3cd88 -842, 0x8296bafa49c5cea3 -843, 0x351e0421b7ce8812 -844, 0x81d394848a445647 -845, 0xbfda8ffeba72599d -846, 0x823c00f90918421d -847, 0x2bad7eceb840b4b3 -848, 0xed9ca1321e8475f2 -849, 0x33ca86b7634608f7 -850, 0x3351c775ea252a18 -851, 0x6ad518a58bbb6469 -852, 0x2114c295e612cd6 -853, 0x18ba78ee3c710e1b -854, 0xfef3c2f9abae434a -855, 0x2f2033652e9eeeb5 -856, 0xfa5baabf35fa10fc -857, 0x38f160d51e3019b -858, 0x455cbd400f87e960 -859, 0x942f1352c9b1445c -860, 0xc61f0edd263951da -861, 0xa447110dcc7921fd -862, 0x4c811f5af4e0cbb0 -863, 0xe997fff7a5939781 -864, 0x1224dbad82b23c97 -865, 0x65cdec93d671a0cd -866, 0x22990c95303470c8 -867, 0x40e6e0c576b97f56 -868, 0x53bf25c3c12b43fd -869, 0x1992bafa30093644 -870, 0xc80b6626b1b3084d -871, 0x46e018183031721c -872, 0x10b23bc65323effb -873, 0x176c121f9bd81f23 -874, 0x19047376d9ddd242 -875, 0x47c0b554263ae3d4 -876, 0x7d6c14c2e40bf7ce -877, 0xeb3c30a640d082fe -878, 0x5155bd10f1818c38 -879, 0x24ca5ce343390351 -880, 0xb9d7a5dfc4f89d34 -881, 0x1b8f0b8c3a3bd8b7 -882, 0x708ab95c219a2ffa -883, 0x1cf3befb2776fec4 -884, 0xece471e68eb13a0a -885, 0xcd9e646295c6ad1f -886, 0x63a5a97e805b58c3 -887, 0x6bdd3bc818330ba5 -888, 0x642a2e1992d481d9 -889, 0x60362b11bbb1cc44 -890, 0x5c10e85acb9ad8f5 -891, 0xb8ceba6af37425d6 -892, 0x855bdea1d7415466 -893, 0x108bec5b41275d30 -894, 0xb0fce44c3caed15e -895, 0x6e1d44a82e34b3f4 -896, 0x698ed735e1db5220 -897, 0xe4d427dcfba23857 -898, 0x85ad0edc6ebbccc7 -899, 0x7c9cd7bc58fa5ff6 -900, 0xc2f19c0d76f53615 -901, 0x773385c16db8f379 -902, 0x2bb9120cfa435e1f -903, 0x295961649184169e -904, 0x20de31c807978633 -905, 0xd36701dbda31b982 -906, 0x5551feb741996e9a -907, 0xf8aaad4d0c52434b -908, 0xce6f4b0dcaef6cfd -909, 0xdacbbb33921fd85c -910, 0x587a5cb0cf051eda -911, 0x42124bd99d594fa9 -912, 0x9ad4a203e1ba3c84 -913, 0x775b758d4944c2e5 -914, 0xa7276e35b33e62a2 -915, 0xf5657d537c6271fc -916, 0x69b45cfd145b352d -917, 0x8672a0e552f7dfaa -918, 0xd5c0b8f929f63c84 -919, 0x1062b14c01bf1560 -920, 0x3ae6927a61dc70e6 -921, 0x2ed5f06dc3ceef22 -922, 0xf79f417a63f1dbf2 -923, 0xf6a74c03f7ab1744 -924, 0xf2a8523818bb492a -925, 0x8db8ec62b7262a19 -926, 0x4ac507b9aa8ac0d6 -927, 0xe1db6db360091041 -928, 0x97205197883ee213 -929, 0xc83c6265be4a8612 -930, 0x99e84f3f743ec327 -931, 0x931ab84b78b922f -932, 0x900ebb02329a6201 -933, 0xdb720a24d6d93400 -934, 0xdd0de802d3780399 -935, 0x177fac072d4ff0d3 -936, 0x95f5688bd75ec33d -937, 0xce19d334b40b7c45 -938, 0x780c71636ca880c7 -939, 0xf8188c0626e3ddbb -940, 0x32ef96e74be5a76e -941, 0x8f9adc11e6ee08c7 -942, 0x860a6c1d95bd01f3 -943, 0xb19d517b4a3054d7 -944, 0x196cb745dc3a674b -945, 0xf611c20fecc9b445 -946, 0xdb0f8f14fbb237c4 -947, 0xfafc6fc52d7b483e -948, 0xcffd5779f52badef -949, 0x8a626e983ccfd9e8 -950, 0x8f2ccac91dfaaad0 -951, 0xbda4bdb3cc57689d -952, 0x2a8af26a1d17c1c3 -953, 0x9feab9b49105010f -954, 0xe2a9046372fe5c04 -955, 0xd55195108d63dd4d -956, 0x4702e92922745d80 -957, 0x423c590b3ef222da -958, 0x2b56e611f1272bbe -959, 0x90d65326f9c21b6d -960, 0x56777609cd5360db -961, 0xa35a55eabfc4d9c0 -962, 0xf6134f2e8cf2a92f -963, 0xfe7864a5510c499f -964, 0xb205f42b43d89001 -965, 0x2618c3eb687e9050 -966, 0x1c85ebb7eafb6c1b -967, 0xfe47cb43ba8f5e02 -968, 0xceed09f98fe493b4 -969, 0xe7e51b4e51c5e0bf -970, 0x53343be07ce85327 -971, 0x816a17136951159c -972, 0x92adfb8807d45418 -973, 0xd6eaf3cef3390e14 -974, 0x6d7c2adefcdd411f -975, 0xdcde0a6376ecb43f -976, 0x47d162d5a140ea78 -977, 0xf55fdc7283476df5 -978, 0x2f66d5d029982dfe -979, 0x56a94f1fdf81fb24 -980, 0x46eeed06237aa921 -981, 0xb5f585d18b026038 -982, 0x29e12cba3b5a03a1 -983, 0xb8433a70685341e3 -984, 0x4e86f031c2bf4939 -985, 0x7167c51db1d096e1 -986, 0xa300693a1ce05ff7 -987, 0xddf7f5ef8994b6f6 -988, 0x5c99ebf9a1eff32 -989, 0x441bbc76e92979b5 -990, 0x7724f07eaaf30a94 -991, 0xd9946d64346a0d59 -992, 0x3d49489a6a952877 -993, 0x2b4846d1c8f4bc56 -994, 0x1d5f7891a6caaf50 -995, 0x7f9f458f479c6677 -996, 0x9177526a634cac18 -997, 0x82b316c3ba3cea55 -998, 0x84d769b6ffd7a5d6 -999, 0xa1230c54cf6f4b5e diff --git a/numpy/random/tests/data/threefry-testset-2.csv b/numpy/random/tests/data/threefry-testset-2.csv deleted file mode 100644 index 275604557..000000000 --- a/numpy/random/tests/data/threefry-testset-2.csv +++ /dev/null @@ -1,1001 +0,0 @@ -seed, 0x0 -0, 0x6dc04d22e096eea4 -1, 0xb8c023f98cd7ada0 -2, 0xa7efe930de644973 -3, 0xe05ea045a0add077 -4, 0x404ab9dfd366d169 -5, 0x4d42fb74611bbd30 -6, 0x9343a758211b6d70 -7, 0x4dab40877197665c -8, 0xaa7b143cf838b109 -9, 0xcad1f00ed5cea835 -10, 0xf7c7d7d6c9a824a8 -11, 0xf20b64a5b42100f3 -12, 0xe155fec329e4ff46 -13, 0xe9db5c878d78e4c5 -14, 0xe96ecf5f3d8434fb -15, 0xa4a5369e8b676159 -16, 0x26f540900462fdc3 -17, 0x805e684c0bf0600d -18, 0x950c55250dcb9322 -19, 0x1df00ab0d9a5f9fb -20, 0x2e75b8e9fb48b88f -21, 0x8982e680b983b07e -22, 0x7c730288ec003204 -23, 0x8d4a42efba070902 -24, 0xcae4317a285d026e -25, 0x587af8ba811a8883 -26, 0x236cb94da85e9409 -27, 0xf4d25c2e0d7b2bd4 -28, 0xd51e53d74420f649 -29, 0x29f9ad48909f580d -30, 0x39e2a46d5962fc7e -31, 0xd40bb4045f9288fc -32, 0x86d6d29c0a126484 -33, 0x198289c6d8589ec8 -34, 0x5c4ffb186e8f69c2 -35, 0xeaa9fe626ca6f961 -36, 0x58816ea059f6b7ef -37, 0x9a636de4086ed493 -38, 0xe5a2b327a52f6500 -39, 0xa6d200345a8c4135 -40, 0x8ad50053fae7c70c -41, 0x1afd6de09771e167 -42, 0x7372d8a4cfe85c9d -43, 0xe2a99f3770165e93 -44, 0x193e99ffd7b45a30 -45, 0x4af13faae1f4ee8f -46, 0xe799ae38aea2a54a -47, 0x19bc5efb105b9b55 -48, 0x428799856ed8d2b5 -49, 0xc7e1c76dfb93b581 -50, 0x1c8000fb2afbe108 -51, 0x5d217734dc6fdcb2 -52, 0x4f9b436f2fa7b5d -53, 0x6c6a8e841f5f7f2b -54, 0xf7af258a895489e7 -55, 0xd4afe725c6deee -56, 0x11959dd7c1a0e56e -57, 0xa82b5a575ba9234d -58, 0x356bb807c17fe67f -59, 0x4113ba7ea9234d28 -60, 0x87c7fef17934c764 -61, 0xed5d2e29701db2ce -62, 0x4b4bf08b62160f5f -63, 0x32057a60eda862a5 -64, 0x446b5409b56a9311 -65, 0x31e84acfaf48c9f7 -66, 0x8951479289443c2c -67, 0xff84ec0fff1b3d23 -68, 0x3db2e8a284e2cee5 -69, 0x2c8aca76f7caab8e -70, 0xfe8ff095676417ee -71, 0xbb7d6ed0c641e84a -72, 0xd862d2552159e272 -73, 0xd320d329cd2b0419 -74, 0x41bd59f68a0fc99a -75, 0x1adb5cf5cc0462d9 -76, 0xaa152c0b16d38826 -77, 0x1358fc52142b5523 -78, 0xdc29465d24a25fc2 -79, 0xda86700b570eaa33 -80, 0x461c6b79f1aea5da -81, 0x4dcbf7406497da6b -82, 0x5f9d552eef82e555 -83, 0x27261b525e6c02df -84, 0x75076fe041440603 -85, 0x7cb47c620018a06 -86, 0xd7b7d17c3d1ee39a -87, 0xbc7eada7c2ebc70 -88, 0xcac816c1d36ebb7e -89, 0xbe1fd6bcb3d795a9 -90, 0xbd822d8f1edd205b -91, 0x5c0ebf018ade95fb -92, 0x9c6ee7cca010ad02 -93, 0xa210e3829a0b1b62 -94, 0xf5b25b53e25dba71 -95, 0xa4a69d9d6e73b9a2 -96, 0x2718cf614f82e185 -97, 0xf5aaf0eefd4f29cc -98, 0x343f41179d6056be -99, 0xc897506f84b7a9bc -100, 0x547ce04e8810e66f -101, 0xf61f6f95782be285 -102, 0x522e0fa1964a631f -103, 0x500fe922b3a102ca -104, 0xd39b38e1ae6f8218 -105, 0xce6079eafb932dc9 -106, 0x2896e00f1fdb8c46 -107, 0xe5719f1535cd23b4 -108, 0xc4d4dc27f6393389 -109, 0x95b3c17025e7ea85 -110, 0xcea3f280dae8ebbe -111, 0x6d91c862fbf2fda2 -112, 0x99c5197b21f1f444 -113, 0x9ddb59c15db5411d -114, 0xd6ed4ec1b494f92e -115, 0x3270a479f7e1fcd7 -116, 0x79e8d185e02ad6e -117, 0xe548786a4c6309fc -118, 0x1dd3bf9d9f3fc9ed -119, 0xe52ba084f8713b48 -120, 0xbd6c473054430deb -121, 0xaedf39aa96279c3e -122, 0xaa3a7bbe2fd381cb -123, 0xa087544796e01cef -124, 0x6596602a719be04c -125, 0x282a96eaaa790ee1 -126, 0x313b3f42aa9ce4 -127, 0x9998a73e798ea881 -128, 0xf51dc8e618571e13 -129, 0x1df638afa23f4d8d -130, 0x26385330319db8d5 -131, 0x1e1912386c519544 -132, 0x46c42a55ab556cdd -133, 0xc049b83a6f04efa2 -134, 0xecd2d18baafa8af3 -135, 0xc1108f82d1765b42 -136, 0x7dcd72d9f729db44 -137, 0xfa73627c9a20cf11 -138, 0x9ac69ccfda0ee7a8 -139, 0xd02f2c2c1776c62c -140, 0x75b4da786706ddeb -141, 0xeebe6ece4a516bdf -142, 0xf274b3ee4fb7ff3d -143, 0xd4b1093bd35d25c8 -144, 0xc341c37b9cfe28c9 -145, 0x32c4fb8e8e6aea6 -146, 0x4adefc5712ca8606 -147, 0x750302d8f108d3f -148, 0x76e6e3259264f240 -149, 0x31c6db85c206dc2d -150, 0xda47cf5e8d07c49 -151, 0xc5939dd565786002 -152, 0xa02e5128b7f04e77 -153, 0xea2e5fa9ffdad0fe -154, 0x7b1f9bcb5578cc5e -155, 0x3fe776dc8398e6a3 -156, 0x31b97c4a0973fc4d -157, 0x29a985a2bb602d89 -158, 0xe6a76cfb1a5c0faf -159, 0x4f9f62edb1e6d19a -160, 0xa589097a26f2b615 -161, 0x6bca21ae81e149ad -162, 0xa6570f8fdbf98af4 -163, 0xa740f226d53bc40f -164, 0xf0a4fe08ab331d24 -165, 0xdc1eaaff2c67c65d -166, 0xf227a9a3e89a7271 -167, 0x1f539a105ac9a7dc -168, 0xdf2fc18d2f4004ba -169, 0xc36711f5ef877b67 -170, 0x29e30f4b30ad39a9 -171, 0x3af92a16534fad9e -172, 0xf66e30d65df7faf1 -173, 0x2594f6d925228c49 -174, 0x8b8b3d9f20fa8a67 -175, 0x88e8d38366cb411b -176, 0xe881af89393b5a8d -177, 0x2f190890e152d243 -178, 0xbca3c2b43bd2e2ce -179, 0xaecb17f2dceb2ed1 -180, 0xa07f556a40d4dab4 -181, 0x59c729c94cb2b4c1 -182, 0x5364cee304495a05 -183, 0xa628681d16e0c604 -184, 0x40e2f3e0d9124851 -185, 0xb3da737ef7918179 -186, 0xb946e59c4905271d -187, 0xc079b7dd74752ccd -188, 0xfce4f9ef02e73130 -189, 0x86baa280d2d9aff6 -190, 0x778ae7465aca2696 -191, 0xcb1f60b74f32078b -192, 0x71bf826587c2c1f3 -193, 0x7ad5d51794ccc972 -194, 0x4b6ae15708464071 -195, 0x86c6829137a4110 -196, 0xc002aa2f64a5283b -197, 0xcef3ae65b916b6bb -198, 0x1e691414155bd2ad -199, 0x9fc613bcc3a961a0 -200, 0xf55caa38c2b7866f -201, 0x3aa6008a705ea431 -202, 0xc1587b4c3d3e6146 -203, 0x56e5eb96d0556293 -204, 0x796730a5bde01777 -205, 0xf4b5de3097e501a3 -206, 0xb5a2d840b9e7737 -207, 0x9059674f6dc9db07 -208, 0xddaa8f7b09773c74 -209, 0xce2e4850507c2b27 -210, 0x2d1dc2977de11249 -211, 0x335e7ef86408ea2d -212, 0xde7bc6f22af7ad0e -213, 0x4a36bd6edb976e6d -214, 0x8eaef966a64aeb94 -215, 0x7689476d2572797a -216, 0x4635219f62159d76 -217, 0xfe9958903e4d4ae6 -218, 0x288d7f77642371c4 -219, 0x2f17b9477da7c2e4 -220, 0x4a987e3814cbcb5 -221, 0xcc2ddf12905e9c9f -222, 0xf5cba7330c86853 -223, 0xc646ecb698e336ce -224, 0xc05d862c10b83e50 -225, 0xa673040049fdc79d -226, 0x52871df3f523fb29 -227, 0xeae829e337d8a5cc -228, 0xb17d70979ea53cd4 -229, 0x253a9e29eef246dc -230, 0xdc09f4831946ef53 -231, 0x15a4034a8917e29 -232, 0x57246ff6c9594b8 -233, 0xd80620e906fd1cf4 -234, 0x861bec5cd30c08ad -235, 0xc58f38b68714ccf0 -236, 0xd21c19157efdd920 -237, 0x51e1b8f40b8045a5 -238, 0xfd56fa4ceebbd2e3 -239, 0xcee1959a7f9d12be -240, 0x75f22e1dfb5ade8c -241, 0x3b87a61bcd763482 -242, 0x4018fbdbadcc95e7 -243, 0x3ff57380e846b8ab -244, 0x7e44c8a4005515ed -245, 0x824c847c6767640e -246, 0x2b34ef279cdcf5d1 -247, 0xfd0bfc2786afed92 -248, 0x7faeff889a39834a -249, 0x37a6cbda4f00e6c7 -250, 0x4214fd32c40b0894 -251, 0x4320e334bfd18ed6 -252, 0x74b1f0c2812db646 -253, 0xf48232c0988ea643 -254, 0x5841c46c56967a29 -255, 0xb08204c4c9e83fca -256, 0x2a0bbd0b42a4a708 -257, 0xfe76573ec821c87f -258, 0xbd2e46ac0feeb0d9 -259, 0x3552a2cfc1bdca32 -260, 0xfbdc96046c1020a5 -261, 0xd5d79356b52560d4 -262, 0xaffee5796b293a6b -263, 0x5ef4dd67d2cc9042 -264, 0x7204094f6053ba36 -265, 0x1a89384fd317d01a -266, 0x68129e5eaa1d4a28 -267, 0xcd2a9c8b6938cb65 -268, 0x434bb1bd9872647a -269, 0xeaa17b0b5fa27832 -270, 0x442e1c5fa8113c44 -271, 0x38bcc81ea8386d97 -272, 0xa653c2f1f13a54f8 -273, 0x82d74e165850f5a6 -274, 0xf4b9d5dce18bd047 -275, 0x2666dba219ea409e -276, 0x8ada69aa37a215b1 -277, 0x2cdaa0dc42ba5b64 -278, 0xfa7b44675ef531ad -279, 0xd87d4bc750795b22 -280, 0x562fa1b77f3c52b0 -281, 0xaec092b6afa4b7f2 -282, 0xc2dcf8735598f14f -283, 0xc65a4e439f790832 -284, 0x73fca9d888e184f0 -285, 0xaf38a6918896df93 -286, 0xeddbfe61d62902db -287, 0x2e8e831abd28891b -288, 0xdfea332c8ba5e7c7 -289, 0xb980b3ea4806e11 -290, 0x37f771e71cd26079 -291, 0x65b880af5cf288c3 -292, 0x69bef58494777df0 -293, 0x207706d3b013c1c6 -294, 0xe9b4014efb64e6e7 -295, 0xece0298dfad7da0b -296, 0xcfed2f0d392af845 -297, 0xfbb1407059436788 -298, 0x74e9d65370ea5662 -299, 0x6e8bce550b2c36a2 -300, 0xf38d767f77abe8de -301, 0xc6befbfbf4c57ddb -302, 0x9fffced31abe51b8 -303, 0x761beb850b4659e7 -304, 0x5af78afae250836b -305, 0xbe64a1bb37c08d0 -306, 0x5dd328d85327ba3d -307, 0xa43238b39aae76ec -308, 0x1f58743f079a14a -309, 0x8f2b1a8cbe77f565 -310, 0x47526c74521adf72 -311, 0x542062d916e30f3d -312, 0x2f3f86a12c7561eb -313, 0x725a6f82106fd202 -314, 0x5939d692a6203676 -315, 0xcd607e13aeae5717 -316, 0x12a76dd01d4e46d -317, 0xddc96ae023be007e -318, 0x71341b774bace597 -319, 0xf69db6a379f38d34 -320, 0x87cd1ea3a6629c70 -321, 0xadc8798060e39c27 -322, 0x532982fe9d77655b -323, 0x1c49d24a1bb2fb83 -324, 0xdcba3b57f87cf725 -325, 0x62b96a90dcaa0a3 -326, 0x89d704a4512cefe0 -327, 0x41685667b144aec0 -328, 0x49395424e7982bce -329, 0xb493878ae98f87f -330, 0x2b2a23e3696a5588 -331, 0x2bbb82d12da62157 -332, 0x98092e701b17da7 -333, 0xb55d717ca8a4d039 -334, 0xf4547583b84a03a6 -335, 0x9609c10b7e68759a -336, 0x2a60eea68cdb7812 -337, 0x15146ffa8acbe5ed -338, 0x521e3b2ca6e16844 -339, 0x27528ffae94c01c2 -340, 0xc5df652e08db6be8 -341, 0xba1275ce0594c2f4 -342, 0x9c66fc6882ac8cf1 -343, 0xfcc5c3e413a7dad6 -344, 0x8309532dc68a36c1 -345, 0x7f9351a45e66c50b -346, 0xa70e6b123bdbad47 -347, 0xad49d29da3a694b0 -348, 0xf198452973eefdaf -349, 0x53b7951ab7b24800 -350, 0xb226c827c5cf8233 -351, 0xea184af7dc0cece3 -352, 0x77d5dc22579d919a -353, 0x583ec0e8d8295fa3 -354, 0xac35b75b4dd17e0d -355, 0x7d273f1ef4ec8df2 -356, 0x85665ea56b49b5e3 -357, 0x7cc0ee21b59ec57a -358, 0xae595b1cf72dc292 -359, 0x4eaf57e8e6880fb5 -360, 0xe51931811683e382 -361, 0xdb29479871fc8dc9 -362, 0x9b2f9c40c6506d91 -363, 0x35ee0dbbf239bb06 -364, 0x40aa630242bc7e2d -365, 0xf3a3d9b2f5839a26 -366, 0x17e920c38a2e329 -367, 0xae28a796412706f9 -368, 0x3327dbcbf0cee5e -369, 0xdbca13ee810f8546 -370, 0x390f9a7560cd1a23 -371, 0x444085fe4b30b123 -372, 0x4a1dea59c8ffa505 -373, 0xc12708a6534b7424 -374, 0xc331d65b7dd17bdc -375, 0x4d1a64113fb84526 -376, 0x7af40a24916e7ba9 -377, 0xefc466d746e83001 -378, 0x631fb61962533374 -379, 0x355629ff71ec6c69 -380, 0x89e5c7e5a2b6b82b -381, 0x307fc816d73c725e -382, 0x3c7c2fad16ee2808 -383, 0x3db362fd0d93dc47 -384, 0x7c7d9b1ecc6bbc7e -385, 0xcdab8413e0b594bd -386, 0x3e45d66baf972abd -387, 0xbd8bdc23f1926e70 -388, 0xfbc61c9f0b6c1a71 -389, 0x68b9e52b65d64f9c -390, 0x5b371b49f49af63 -391, 0xdab60623156c1ebc -392, 0x14ed99c617db324b -393, 0x5c7f7b5f6db77c0e -394, 0xeae562127e55128 -395, 0xf5ff71155fca2c5c -396, 0x8271b2d1ad93bd4c -397, 0x1ca96341dd5b034 -398, 0x49265a39bf18e8d6 -399, 0x5bbe70cdacf51f1 -400, 0xbf198a70b59ff062 -401, 0x41058370f356a21 -402, 0x47e8c7127044ea -403, 0x3a031703f1e98d83 -404, 0x63db42df128a9d7b -405, 0x67360bba6d058db6 -406, 0x2cb06097a2bdcc21 -407, 0x9e69d402ec5ce471 -408, 0xef55f0fa21cde5b0 -409, 0x2ce15bd742eb7acc -410, 0x2f29a82fc4076787 -411, 0x312992a6d3fb93ec -412, 0xd9abccb15b2535bb -413, 0xdfcc55a43bad4c90 -414, 0x51ca5637dd4ea18e -415, 0x9be4b1911b1ae9f7 -416, 0xb835b284b26d4057 -417, 0xca26765b4414729f -418, 0x211fd5e340cd6f9a -419, 0x64984a44077081d2 -420, 0x859ea6fc92cbf37d -421, 0x99f190ca3756084b -422, 0x38549b8f8b5a7201 -423, 0xc3940c2807d34ed8 -424, 0xbcbcf498fa77d02e -425, 0x2c24b6360e1033d2 -426, 0x9602edbde8d9a850 -427, 0xbf4ce69ab0e00203 -428, 0xd479d334b0c716f3 -429, 0xeebd6ba9a827a3e1 -430, 0xea0b5cec6b42e089 -431, 0xded6e289584813bc -432, 0x9894568e6a3f4ab8 -433, 0x73ee7a9acd6f667 -434, 0x4c849a0da094f2f5 -435, 0x4fe6f5fe0f90f786 -436, 0x9887c17ea5f92327 -437, 0x318df65aa9a53d5 -438, 0x70a7bc8178292fd1 -439, 0x612a38a535b8e3d2 -440, 0x15a79aa16d0228e1 -441, 0xd3288c336eb0b33a -442, 0xf84e2fd1e4db070c -443, 0xa2efb0e34d0114d5 -444, 0xc528e890e7fa6409 -445, 0x4b837fde84319af1 -446, 0x632edec918b02d23 -447, 0xce980f566494c149 -448, 0xe54e204d31452188 -449, 0x9ca51e2e7fe3a3b0 -450, 0xb0a7183126df963c -451, 0x2de5fd96c125669a -452, 0x17ab43849b96549e -453, 0x49850d9bb767cfd8 -454, 0x632d44d7add93bf0 -455, 0x3fba66506af7b132 -456, 0xc06c6bdeaec6d733 -457, 0x3e7795ace33e8cd1 -458, 0x8f522c2f76ae3bd7 -459, 0xec883650a2d2b2d1 -460, 0xccb11ad5bff431bf -461, 0x936d66262607c537 -462, 0x3102298a92f643fc -463, 0x76078e8357fd5e15 -464, 0xf22a64a885d7e7ac -465, 0xe111261b30caa160 -466, 0xed2c2d728a8ced12 -467, 0x64e659163f8d1d71 -468, 0x8c7c5f696f55dbe7 -469, 0xf0bdb7e3168a82d4 -470, 0x1eea602c6df9464f -471, 0xa10d1d8502d43304 -472, 0x824245afbf95950c -473, 0x7b4a64e619e29d10 -474, 0x73d4d21a8f412218 -475, 0x3ee5be3d8af0bc17 -476, 0x78979eebb7bb7b9c -477, 0xe2acf9a6f17cb00d -478, 0x77d8f02baea98694 -479, 0xba80648f6872987a -480, 0x1cc1fa8be28d090c -481, 0x9df7f91ded8fb4d9 -482, 0xd5bc13c3dad13991 -483, 0xa57c268e5153f06d -484, 0x662f2e1fdc97ca36 -485, 0x1242a97a1148c369 -486, 0xa85178a88b821450 -487, 0x32fa270cddccdc1 -488, 0xd52af3c8d3d9ccbf -489, 0x105d4ee4420a2035 -490, 0x8ccec92b29bb6f3a -491, 0x7330a89b0ec713b8 -492, 0x712f7f946a661b8c -493, 0xdd11f248be047eab -494, 0x15aab9e558d04865 -495, 0x791b42bd188d3042 -496, 0x571a03a98b08d2c2 -497, 0xe8362e466304c2e0 -498, 0x690bcf82d6f7e815 -499, 0xf387d12b216e039e -500, 0xa1a0e6721cadf720 -501, 0xc238cd658c3c48b6 -502, 0x303d33d956cd19b7 -503, 0xb91002fb2c06523c -504, 0x3fd6c979ecc9e53a -505, 0xe709a011bbd9684c -506, 0x9f9730e4466b178a -507, 0x5d6a951a17dea6de -508, 0x8ad48c770be7ff5c -509, 0x840349738f1840ef -510, 0x62b71fa4d4713278 -511, 0xb54bc131be88e301 -512, 0xcd360f29092f1b48 -513, 0x51e2d80a7974e018 -514, 0x4716923492cb7c11 -515, 0xc5a3426512ccf92e -516, 0xa29da51d76692ec2 -517, 0x7760e22a2a966fa6 -518, 0x17027bb9ebea4f10 -519, 0x1cbfeb90083c7472 -520, 0x21df956d73e46 -521, 0x3d3f98cec3a0f9c5 -522, 0xcbb44f6843e8f84b -523, 0x5387cf5c8dc08f09 -524, 0x9874b020a7cd16eb -525, 0xb26656f3d0e54b45 -526, 0xf7535314e62cc2b1 -527, 0x9d98c18c8b832a78 -528, 0x4782e4a90afa6bb0 -529, 0x98a5b50793977e75 -530, 0x699bfd767f3c1fb6 -531, 0x2b0c137df6bff06d -532, 0x1dcf680df83ac493 -533, 0x41433da3b84a308e -534, 0xaa5b2dab82fd7a7c -535, 0xd35f4a2331f962c -536, 0xfed4b74303c0ee4d -537, 0xf9a9dcb35118765a -538, 0x4d09906765751e55 -539, 0x96f997988dbaa2ba -540, 0x761968dfdcee7a25 -541, 0x942f82665a09c18e -542, 0xa630ee4197ab0e0b -543, 0x68bfe324bbe3b7b1 -544, 0x8613dd09e8566784 -545, 0x3738178b0a67bae9 -546, 0x78678e656aa91115 -547, 0x6d182cdb34ba7a53 -548, 0x46749ef4e5670d88 -549, 0x2cddc1808c4018e -550, 0x22b2aae091c52f90 -551, 0xa4709bcfefd0d6fd -552, 0xade8916af4dd85f -553, 0x763c7e7df0416c26 -554, 0x78b365ba6d6416e5 -555, 0xadba0adf9c5b5e3a -556, 0x5a146cb126d32c3d -557, 0xa5f2f65ef03145c4 -558, 0x2708930e062a88a5 -559, 0xfc94da4d17e4d4fa -560, 0x78b500b283574f39 -561, 0xdb657f35be884f22 -562, 0x1de17d2450338525 -563, 0xc602ad9d8fe83980 -564, 0xc731d0497705a493 -565, 0xc3e443ea6c794843 -566, 0xb946fc377698953d -567, 0x98ad8f7f193cee5c -568, 0xa8da8ecd4301cb4f -569, 0x99ff5cc72e206b24 -570, 0x2422ef61bb3c9be4 -571, 0xea62c83986a29b61 -572, 0xcbcfb5a9953d1a6a -573, 0x229f258aac962310 -574, 0x8730e2f36b1fbf6b -575, 0xc3d6ddbe26ead961 -576, 0x814fc47c7edcbae0 -577, 0x23af1859cb36c99d -578, 0xeadfaf827ee1de0c -579, 0x15ac2339684c36d2 -580, 0x54c617fd9b17d56f -581, 0x8b88689c24920b0d -582, 0x5294092543a1f59b -583, 0xbcf7fadb518fad77 -584, 0x8e784c0359e6349d -585, 0xa45831bb0c97d3d7 -586, 0x1d0b8d79ab84847e -587, 0xd7f23d7e384fb139 -588, 0x8fc7ee55f1d37f0d -589, 0xc44dc853b1913765 -590, 0x20d40baab760366a -591, 0x6067cee1fc99a47b -592, 0x7927a7b24ecb93bc -593, 0x26819db47e3cd94 -594, 0x236853cd14a54aec -595, 0x36e7a2f60284be9b -596, 0xb11accb3a708d6e0 -597, 0x98c7651be6436342 -598, 0xaf27f94af527010 -599, 0x4ad2ef538542349c -600, 0x63becd7dc3d6fc6a -601, 0x8dfd8f874d18f093 -602, 0x2401cad63eaeaff3 -603, 0x7be4a82015531b1e -604, 0xfca36bc859cff476 -605, 0xbd3f9383a20e1fac -606, 0xee9e7e4bf1c444f6 -607, 0x4ad8b91ea66cd1fe -608, 0x85ffa6d1cafcc553 -609, 0x665f66043e6bf320 -610, 0x4d409c2d9cb23e6a -611, 0x1815b94fcb2e85bd -612, 0xbbb8439e003579a2 -613, 0x16dbe31fced48255 -614, 0xf4f7079142a17040 -615, 0x96df1c5c35e5c231 -616, 0x41fc7faaa1bd8cd4 -617, 0x6a51ef3658d4bd38 -618, 0x31e64c6ff2d1598e -619, 0x20f2f339395fec58 -620, 0xf329aaa477f87f9f -621, 0xfe461c3073c63ad4 -622, 0xa60ce6531c0ab64a -623, 0x527eff919a0305ac -624, 0x7708978a5d010a53 -625, 0x2ab687dab81f0ca -626, 0xa7af71e850497d34 -627, 0x8edba42a07e35155 -628, 0x45b4f3ae5e07472e -629, 0x29e3636e047b7c5e -630, 0x6ddd57807c1830a3 -631, 0x800e6743648c9cb5 -632, 0x921389557585d720 -633, 0xf2fa96f5bbdcafbd -634, 0x4f1634ad80d0bdcf -635, 0x7125668667218b0d -636, 0x23373d9919906087 -637, 0xa27ea3fbff83bd41 -638, 0x871cbab37176d63c -639, 0xe6939db32970f816 -640, 0xf3484c2ce0dd0481 -641, 0x76e8298b27b9d68e -642, 0xf966f9fb426c1950 -643, 0x4066c4f62c307e4d -644, 0x187ddce6f94afb2 -645, 0x656f00e6a70fbfef -646, 0x2ef17886ec419448 -647, 0xbd748ea59342e5d2 -648, 0x1f204c5d3c9428a1 -649, 0xc08854fa8992794c -650, 0x17d0f325121fc218 -651, 0x34c63c258a663b88 -652, 0x60f94e4cf248344c -653, 0xf9ffcbcdce936a7a -654, 0x93ac50ca4456c69d -655, 0xb9039b4d7dd82c9a -656, 0x117e3c6d6891e836 -657, 0xff6289aedb2ab5f0 -658, 0xd5f695f19d6786f6 -659, 0x8bab970181c86e97 -660, 0xee6be4ee832333fa -661, 0x648ea0623082ae36 -662, 0x972b001b4b4d4431 -663, 0x92fb47b9ff9b1ee4 -664, 0x792ed2bd14f8896a -665, 0xc98e2723d55b08d7 -666, 0x2a4f0b7da6210c89 -667, 0x19a1fb785fec7a64 -668, 0x937a44924b337455 -669, 0x26802ce94caeaefa -670, 0x604539849b56a532 -671, 0xccf6eeb0a664d39a -672, 0x545584db524a2307 -673, 0x8ce4edbc37515d8e -674, 0x1d548ba9281312b5 -675, 0xd0c51f891244ed57 -676, 0x3b464ba79600dd6c -677, 0xc28ae0f8c4db373 -678, 0x938e49fcbbe8941 -679, 0xf084e4c8d9799dcd -680, 0x61ca52d24bdd1083 -681, 0x536d617222724841 -682, 0x506cd8085d16a6bb -683, 0x422158a96747781d -684, 0xbd13ded440c16bb6 -685, 0x97913b1b8c2077ca -686, 0x5ab588aab438e8b4 -687, 0xf4c6831523402b4f -688, 0x91e962c39ccbbac6 -689, 0x861c95ffeeb7b7ad -690, 0x6b318a9abb0eb7a2 -691, 0xac4164b45978ce20 -692, 0x71d64942f1d72b40 -693, 0x1675fe85018ea357 -694, 0xe19ef9073183417f -695, 0x3e057316b3a37a7c -696, 0xaccd00b688c8fb36 -697, 0x8c2d1b84d24b89d5 -698, 0x4cc97086400b2631 -699, 0x38c2cb4daafa93b5 -700, 0xd44e889f968a38af -701, 0x53cf738410523792 -702, 0x487b1b84bd6f0ee3 -703, 0x1824ae549bfadd6b -704, 0x7b6654bfe0f085d2 -705, 0xa289e4fa5b2f971b -706, 0x24c971b485491f26 -707, 0x8827b700bb7136a -708, 0xe2871794cd6f7a2b -709, 0xa21bfa8e0e237703 -710, 0x8447f083c77d1be -711, 0x1b1d926efb334728 -712, 0x8dd2d4fed543c38d -713, 0xe69ba3c162cd489f -714, 0x3f9659c66b35acc3 -715, 0x45ac347675850ebe -716, 0x8e572a9ea7ec6b12 -717, 0xd3a11284b37761b9 -718, 0x8e276c1c9616b7ee -719, 0x7a03569e90501954 -720, 0x4ddd0afb9d3f2605 -721, 0x9342896d66482c8c -722, 0x9edca50722c69db6 -723, 0x3dff88b2257e3ae0 -724, 0xad92c2d56ccd8d11 -725, 0x81e6dc441c0b6df4 -726, 0x1a8a0d10f7326b8d -727, 0x8382991eb90958b -728, 0x9570d9b1a0527ba7 -729, 0xa1820138d6f96490 -730, 0x1c8c678ebb2aeb4c -731, 0xd782fddd578fc4ec -732, 0xc78d60cf41e509fa -733, 0x82dfbe4d435f747e -734, 0xd9a410610e4b3dca -735, 0x2d687c7a90220751 -736, 0x6838c5d233cff81c -737, 0xe2e64ef24f7b004b -738, 0x65c11d97293f0da1 -739, 0x53e2016d79145a35 -740, 0x3ebd6882b1de3c7c -741, 0xb1b47458c2b31ac5 -742, 0x4321907da2d2df2e -743, 0x57f211e1521e0eb9 -744, 0x25798e7fa3227f0 -745, 0x9e696273f7255ec6 -746, 0x784755cb23c3190 -747, 0xd4e82b43d8eb119a -748, 0x894047215bf58241 -749, 0x71545bb714d43bba -750, 0x3eb48187007c99a2 -751, 0xd3a03fe5a57dde89 -752, 0xe336d1bfc90141f -753, 0x13e5b11c8ab27b7f -754, 0x476e5d1c3f5ddb41 -755, 0x7e0987fb7ea434ca -756, 0xa7af6d90f6868d59 -757, 0x16be8514db2ba69b -758, 0x9358b7eb6b64161d -759, 0xc6e6e49346403b75 -760, 0xb8738eaf21cb369c -761, 0x65a2a7d3ad804624 -762, 0xf49f135e789969d4 -763, 0xf20a963cbeeaae3a -764, 0xd17e058559753d56 -765, 0x8e8bf41d9c4916ec -766, 0xe48ef68e5aa23dd3 -767, 0xe2f0001eda60c8bc -768, 0x5b99e00b24f1aa8f -769, 0x4ad710b2a99b14c8 -770, 0xd3aa3920af73ddd7 -771, 0x3d76e216667d1382 -772, 0xa8c330ec75317940 -773, 0x12534fc207bb29a9 -774, 0xd15c55c83b4a35e6 -775, 0x535e26026622714d -776, 0xb56782cf34123bc1 -777, 0xbd925db7098d6155 -778, 0x682df0f1e54e2d9d -779, 0xb330167f33195b63 -780, 0xe9658f089aea3987 -781, 0x2b095fe8bc8fb610 -782, 0x204269c3aa0af463 -783, 0xd1c858c4a6b68013 -784, 0xe2f281cf9ef91e34 -785, 0xc29a55f11e4479c6 -786, 0x12a8e1df7d6166 -787, 0xfa0b4dd7d67c578 -788, 0x6db2b74e2e42db1 -789, 0x478694b16b033d71 -790, 0x47a79614736e8c3f -791, 0x247e0e4d132cf874 -792, 0x22845b7634d0e71f -793, 0x9942faa26a68bb81 -794, 0x381aeeee89549313 -795, 0x2052200f6ff0d6ba -796, 0x5c9f92b675b2f641 -797, 0xe6b34f7a1e196039 -798, 0xe1b77d497bef7516 -799, 0xc59d1b80b7b3b30b -800, 0x819f5098375913b2 -801, 0xca0f73cffdaa9370 -802, 0x2f5bf935c691c5f4 -803, 0xecbd8bb256d09c58 -804, 0x43406aa69a99ecf4 -805, 0xf05f8b2ee179651d -806, 0xb7c70142a0228f54 -807, 0xfc2db144bec4b245 -808, 0x2abce886e1a45ebc -809, 0xaf58b72a59bca78e -810, 0xa52b038f4d4541bf -811, 0xc0d14bf583b241aa -812, 0xc8a1abd7115cf8a7 -813, 0xe02e5a30a769d474 -814, 0x56acfdbd29796da9 -815, 0xe7387234b8b03889 -816, 0xf1227dd110b8f9c1 -817, 0x8b124ad0cb62d460 -818, 0x97b7c747f3b13887 -819, 0x216f43a8fc2314bf -820, 0xaec316edaf92f3 -821, 0x10186bef157d36fe -822, 0xf37a7ddce615aca1 -823, 0x9b5b913d16158f6c -824, 0x59be9a31bf90f02a -825, 0x24170e196a66a0a0 -826, 0x589a9527086fc354 -827, 0xc5990d0f438d434a -828, 0x90eee29b52e7a094 -829, 0xb703a0dc266849dd -830, 0x6d0bff0ad3ad2faa -831, 0x91f7fc0cd9e78804 -832, 0xe86041baf693528d -833, 0x1efabed627bb50a6 -834, 0xb59397e5f2895f58 -835, 0xd07f3b88397416dd -836, 0x340f1719b497c11e -837, 0x284e6cb714f9b6 -838, 0x185fc6ffc0b68229 -839, 0xfa2deec9e6c26b24 -840, 0x62c6578b4b262188 -841, 0xad4109b1cc118f48 -842, 0xa395d493b26d6f0e -843, 0x325b4fe3d0dd4338 -844, 0xf91410de49c18d30 -845, 0xf07bf8b60923ce02 -846, 0x1423fe617d564876 -847, 0xc077f782126eb9cf -848, 0x2fcb2f20910e89ae -849, 0xc2bd451afd2e6816 -850, 0x77fb4184cb7d54b7 -851, 0x3f179aed62349343 -852, 0xd9186ae032d49425 -853, 0xb5eb57360137bdf8 -854, 0x3e4be92a340c6331 -855, 0x8429236eb3127098 -856, 0xdef72542e2b2b80 -857, 0x63a489df51948c4 -858, 0x8a7e00c797fde2b4 -859, 0xaf0ecdb100a40c24 -860, 0x5861013d27e2e75b -861, 0x755b9daf64e225f3 -862, 0x3d2df8752fc1f0a5 -863, 0x603430c7044c9cc1 -864, 0x861421e1eacce08f -865, 0x617e02ea4d46a34c -866, 0xb5a65006a14421c6 -867, 0xb0f80b679b414c72 -868, 0x9906164388248865 -869, 0xc9c844ffa4051128 -870, 0xca9d7bf3530f5c33 -871, 0xab16e556b494c5ee -872, 0x7221a1b8ef1aa54d -873, 0xc271845c7d1a4e37 -874, 0x6a76797104475a2 -875, 0x908e423fb8735430 -876, 0xb5bb58134b1677c -877, 0x9ffdd2ae9c3118c6 -878, 0x7e180fcd6840b8cc -879, 0xf94537df07d2fdc4 -880, 0x5cc348554d45bb14 -881, 0x3d4daf3c2b6664b9 -882, 0xfd04db3f786791ad -883, 0xc493d37c83bb96d2 -884, 0xbc9faef5435f86f1 -885, 0xbc65cb3d3f6e9d9e -886, 0x9cbf2ffa56e6ecd1 -887, 0x9250836b7c20ad40 -888, 0x4f5c0071a0db9a4f -889, 0xdc3f0522b1445aef -890, 0x7506e5599b850a1f -891, 0x81ed2abe0e2de08d -892, 0x240490146352067a -893, 0x3c77af13f5eea2cb -894, 0xa7f4cdb8ff827eb4 -895, 0x1417242e31ad2476 -896, 0x76016b03999f9478 -897, 0xf94521fac0306668 -898, 0x8269175893be1d41 -899, 0xfc753632a234f285 -900, 0xf612755268cace8d -901, 0xa14828c9024be019 -902, 0xfa70c71b9d1eaf55 -903, 0xdf1b71a62e31de5d -904, 0x5501951e0e1edc8a -905, 0x2f8f803b8df69cde -906, 0x574f363439f7da1 -907, 0xfb10c35585727813 -908, 0x749b3c2837397d13 -909, 0xf3cdd1febe8cfdc7 -910, 0xe394963ee5056211 -911, 0x577d7d7b18de73af -912, 0x47ab5d83b0c59c10 -913, 0x9dc8a3fadd1e6f9 -914, 0x83fe8257e75854d6 -915, 0x2e43cb3aa0046160 -916, 0x1dc475fcab4ac1dc -917, 0xf0bc49e0566ce0ec -918, 0xb603cdcf1f30fa6d -919, 0x526760cc6bb6babe -920, 0x7c1da274cfc404cc -921, 0x1e7f5020e4872eb0 -922, 0x5810d9ce7b4eb5d8 -923, 0x5ddd35b6fdc8ccf1 -924, 0x3384120a60586e91 -925, 0xbea2bd919e0f3ce9 -926, 0x5a5e242545609467 -927, 0x4bde47bcf26eb4f6 -928, 0xb0a735deefec6c20 -929, 0x68a22c177454e398 -930, 0x8c9bdb2d15db7858 -931, 0xcf3748c5ce8663d9 -932, 0x4815c2a33d2e0b89 -933, 0x8ccabff1a06d51a8 -934, 0x9a5ac9d5cd9bde72 -935, 0x1dc5a9d71a51705e -936, 0xbcdb2971a66f27a8 -937, 0x31b0cd0bd56e4640 -938, 0xf7efe6b1f1f5dabf -939, 0xc5c99d9b4fb22013 -940, 0x1ba119bae4d4fba4 -941, 0xf65a6d9da77cc4bd -942, 0x25cd9545d90e715b -943, 0xb7477672a3531ea3 -944, 0xcf247ec31abeebc4 -945, 0x7e057e2450496fbd -946, 0x38ef5e25d359c979 -947, 0x4c19225c27c2eace -948, 0x2f0a528453e09547 -949, 0x59c8f78eba33f6bb -950, 0xfc8e46c35ef2fd53 -951, 0xad32d2fb43958df0 -952, 0xa4925809889d9dec -953, 0x91511a8ded719be9 -954, 0x8bafdd3b61b109d -955, 0xedc9854399b02ea8 -956, 0xa50a9ba9d3f10ac3 -957, 0xbd94acf2d2a1833b -958, 0xcdefa8e500cb91d6 -959, 0x95d64c722dd9ce9c -960, 0x2593274b7561d701 -961, 0x9d5854a252f7d4ee -962, 0xd799bae55a43bac4 -963, 0xd56a4f738e03f65 -964, 0x9c100f2599fe70cf -965, 0x1fb9b7564fd6984a -966, 0x16ca3ffcfbc77ab5 -967, 0x3a98bb3993bfe243 -968, 0x7fc4a69a94fc389e -969, 0xf4adfc0494731b85 -970, 0xd691ed499cd189f2 -971, 0x7207391cf3664115 -972, 0xae2186bf1bb2773 -973, 0x5f10cea41eee2bd0 -974, 0x35f3303dba442fce -975, 0x41f7580460af8f7d -976, 0x6f92dcae967f8045 -977, 0xf8a23d127dfb64da -978, 0xca2955a095bfa56d -979, 0xf5f9a75318e0b668 -980, 0x94eabcf4d9fffbc1 -981, 0xfb5f2b3c85a44eb -982, 0x1edb77bc0d4ceef1 -983, 0x98bbacdb3bbbfc39 -984, 0xeeb6d6bc48b6156e -985, 0xc9c56b8f2fa29b0e -986, 0x22f31ccb223886d0 -987, 0xbb7f3e16bc706aaa -988, 0xe38c1e50cd965c52 -989, 0xb15aa0b68271c538 -990, 0x1c0dba1cfa587e61 -991, 0x70f267cd2d88e846 -992, 0xa439b7443ffebc10 -993, 0xd586c99b86177873 -994, 0xb05ff9807bdcb212 -995, 0xd7c08bd208fc8e05 -996, 0xd11063113d01ac5 -997, 0xd4c9beffc525f0b8 -998, 0x3d7303181643bc80 -999, 0xd75ef9b19286142 diff --git a/numpy/random/tests/test_direct.py b/numpy/random/tests/test_direct.py index 051199217..c487c179a 100644 --- a/numpy/random/tests/test_direct.py +++ b/numpy/random/tests/test_direct.py @@ -6,7 +6,7 @@ from numpy.testing import (assert_equal, assert_allclose, assert_array_equal, assert_raises) import pytest -from numpy.random import (Generator, MT19937, ThreeFry, PCG64, +from numpy.random import (Generator, MT19937, PCG64, Philox, Xoshiro256, Xoshiro512, RandomState) from numpy.random.common import interface @@ -341,29 +341,6 @@ class TestXoshiro512(Base): cls.invalid_seed_values = [(-2,), (np.empty((2, 2), dtype=np.int64),)] -class TestThreeFry(Base): - @classmethod - def setup_class(cls): - cls.bit_generator = ThreeFry - cls.bits = 64 - cls.dtype = np.uint64 - cls.data1 = cls._read_csv( - join(pwd, './data/threefry-testset-1.csv')) - cls.data2 = cls._read_csv( - join(pwd, './data/threefry-testset-2.csv')) - cls.seed_error_type = TypeError - cls.invalid_seed_types = [] - cls.invalid_seed_values = [(1, None, 1), (-1,), (2 ** 257 + 1,), - (None, None, 2 ** 257 + 1)] - - def test_set_key(self): - bit_generator = self.bit_generator(*self.data1['seed']) - state = bit_generator.state - keyed = self.bit_generator(counter=state['state']['counter'], - key=state['state']['key']) - assert_state_equal(bit_generator.state, keyed.state) - - class TestPhilox(Base): @classmethod def setup_class(cls): diff --git a/numpy/random/tests/test_smoke.py b/numpy/random/tests/test_smoke.py index d571e6548..7ab104294 100644 --- a/numpy/random/tests/test_smoke.py +++ b/numpy/random/tests/test_smoke.py @@ -5,7 +5,7 @@ from functools import partial import numpy as np import pytest from numpy.testing import assert_equal, assert_, assert_array_equal -from numpy.random import (Generator, MT19937, ThreeFry, +from numpy.random import (Generator, MT19937, PCG64, Philox, Xoshiro256, Xoshiro512, entropy) @@ -777,18 +777,6 @@ class TestPhilox(RNG): cls._extra_setup() -class TestThreeFry(RNG): - @classmethod - def setup_class(cls): - cls.bit_generator = ThreeFry - cls.advance = 2 ** 63 + 2 ** 31 + 2 ** 15 + 1 - cls.seed = [12345] - cls.rg = Generator(cls.bit_generator(*cls.seed)) - cls.initial_state = cls.rg.bit_generator.state - cls.seed_vector_bits = 64 - cls._extra_setup() - - class TestXoshiro256(RNG): @classmethod def setup_class(cls): diff --git a/numpy/random/threefry.pyx b/numpy/random/threefry.pyx deleted file mode 100644 index eb98bc0af..000000000 --- a/numpy/random/threefry.pyx +++ /dev/null @@ -1,466 +0,0 @@ -from cpython.pycapsule cimport PyCapsule_New - -try: - from threading import Lock -except ImportError: - from dummy_threading import Lock - -import numpy as np - -from .common cimport * -from .distributions cimport bitgen_t -from .entropy import random_entropy, seed_by_array - -__all__ = ['ThreeFry'] - -np.import_array() - -DEF THREEFRY_BUFFER_SIZE=4 - -cdef extern from 'src/threefry/threefry.h': - struct s_r123array4x64: - uint64_t v[4] - - ctypedef s_r123array4x64 r123array4x64 - - ctypedef r123array4x64 threefry4x64_key_t - ctypedef r123array4x64 threefry4x64_ctr_t - - struct s_threefry_state: - threefry4x64_ctr_t *ctr - threefry4x64_key_t *key - int buffer_pos - uint64_t buffer[THREEFRY_BUFFER_SIZE] - int has_uint32 - uint32_t uinteger - - ctypedef s_threefry_state threefry_state - - uint64_t threefry_next64(threefry_state *state) nogil - uint32_t threefry_next32(threefry_state *state) nogil - void threefry_jump(threefry_state *state) - void threefry_advance(uint64_t *step, threefry_state *state) - - -cdef uint64_t threefry_uint64(void* st) nogil: - return threefry_next64(<threefry_state *>st) - -cdef uint32_t threefry_uint32(void *st) nogil: - return threefry_next32(<threefry_state *> st) - -cdef double threefry_double(void* st) nogil: - return uint64_to_double(threefry_next64(<threefry_state *>st)) - -cdef class ThreeFry: - """ - ThreeFry(seed=None, counter=None, key=None) - - Container for the ThreeFry (4x64) pseudo-random number generator. - - Parameters - ---------- - seed : {None, int, array_like}, optional - Random seed initializing the pseudo-random number generator. - Can be an integer in [0, 2**64-1], array of integers in - [0, 2**64-1] or ``None`` (the default). If `seed` is ``None``, - data will be read from ``/dev/urandom`` (or the Windows analog) - if available. If unavailable, a hash of the time and process ID is - used. - counter : {None, int, array_like}, optional - Counter to use in the ThreeFry state. Can be either - a Python int in [0, 2**256) or a 4-element uint64 array. - If not provided, the RNG is initialized at 0. - key : {None, int, array_like}, optional - Key to use in the ThreeFry state. Unlike seed, which is run through - another RNG before use, the value in key is directly set. Can be either - a Python int in [0, 2**256) or a 4-element uint64 array. - key and seed cannot both be used. - - Attributes - ---------- - lock: threading.Lock - Lock instance that is shared so that the same bit git generator can - be used in multiple Generators without corrupting the state. Code that - generates values from a bit generator should hold the bit generator's - lock. - - Notes - ----- - ThreeFry is a 64-bit PRNG that uses a counter-based design based on - weaker (and faster) versions of cryptographic functions [1]_. Instances - using different values of the key produce independent sequences. ``ThreeFry`` - has a period of :math:`2^{256} - 1` and supports arbitrary advancing and - jumping the sequence in increments of :math:`2^{128}`. These features allow - multiple non-overlapping sequences to be generated. - - ``ThreeFry`` provides a capsule containing function pointers that produce - doubles, and unsigned 32 and 64- bit integers. These are not - directly consumable in Python and must be consumed by a ``Generator`` - or similar object that supports low-level access. - - See ``Philox`` for a closely related PRNG. - - **State and Seeding** - - The ``ThreeFry`` state vector consists of a 2 256-bit values encoded as - 4-element uint64 arrays. One is a counter which is incremented by 1 for - every 4 64-bit randoms produced. The second is a key which determined - the sequence produced. Using different keys produces independent - sequences. - - ``ThreeFry`` is seeded using either a single 64-bit unsigned integer - or a vector of 64-bit unsigned integers. In either case, the seed is - used as an input for a second random number generator, - SplitMix64, and the output of this PRNG function is used as the initial state. - Using a single 64-bit value for the seed can only initialize a small range of - the possible initial state values. - - **Parallel Features** - - ``ThreeFry`` can be used in parallel applications by calling the ``jumped`` - method to advances the state as-if :math:`2^{128}` random numbers have - been generated. Alternatively, ``advance`` can be used to advance the - counter for any positive step in [0, 2**256). When using ``jumped``, all - generators should be chained to ensure that the segments come from the same - sequence. - - >>> from numpy.random import Generator, ThreeFry - >>> bit_generator = ThreeFry(1234) - >>> rg = [] - >>> for _ in range(10): - ... rg.append(Generator(bit_generator)) - ... # Chain the BitGenerators - ... bit_generator = bit_generator.jumped() - - Alternatively, ``ThreeFry`` can be used in parallel applications by using - a sequence of distinct keys where each instance uses different key. - - >>> key = 2**196 + 2**132 + 2**65 + 2**33 + 2**17 + 2**9 - >>> rg = [Generator(ThreeFry(key=key+i)) for i in range(10)] - - **Compatibility Guarantee** - - ``ThreeFry`` makes a guarantee that a fixed seed and will always produce - the same random integer stream. - - Examples - -------- - >>> from numpy.random import Generator, ThreeFry - >>> rg = Generator(ThreeFry(1234)) - >>> rg.standard_normal() - 0.123 # random - - References - ---------- - .. [1] John K. Salmon, Mark A. Moraes, Ron O. Dror, and David E. Shaw, - "Parallel Random Numbers: As Easy as 1, 2, 3," Proceedings of - the International Conference for High Performance Computing, - Networking, Storage and Analysis (SC11), New York, NY: ACM, 2011. - """ - cdef threefry_state rng_state - cdef threefry4x64_ctr_t threefry_ctr - cdef threefry4x64_key_t threefry_key - cdef bitgen_t _bitgen - cdef public object capsule - cdef object _ctypes - cdef object _cffi - cdef public object lock - - def __init__(self, seed=None, counter=None, key=None): - self.rng_state.ctr = &self.threefry_ctr - self.rng_state.key = &self.threefry_key - self.seed(seed, counter, key) - self.lock = Lock() - - self._bitgen.state = <void *>&self.rng_state - self._bitgen.next_uint64 = &threefry_uint64 - self._bitgen.next_uint32 = &threefry_uint32 - self._bitgen.next_double = &threefry_double - self._bitgen.next_raw = &threefry_uint64 - - self._ctypes = None - self._cffi = None - - cdef const char *name = 'BitGenerator' - self.capsule = PyCapsule_New(<void *>&self._bitgen, name, NULL) - - # Pickling support: - def __getstate__(self): - return self.state - - def __setstate__(self, state): - self.state = state - - def __reduce__(self): - from ._pickle import __bit_generator_ctor - return __bit_generator_ctor, (self.state['bit_generator'],), self.state - - cdef _reset_state_variables(self): - self.rng_state.has_uint32 = 0 - self.rng_state.uinteger = 0 - self.rng_state.buffer_pos = THREEFRY_BUFFER_SIZE - for i in range(THREEFRY_BUFFER_SIZE): - self.rng_state.buffer[i] = 0 - - def random_raw(self, size=None, output=True): - """ - random_raw(self, size=None) - - Return randoms as generated by the underlying BitGenerator - - Parameters - ---------- - size : int or tuple of ints, optional - Output shape. If the given shape is, e.g., ``(m, n, k)``, then - ``m * n * k`` samples are drawn. Default is None, in which case a - single value is returned. - output : bool, optional - Output values. Used for performance testing since the generated - values are not returned. - - Returns - ------- - out : uint or ndarray - Drawn samples. - - Notes - ----- - This method directly exposes the the raw underlying pseudo-random - number generator. All values are returned as unsigned 64-bit - values irrespective of the number of bits produced by the PRNG. - - See the class docstring for the number of bits returned. - """ - return random_raw(&self._bitgen, self.lock, size, output) - - def _benchmark(self, Py_ssize_t cnt, method=u'uint64'): - return benchmark(&self._bitgen, self.lock, cnt, method) - - def seed(self, seed=None, counter=None, key=None): - """ - seed(seed=None, counter=None, key=None) - - Seed the generator. - - This method is called when ``ThreeFry`` is initialized. It can be - called again to re-seed the generator. For details, see - ``ThreeFry``. - - Parameters - ---------- - seed : int, optional - Seed for ``ThreeFry``. - counter : {None, int array}, optional - Positive integer less than 2**256 containing the counter position - or a 4 element array of uint64 containing the counter - key : {None, int, array}, optional - Positive integer less than 2**256 containing the key - or a 4 element array of uint64 containing the key. key and - seed cannot be simultaneously used. - - Raises - ------ - ValueError - If values are out of range for the PRNG. - - Notes - ----- - The two representation of the counter and key are related through - array[i] = (value // 2**(64*i)) % 2**64. - """ - if seed is not None and key is not None: - raise ValueError('seed and key cannot be both used') - if key is None: - if seed is None: - try: - state = random_entropy(8) - except RuntimeError: - state = random_entropy(8, 'fallback') - state = state.view(np.uint64) - else: - state = seed_by_array(seed, 4) - for i in range(4): - self.rng_state.key.v[i] = state[i] - else: - key = int_to_array(key, 'key', 256, 64) - for i in range(4): - self.rng_state.key.v[i] = key[i] - - counter = 0 if counter is None else counter - counter = int_to_array(counter, 'counter', 256, 64) - for i in range(4): - self.rng_state.ctr.v[i] = counter[i] - - self._reset_state_variables() - - @property - def state(self): - """ - Get or set the PRNG state - - Returns - ------- - state : dict - Dictionary containing the information required to describe the - state of the PRNG - """ - ctr = np.empty(4, dtype=np.uint64) - key = np.empty(4, dtype=np.uint64) - buffer = np.empty(THREEFRY_BUFFER_SIZE, dtype=np.uint64) - for i in range(4): - ctr[i] = self.rng_state.ctr.v[i] - key[i] = self.rng_state.key.v[i] - for i in range(THREEFRY_BUFFER_SIZE): - buffer[i] = self.rng_state.buffer[i] - state = {'counter': ctr, 'key': key} - return {'bit_generator': self.__class__.__name__, - 'state': state, - 'buffer': buffer, - 'buffer_pos': self.rng_state.buffer_pos, - 'has_uint32': self.rng_state.has_uint32, - 'uinteger': self.rng_state.uinteger} - - @state.setter - def state(self, value): - if not isinstance(value, dict): - raise TypeError('state must be a dict') - bitgen = value.get('bit_generator', '') - if bitgen != self.__class__.__name__: - raise ValueError('state must be for a {0} ' - 'PRNG'.format(self.__class__.__name__)) - for i in range(4): - self.rng_state.ctr.v[i] = <uint64_t>value['state']['counter'][i] - self.rng_state.key.v[i] = <uint64_t>value['state']['key'][i] - for i in range(THREEFRY_BUFFER_SIZE): - self.rng_state.buffer[i] = <uint64_t>value['buffer'][i] - self.rng_state.has_uint32 = value['has_uint32'] - self.rng_state.uinteger = value['uinteger'] - self.rng_state.buffer_pos = value['buffer_pos'] - - cdef jump_inplace(self, iter): - """ - Jump state in-place - - Not part of public API - - Parameters - ---------- - iter : integer, positive - Number of times to jump the state of the rng. - """ - self.advance(iter * int(2**128)) - - def jumped(self, jumps=1): - """ - jumped(jumps=1) - - Returns a new bit generator with the state jumped - - The state of the returned big generator is jumped as-if - 2**(128 * jumps) random numbers have been generated. - - Parameters - ---------- - iter : integer, positive - Number of times to jump the state of the bit generator returned - - Returns - ------- - bit_generator : ThreeFry - New instance of generator jumped iter times - """ - cdef ThreeFry bit_generator - - bit_generator = self.__class__() - bit_generator.state = self.state - bit_generator.jump_inplace(jumps) - - return bit_generator - - def advance(self, delta): - """ - advance(delta) - - Advance the underlying RNG as-if delta draws have occurred. - - Parameters - ---------- - delta : integer, positive - Number of draws to advance the RNG. Must be less than the - size state variable in the underlying RNG. - - Returns - ------- - self : ThreeFry - RNG advanced delta steps - - Notes - ----- - Advancing a RNG updates the underlying RNG state as-if a given - number of calls to the underlying RNG have been made. In general - there is not a one-to-one relationship between the number output - random values from a particular distribution and the number of - draws from the core RNG. This occurs for two reasons: - - * The random values are simulated using a rejection-based method - and so, on average, more than one value from the underlying - RNG is required to generate an single draw. - * The number of bits required to generate a simulated value - differs from the number of bits generated by the underlying - RNG. For example, two 16-bit integer values can be simulated - from a single draw of a 32-bit RNG. - - Advancing the RNG state resets any pre-computed random numbers. - This is required to ensure exact reproducibility. - """ - delta = wrap_int(delta, 256) - - cdef np.ndarray delta_a - delta_a = int_to_array(delta, 'step', 256, 64) - threefry_advance(<uint64_t *>delta_a.data, &self.rng_state) - self._reset_state_variables() - return self - - @property - def ctypes(self): - """ - ctypes interface - - Returns - ------- - interface : namedtuple - Named tuple containing ctypes wrapper - - * state_address - Memory address of the state struct - * state - pointer to the state struct - * next_uint64 - function pointer to produce 64 bit integers - * next_uint32 - function pointer to produce 32 bit integers - * next_double - function pointer to produce doubles - * bitgen - pointer to the BitGenerator struct - """ - if self._ctypes is None: - self._ctypes = prepare_ctypes(&self._bitgen) - - return self._ctypes - - @property - def cffi(self): - """ - CFFI interface - - Returns - ------- - interface : namedtuple - Named tuple containing CFFI wrapper - - * state_address - Memory address of the state struct - * state - pointer to the state struct - * next_uint64 - function pointer to produce 64 bit integers - * next_uint32 - function pointer to produce 32 bit integers - * next_double - function pointer to produce doubles - * bitgen - pointer to the BitGenerator struct - """ - if self._cffi is not None: - return self._cffi - self._cffi = prepare_cffi(&self._bitgen) - return self._cffi |