├── .gitattributes ├── .gitignore ├── CHANGE-LOG.txt ├── FILES.txt ├── LICENSE.txt ├── Makefile ├── Makefile.me ├── README.jp.txt ├── README.txt ├── check.sh ├── dSFMT-common.h ├── dSFMT-params.h ├── dSFMT-params11213.h ├── dSFMT-params1279.h ├── dSFMT-params132049.h ├── dSFMT-params19937.h ├── dSFMT-params216091.h ├── dSFMT-params2203.h ├── dSFMT-params4253.h ├── dSFMT-params44497.h ├── dSFMT-params521.h ├── dSFMT-params86243.h ├── dSFMT-ref.c ├── dSFMT-src-2.0.tar.gz ├── dSFMT-src-2.0.zip ├── dSFMT-src-2.1.1.tar.gz ├── dSFMT-src-2.1.1.zip ├── dSFMT-src-2.1.tar.gz ├── dSFMT-src-2.1.zip ├── dSFMT.11213.out.txt ├── dSFMT.1279.out.txt ├── dSFMT.132049.out.txt ├── dSFMT.19937.out.txt ├── dSFMT.216091.out.txt ├── dSFMT.2203.out.txt ├── dSFMT.4253.out.txt ├── dSFMT.44497.out.txt ├── dSFMT.521.out.txt ├── dSFMT.86243.out.txt ├── dSFMT.c ├── dSFMT.h ├── debug.log ├── doxygen.cfg ├── doxygen.cfg.bak ├── html ├── annotated.html ├── bc_s.png ├── classes.html ├── closed.png ├── d_s_f_m_t_8c.html ├── d_s_f_m_t_8h.html ├── d_s_f_m_t_8h_source.html ├── doxygen.css ├── doxygen.png ├── files.html ├── functions.html ├── functions_vars.html ├── globals.html ├── globals_defs.html ├── globals_func.html ├── globals_type.html ├── globals_vars.html ├── howto-compile.html ├── index.html ├── jquery.js ├── mainpage_8txt.html ├── nav_f.png ├── nav_h.png ├── open.png ├── struct_d_s_f_m_t___t.html ├── tab_a.png ├── tab_b.png ├── tab_h.png ├── tab_s.png ├── tabs.css └── union_w128___t.html ├── jump ├── CHANGE-LOG.txt ├── FILES.txt ├── LICENSE.txt ├── Makefile ├── Makefile.me ├── calc-characteristic ├── calc-characteristic-mpi ├── calc-characteristic-mpi.cpp ├── calc-characteristic-old.cpp ├── calc-characteristic.cpp ├── calc-jump ├── calc-jump.cpp ├── check-jump.sh ├── dSFMT-calc-jump.hpp ├── dSFMT-jump.c ├── dSFMT-jump.h ├── dSFMText.hpp ├── debug.fix.11213.txt ├── debug.txt ├── degree ├── degree.cpp ├── degree.xlsx ├── doxygen.cfg ├── doxygen.cfg.bak ├── fac.fix.11213.txt ├── fac.fix.132049.txt ├── fac.fix.2203.txt ├── fac.lcm.132049.txt ├── fac.lcm.216091.txt ├── fac.lcm.2203.txt ├── factorization ├── factorization.cpp ├── fix.11213.txt ├── fix.132049.txt ├── fix.19937.txt ├── fix.2203.txt ├── fix.44497.txt ├── fix.86243.txt ├── html │ ├── annotated.html │ ├── bc_s.png │ ├── bdwn.png │ ├── classes.html │ ├── closed.png │ ├── d_s_f_m_t-calc-jump_8hpp.html │ ├── d_s_f_m_t-calc-jump_8hpp_source.html │ ├── d_s_f_m_t-jump_8c.html │ ├── doxygen.css │ ├── doxygen.png │ ├── files.html │ ├── functions.html │ ├── functions_vars.html │ ├── globals.html │ ├── globals_func.html │ ├── globals_vars.html │ ├── index.html │ ├── jquery.js │ ├── mainpage_8txt.html │ ├── namespacedsfmt.html │ ├── namespacemembers.html │ ├── namespacemembers_func.html │ ├── namespaces.html │ ├── nav_f.png │ ├── nav_h.png │ ├── open.png │ ├── struct_f_i_x___t.html │ ├── tab_a.png │ ├── tab_b.png │ ├── tab_h.png │ ├── tab_s.png │ └── tabs.css ├── lcm.1279.txt ├── lcm.132049.tar.gz ├── lcm.216091.tar.gz ├── lcm.216091.txt ├── lcm.4253.txt ├── lcm.521.txt ├── lcm.86243.tar.gz ├── mainpage.txt ├── memo.txt ├── params.csv ├── poly.11213.txt ├── poly.1279.txt ├── poly.132049.txt ├── poly.19937.txt ├── poly.216091.txt ├── poly.2203.txt ├── poly.4253.txt ├── poly.44497.txt ├── poly.521.txt ├── poly.86243.txt ├── readme-jp.html ├── readme.html ├── sample1 ├── sample1.c ├── sample2 ├── sample2.c ├── test-jump-M11213 ├── test-jump-M1279 ├── test-jump-M132049 ├── test-jump-M19937 ├── test-jump-M216091 ├── test-jump-M2203 ├── test-jump-M4253 ├── test-jump-M44497 ├── test-jump-M521 ├── test-jump-M86243 └── test-jump.cpp ├── mainpage.txt ├── sample1.c ├── sample2.c ├── sample3.c ├── sample4.c └── test.c /.gitattributes: -------------------------------------------------------------------------------- 1 | html/* linguist-documentation 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.dylib 2 | *.a 3 | *.so 4 | test-* -------------------------------------------------------------------------------- /CHANGE-LOG.txt: -------------------------------------------------------------------------------- 1 | ver 2.2.4 2020-11-10 2 | ------- 3 | add #include stddef.h, change size_t to ptrdiff_t. 4 | 5 | ver 2.2.3 6 | ------- 7 | change Makefile for nmake 8 | 9 | ver 2.2.2 10 | ------- 11 | fix MSC 2012 compile error. 12 | 13 | ver 2.2.1 14 | ------- 15 | The code for ALTIVEC is changed, to fit to the ISA manual. 16 | This was reported by Tao Yao, thanks. 17 | 18 | ver 2.2.0 19 | ------- 20 | move do_recursion to dSFMT-common.h 21 | 22 | ver 2.1.1 23 | ------- 24 | The initialization of the constants for sse2 is changed. 25 | Old version may cause trouble in parallel environment like OpenMP. 26 | 27 | ver 2.1 28 | ------- 29 | This version supports the periods from 2^521-1 to 2^216091-1. 30 | We added new function dsfmt_genrand_uint32, which returns 32-bit 31 | unsigned integer. If you need many floating point pseudo random 32 | numbers and a few integers, you don't need to use another 33 | integer generator. 34 | 35 | ver 2.0 36 | ------- 37 | The recursion formula of dSFMT is changed. 38 | The supported periods are changed. 39 | The output sequences are completely changed. 40 | The generation speed is improved. 41 | The variable for initialization check is removed, because it causes 42 | an execution error in cygwin. 43 | 44 | ver 1.3.1 45 | ------- 46 | change dSFMT.h not to include dSFMT-params.h 47 | change Makefile to clean test files. 48 | 49 | ver 1.3 50 | ------- 51 | add `dsfmt_' prefix to functions. 52 | changed to structure base code. 53 | put Intel Compiler into silence. 54 | bug fix checking BIG_ENDIAN and BYTE_ORDER 55 | change test.c not to include dSFMT.c 56 | dSFMT-alti.h and dSFMT-sse2.h are marged into dSFMT.c 57 | 58 | ver 1.2.1 59 | ------- 60 | add #include to dSFMT.c 61 | 62 | ver 1.2 63 | ------- 64 | The precision specifier of printf was too large in test.c 65 | CAUTION! *.out.txt is changed. 66 | add dSFMT-params216091.h 67 | gcc compile option changed form -O9 to -O3. 68 | add AltiVec parameter format for systems which are not OSX. 69 | change Makefile for systems which are not OSX and support AltiVec. 70 | change sample2 of howto-compile for Free BSD. 71 | change period certification code more smart. 72 | change source files for BORLANDC and Visual Studio. 73 | 74 | ver 1.1.1 75 | ------- 76 | BUG in dSFMT-sse2.h is fixed. 77 | This bug didn't change the result. 78 | Change test.c 79 | 80 | ver 1.1 81 | ------- 82 | add dSFMT-params132049.h 83 | fix bug in period_certification. It's a bug but result is the same for 84 | all parameter files. 85 | change macro definition names and global variables. Thank you, Adam Piatyszek. 86 | remove L suffix from floating point constants. It's Saito's misunderstanding. 87 | fix bug of sfmt_idxof definition for BIG ENDIAN machine. 88 | 89 | ver 1.0.1 90 | ------- 91 | change name dSFMT-alti.c to SFMT-alti.h 92 | change name dSFMT-sse2.c to SFMT-sse2.h 93 | This version is not released. 94 | 95 | ver 1.0 96 | ------- 97 | The first version. 98 | -------------------------------------------------------------------------------- /FILES.txt: -------------------------------------------------------------------------------- 1 | This archive contails following directories and files. 2 | 3 | TOP DIRECTORY 4 | FILES.txt: This file. 5 | CHANGE-LOG.txt change log. 6 | LICENSE.txt: License file. 7 | Makefile: Makefile for test programs. 8 | dSFMT.h: Header file. 9 | dSFMT-common.h: Header file. 10 | dSFMT-params.h: parameter file control for various Mersenne expornent 11 | dSFMT-params521.h: parameters for period of 2^{521}-1 12 | dSFMT-params1279.h: parameters for period of 2^{1279}-1 13 | dSFMT-params2203.h: parameters for period of 2^{2203}-1 14 | dSFMT-params4253.h: parameters for period of 2^{4253}-1 15 | dSFMT-params11213.h: parameters for period of 2^{11213}-1 16 | dSFMT-params19937.h: parameters for period of 2^{19937}-1 17 | dSFMT.c: C code for standard C (c99) and unix like systems. 18 | test.c: Test driver for standard C. 19 | check.sh: Test shell script. 20 | dSFMT.521.out.txt: correct output of dSFMT MEXP=521 21 | dSFMT.1279.out.txt: correct output of dSFMT MEXP=1279 22 | dSFMT.2203.out.txt: correct output of dSFMT MEXP=2203 23 | dSFMT.4253.out.txt: correct output of dSFMT MEXP=4253 24 | dSFMT.11213.out.txt: correct output of dSFMT MEXP=11213 25 | dSFMT.19937.out.txt: correct output of dSFMT MEXP=19937 26 | 27 | html DIRECTORY: The documents generated by doxygen. 28 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007, 2008, 2009 Mutsuo Saito, Makoto Matsumoto 2 | and Hiroshima University. 3 | Copyright (c) 2011, 2002 Mutsuo Saito, Makoto Matsumoto, Hiroshima 4 | University and The University of Tokyo. 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are 9 | met: 10 | 11 | * Redistributions of source code must retain the above copyright 12 | notice, this list of conditions and the following disclaimer. 13 | * Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following 15 | disclaimer in the documentation and/or other materials provided 16 | with the distribution. 17 | * Neither the name of the Hiroshima University nor the names of 18 | its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written 20 | permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 26 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 28 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 32 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /Makefile.me: -------------------------------------------------------------------------------- 1 | #for GNU make 2 | 3 | FILES = dSFMT.h \ 4 | dSFMT-common.h \ 5 | dSFMT-params.h \ 6 | dSFMT.c \ 7 | test.c \ 8 | check.sh \ 9 | dSFMT-params521.h \ 10 | dSFMT-params1279.h \ 11 | dSFMT-params2203.h \ 12 | dSFMT-params4253.h \ 13 | dSFMT-params11213.h \ 14 | dSFMT-params19937.h \ 15 | dSFMT-params44497.h \ 16 | dSFMT-params86243.h \ 17 | dSFMT-params132049.h \ 18 | dSFMT-params216091.h \ 19 | dSFMT.521.out.txt \ 20 | dSFMT.1279.out.txt \ 21 | dSFMT.2203.out.txt \ 22 | dSFMT.4253.out.txt \ 23 | dSFMT.11213.out.txt \ 24 | dSFMT.19937.out.txt \ 25 | dSFMT.44497.out.txt \ 26 | dSFMT.86243.out.txt \ 27 | dSFMT.132049.out.txt \ 28 | dSFMT.216091.out.txt \ 29 | FILES.txt \ 30 | LICENSE.txt \ 31 | Makefile \ 32 | README.txt \ 33 | README.jp.txt \ 34 | CHANGE-LOG.txt \ 35 | html 36 | VERSION = 2.2.3 37 | DIR = dSFMT-src-${VERSION} 38 | 39 | doc: 40 | rm -rf html 41 | doxygen doxygen.cfg 42 | cp howto-compile.html html 43 | 44 | .PHONY : tar.gz 45 | tar.gz: $(FILES) 46 | mkdir ${DIR} 47 | cp -r ${FILES} ${DIR} 48 | tar czvf ${DIR}.tar.gz ${DIR}/* 49 | rm -rf ${DIR} 50 | 51 | .PHONY : zip 52 | zip: $(FILES) 53 | mkdir ${DIR} 54 | cp -r ${FILES} ${DIR} 55 | zip ${DIR}.zip ${DIR}/* ${DIR}/html/* 56 | rm -rf ${DIR} 57 | 58 | clean: 59 | rm -f *.o *~ 60 | -------------------------------------------------------------------------------- /README.jp.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/README.jp.txt -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | ================================================================= 2 | dSFMT ver. 2.2.1 3 | 2011.11.10 4 | 5 | double precision SIMD oriented Fast Mersenne Twister(dSFMT) 6 | based on IEEE 754 floating point format. 7 | 8 | Mutsuo Saito (Hiroshima University) and 9 | Makoto Matsumoto (Hiroshima University) 10 | 11 | Copyright (C) 2007, 2008, 2009 Mutsuo Saito, Makoto Matsumoto and 12 | Hiroshima University. 13 | Copyright (C) 2011, 2013 Mutsuo Saito, Makoto Matsumoto, Hiroshima 14 | University and The University of Tokyo. 15 | All rights reserved. 16 | 17 | The (modified) BSD License is applied to this software, see 18 | LICENSE.txt 19 | ================================================================= 20 | The documents written in English is the official one. 21 | 22 | dSFMT ver. 2.0 and ver. 2.1 are completely different from dSFMT ver 1.xx. 23 | The algorithm is changed. 24 | 25 | This program only works on systems which have IEEE754 floating point 26 | format. 27 | 28 | This version uses `struct' of C language. 29 | Don't use different DSFMT_MEXP for compiling dSFMT.c and your program. 30 | 31 | To see documents, see html/index.html. 32 | 33 | To make test program, see html/howto-compile.html. 34 | If your CPU is BIG ENDIAN and your compiler is not gcc, 35 | define DSFMT_BIG_ENDIAN preprocessor macro, please. 36 | 37 | If you want to redistribute and/or change source files, see LICENSE.txt. 38 | 39 | When you change these files and redistribute them, PLEASE write your 40 | e-mail address in redistribution and write to contact YOU first if 41 | users of your changed source encounter troubles. 42 | -------------------------------------------------------------------------------- /check.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | prefix=$1 3 | tmp=tmp.$$ 4 | exps="521 1279 2203 4253 11213 19937 44497 86243 132049 216091" 5 | for mexp in $exps; do 6 | compare=dSFMT.${mexp}.out.txt 7 | command=${prefix}-M${mexp} 8 | ./$command -v > $tmp 9 | if diff -q -w $tmp $compare; then 10 | echo $command output check OK 11 | rm -f $tmp 12 | else 13 | echo $command output check NG! 14 | rm -f $tmp 15 | exit 1 16 | fi 17 | done 18 | exit 0 19 | -------------------------------------------------------------------------------- /dSFMT-common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /** 3 | * @file dSFMT-common.h 4 | * 5 | * @brief SIMD oriented Fast Mersenne Twister(SFMT) pseudorandom 6 | * number generator with jump function. This file includes common functions 7 | * used in random number generation and jump. 8 | * 9 | * @author Mutsuo Saito (Hiroshima University) 10 | * @author Makoto Matsumoto (The University of Tokyo) 11 | * 12 | * Copyright (C) 2006, 2007 Mutsuo Saito, Makoto Matsumoto and Hiroshima 13 | * University. 14 | * Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, Hiroshima 15 | * University and The University of Tokyo. 16 | * All rights reserved. 17 | * 18 | * The 3-clause BSD License is applied to this software, see 19 | * LICENSE.txt 20 | */ 21 | #ifndef DSFMT_COMMON_H 22 | #define DSFMT_COMMON_H 23 | 24 | #include "dSFMT.h" 25 | 26 | #if defined(HAVE_SSE2) 27 | # include 28 | union X128I_T { 29 | uint64_t u[2]; 30 | __m128i i128; 31 | }; 32 | union X128D_T { 33 | double d[2]; 34 | __m128d d128; 35 | }; 36 | /** mask data for sse2 */ 37 | static const union X128I_T sse2_param_mask = {{DSFMT_MSK1, DSFMT_MSK2}}; 38 | #endif 39 | 40 | #if defined(HAVE_ALTIVEC) 41 | inline static void do_recursion(w128_t *r, w128_t *a, w128_t * b, 42 | w128_t *lung) { 43 | const vector unsigned char sl1 = ALTI_SL1; 44 | const vector unsigned char sl1_perm = ALTI_SL1_PERM; 45 | const vector unsigned int sl1_msk = ALTI_SL1_MSK; 46 | const vector unsigned char sr1 = ALTI_SR; 47 | const vector unsigned char sr1_perm = ALTI_SR_PERM; 48 | const vector unsigned int sr1_msk = ALTI_SR_MSK; 49 | const vector unsigned char perm = ALTI_PERM; 50 | const vector unsigned int msk1 = ALTI_MSK; 51 | vector unsigned int w, x, y, z; 52 | 53 | z = a->s; 54 | w = lung->s; 55 | x = vec_perm(w, (vector unsigned int)perm, perm); 56 | y = vec_perm(z, (vector unsigned int)sl1_perm, sl1_perm); 57 | y = vec_sll(y, sl1); 58 | y = vec_and(y, sl1_msk); 59 | w = vec_xor(x, b->s); 60 | w = vec_xor(w, y); 61 | x = vec_perm(w, (vector unsigned int)sr1_perm, sr1_perm); 62 | x = vec_srl(x, sr1); 63 | x = vec_and(x, sr1_msk); 64 | y = vec_and(w, msk1); 65 | z = vec_xor(z, y); 66 | r->s = vec_xor(z, x); 67 | lung->s = w; 68 | } 69 | #elif defined(HAVE_SSE2) 70 | /** 71 | * This function represents the recursion formula. 72 | * @param r output 128-bit 73 | * @param a a 128-bit part of the internal state array 74 | * @param b a 128-bit part of the internal state array 75 | * @param d a 128-bit part of the internal state array (I/O) 76 | */ 77 | inline static void do_recursion(w128_t *r, w128_t *a, w128_t *b, w128_t *u) { 78 | __m128i v, w, x, y, z; 79 | 80 | x = a->si; 81 | z = _mm_slli_epi64(x, DSFMT_SL1); 82 | y = _mm_shuffle_epi32(u->si, SSE2_SHUFF); 83 | z = _mm_xor_si128(z, b->si); 84 | y = _mm_xor_si128(y, z); 85 | 86 | v = _mm_srli_epi64(y, DSFMT_SR); 87 | w = _mm_and_si128(y, sse2_param_mask.i128); 88 | v = _mm_xor_si128(v, x); 89 | v = _mm_xor_si128(v, w); 90 | r->si = v; 91 | u->si = y; 92 | } 93 | #else 94 | /** 95 | * This function represents the recursion formula. 96 | * @param r output 128-bit 97 | * @param a a 128-bit part of the internal state array 98 | * @param b a 128-bit part of the internal state array 99 | * @param lung a 128-bit part of the internal state array (I/O) 100 | */ 101 | inline static void do_recursion(w128_t *r, w128_t *a, w128_t * b, 102 | w128_t *lung) { 103 | uint64_t t0, t1, L0, L1; 104 | 105 | t0 = a->u[0]; 106 | t1 = a->u[1]; 107 | L0 = lung->u[0]; 108 | L1 = lung->u[1]; 109 | lung->u[0] = (t0 << DSFMT_SL1) ^ (L1 >> 32) ^ (L1 << 32) ^ b->u[0]; 110 | lung->u[1] = (t1 << DSFMT_SL1) ^ (L0 >> 32) ^ (L0 << 32) ^ b->u[1]; 111 | r->u[0] = (lung->u[0] >> DSFMT_SR) ^ (lung->u[0] & DSFMT_MSK1) ^ t0; 112 | r->u[1] = (lung->u[1] >> DSFMT_SR) ^ (lung->u[1] & DSFMT_MSK2) ^ t1; 113 | } 114 | #endif 115 | #endif 116 | -------------------------------------------------------------------------------- /dSFMT-params.h: -------------------------------------------------------------------------------- 1 | #ifndef DSFMT_PARAMS_H 2 | #define DSFMT_PARAMS_H 3 | 4 | #include "dSFMT.h" 5 | 6 | /*---------------------- 7 | the parameters of DSFMT 8 | following definitions are in dSFMT-paramsXXXX.h file. 9 | ----------------------*/ 10 | /** the pick up position of the array. 11 | #define DSFMT_POS1 122 12 | */ 13 | 14 | /** the parameter of shift left as four 32-bit registers. 15 | #define DSFMT_SL1 18 16 | */ 17 | 18 | /** the parameter of shift right as four 32-bit registers. 19 | #define DSFMT_SR1 12 20 | */ 21 | 22 | /** A bitmask, used in the recursion. These parameters are introduced 23 | * to break symmetry of SIMD. 24 | #define DSFMT_MSK1 (uint64_t)0xdfffffefULL 25 | #define DSFMT_MSK2 (uint64_t)0xddfecb7fULL 26 | */ 27 | 28 | /** These definitions are part of a 128-bit period certification vector. 29 | #define DSFMT_PCV1 UINT64_C(0x00000001) 30 | #define DSFMT_PCV2 UINT64_C(0x00000000) 31 | */ 32 | 33 | #define DSFMT_LOW_MASK UINT64_C(0x000FFFFFFFFFFFFF) 34 | #define DSFMT_HIGH_CONST UINT64_C(0x3FF0000000000000) 35 | #define DSFMT_SR 12 36 | 37 | /* for sse2 */ 38 | #if defined(HAVE_SSE2) 39 | #define SSE2_SHUFF 0x1b 40 | #elif defined(HAVE_ALTIVEC) 41 | #if defined(__APPLE__) /* For OSX */ 42 | #define ALTI_SR (vector unsigned char)(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4) 43 | #define ALTI_SR_PERM \ 44 | (vector unsigned char)(15,0,1,2,3,4,5,6,15,8,9,10,11,12,13,14) 45 | #define ALTI_SR_MSK \ 46 | (vector unsigned int)(0x000fffffU,0xffffffffU,0x000fffffU,0xffffffffU) 47 | #define ALTI_PERM \ 48 | (vector unsigned char)(12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3) 49 | #else 50 | #define ALTI_SR {4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4} 51 | #define ALTI_SR_PERM {15,0,1,2,3,4,5,6,15,8,9,10,11,12,13,14} 52 | #define ALTI_SR_MSK {0x000fffffU,0xffffffffU,0x000fffffU,0xffffffffU} 53 | #define ALTI_PERM {12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3} 54 | #endif 55 | #endif 56 | 57 | #if DSFMT_MEXP == 521 58 | #include "dSFMT-params521.h" 59 | #elif DSFMT_MEXP == 1279 60 | #include "dSFMT-params1279.h" 61 | #elif DSFMT_MEXP == 2203 62 | #include "dSFMT-params2203.h" 63 | #elif DSFMT_MEXP == 4253 64 | #include "dSFMT-params4253.h" 65 | #elif DSFMT_MEXP == 11213 66 | #include "dSFMT-params11213.h" 67 | #elif DSFMT_MEXP == 19937 68 | #include "dSFMT-params19937.h" 69 | #elif DSFMT_MEXP == 44497 70 | #include "dSFMT-params44497.h" 71 | #elif DSFMT_MEXP == 86243 72 | #include "dSFMT-params86243.h" 73 | #elif DSFMT_MEXP == 132049 74 | #include "dSFMT-params132049.h" 75 | #elif DSFMT_MEXP == 216091 76 | #include "dSFMT-params216091.h" 77 | #else 78 | #ifdef __GNUC__ 79 | #error "DSFMT_MEXP is not valid." 80 | #undef DSFMT_MEXP 81 | #else 82 | #undef DSFMT_MEXP 83 | #endif 84 | 85 | #endif 86 | 87 | #endif /* DSFMT_PARAMS_H */ 88 | -------------------------------------------------------------------------------- /dSFMT-params11213.h: -------------------------------------------------------------------------------- 1 | #ifndef DSFMT_PARAMS11213_H 2 | #define DSFMT_PARAMS11213_H 3 | 4 | /* #define DSFMT_N 107 */ 5 | /* #define DSFMT_MAXDEGREE 11256 */ 6 | #define DSFMT_POS1 37 7 | #define DSFMT_SL1 19 8 | #define DSFMT_MSK1 UINT64_C(0x000ffffffdf7fffd) 9 | #define DSFMT_MSK2 UINT64_C(0x000dfffffff6bfff) 10 | #define DSFMT_MSK32_1 0x000fffffU 11 | #define DSFMT_MSK32_2 0xfdf7fffdU 12 | #define DSFMT_MSK32_3 0x000dffffU 13 | #define DSFMT_MSK32_4 0xfff6bfffU 14 | #define DSFMT_FIX1 UINT64_C(0xd0ef7b7c75b06793) 15 | #define DSFMT_FIX2 UINT64_C(0x9c50ff4caae0a641) 16 | #define DSFMT_PCV1 UINT64_C(0x8234c51207c80000) 17 | #define DSFMT_PCV2 UINT64_C(0x0000000000000001) 18 | #define DSFMT_IDSTR "dSFMT2-11213:37-19:ffffffdf7fffd-dfffffff6bfff" 19 | 20 | 21 | /* PARAMETERS FOR ALTIVEC */ 22 | #if defined(__APPLE__) /* For OSX */ 23 | #define ALTI_SL1 (vector unsigned char)(3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3) 24 | #define ALTI_SL1_PERM \ 25 | (vector unsigned char)(2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1) 26 | #define ALTI_SL1_MSK \ 27 | (vector unsigned int)(0xffffffffU,0xfff80000U,0xffffffffU,0xfff80000U) 28 | #define ALTI_MSK (vector unsigned int)(DSFMT_MSK32_1, \ 29 | DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4) 30 | #else /* For OTHER OSs(Linux?) */ 31 | #define ALTI_SL1 {3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3} 32 | #define ALTI_SL1_PERM \ 33 | {2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1} 34 | #define ALTI_SL1_MSK \ 35 | {0xffffffffU,0xfff80000U,0xffffffffU,0xfff80000U} 36 | #define ALTI_MSK \ 37 | {DSFMT_MSK32_1, DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4} 38 | #endif 39 | 40 | #endif /* DSFMT_PARAMS11213_H */ 41 | -------------------------------------------------------------------------------- /dSFMT-params1279.h: -------------------------------------------------------------------------------- 1 | #ifndef DSFMT_PARAMS1279_H 2 | #define DSFMT_PARAMS1279_H 3 | 4 | /* #define DSFMT_N 12 */ 5 | /* #define DSFMT_MAXDEGREE 1376 */ 6 | #define DSFMT_POS1 9 7 | #define DSFMT_SL1 19 8 | #define DSFMT_MSK1 UINT64_C(0x000efff7ffddffee) 9 | #define DSFMT_MSK2 UINT64_C(0x000fbffffff77fff) 10 | #define DSFMT_MSK32_1 0x000efff7U 11 | #define DSFMT_MSK32_2 0xffddffeeU 12 | #define DSFMT_MSK32_3 0x000fbfffU 13 | #define DSFMT_MSK32_4 0xfff77fffU 14 | #define DSFMT_FIX1 UINT64_C(0xb66627623d1a31be) 15 | #define DSFMT_FIX2 UINT64_C(0x04b6c51147b6109b) 16 | #define DSFMT_PCV1 UINT64_C(0x7049f2da382a6aeb) 17 | #define DSFMT_PCV2 UINT64_C(0xde4ca84a40000001) 18 | #define DSFMT_IDSTR "dSFMT2-1279:9-19:efff7ffddffee-fbffffff77fff" 19 | 20 | 21 | /* PARAMETERS FOR ALTIVEC */ 22 | #if defined(__APPLE__) /* For OSX */ 23 | #define ALTI_SL1 (vector unsigned char)(3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3) 24 | #define ALTI_SL1_PERM \ 25 | (vector unsigned char)(2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1) 26 | #define ALTI_SL1_MSK \ 27 | (vector unsigned int)(0xffffffffU,0xfff80000U,0xffffffffU,0xfff80000U) 28 | #define ALTI_MSK (vector unsigned int)(DSFMT_MSK32_1, \ 29 | DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4) 30 | #else /* For OTHER OSs(Linux?) */ 31 | #define ALTI_SL1 {3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3} 32 | #define ALTI_SL1_PERM \ 33 | {2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1} 34 | #define ALTI_SL1_MSK \ 35 | {0xffffffffU,0xfff80000U,0xffffffffU,0xfff80000U} 36 | #define ALTI_MSK \ 37 | {DSFMT_MSK32_1, DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4} 38 | #endif 39 | 40 | #endif /* DSFMT_PARAMS1279_H */ 41 | -------------------------------------------------------------------------------- /dSFMT-params132049.h: -------------------------------------------------------------------------------- 1 | #ifndef DSFMT_PARAMS132049_H 2 | #define DSFMT_PARAMS132049_H 3 | 4 | /* #define DSFMT_N 1269 */ 5 | /* #define DSFMT_MAXDEGREE 132104 */ 6 | #define DSFMT_POS1 371 7 | #define DSFMT_SL1 23 8 | #define DSFMT_MSK1 UINT64_C(0x000fb9f4eff4bf77) 9 | #define DSFMT_MSK2 UINT64_C(0x000fffffbfefff37) 10 | #define DSFMT_MSK32_1 0x000fb9f4U 11 | #define DSFMT_MSK32_2 0xeff4bf77U 12 | #define DSFMT_MSK32_3 0x000fffffU 13 | #define DSFMT_MSK32_4 0xbfefff37U 14 | #define DSFMT_FIX1 UINT64_C(0x4ce24c0e4e234f3b) 15 | #define DSFMT_FIX2 UINT64_C(0x62612409b5665c2d) 16 | #define DSFMT_PCV1 UINT64_C(0x181232889145d000) 17 | #define DSFMT_PCV2 UINT64_C(0x0000000000000001) 18 | #define DSFMT_IDSTR "dSFMT2-132049:371-23:fb9f4eff4bf77-fffffbfefff37" 19 | 20 | 21 | /* PARAMETERS FOR ALTIVEC */ 22 | #if defined(__APPLE__) /* For OSX */ 23 | #define ALTI_SL1 (vector unsigned char)(7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7) 24 | #define ALTI_SL1_PERM \ 25 | (vector unsigned char)(2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1) 26 | #define ALTI_SL1_MSK \ 27 | (vector unsigned int)(0xffffffffU,0xff800000U,0xffffffffU,0xff800000U) 28 | #define ALTI_MSK (vector unsigned int)(DSFMT_MSK32_1, \ 29 | DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4) 30 | #else /* For OTHER OSs(Linux?) */ 31 | #define ALTI_SL1 {7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7} 32 | #define ALTI_SL1_PERM \ 33 | {2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1} 34 | #define ALTI_SL1_MSK \ 35 | {0xffffffffU,0xff800000U,0xffffffffU,0xff800000U} 36 | #define ALTI_MSK \ 37 | {DSFMT_MSK32_1, DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4} 38 | #endif 39 | 40 | #endif /* DSFMT_PARAMS132049_H */ 41 | -------------------------------------------------------------------------------- /dSFMT-params19937.h: -------------------------------------------------------------------------------- 1 | #ifndef DSFMT_PARAMS19937_H 2 | #define DSFMT_PARAMS19937_H 3 | 4 | /* #define DSFMT_N 191 */ 5 | /* #define DSFMT_MAXDEGREE 19992 */ 6 | #define DSFMT_POS1 117 7 | #define DSFMT_SL1 19 8 | #define DSFMT_MSK1 UINT64_C(0x000ffafffffffb3f) 9 | #define DSFMT_MSK2 UINT64_C(0x000ffdfffc90fffd) 10 | #define DSFMT_MSK32_1 0x000ffaffU 11 | #define DSFMT_MSK32_2 0xfffffb3fU 12 | #define DSFMT_MSK32_3 0x000ffdffU 13 | #define DSFMT_MSK32_4 0xfc90fffdU 14 | #define DSFMT_FIX1 UINT64_C(0x90014964b32f4329) 15 | #define DSFMT_FIX2 UINT64_C(0x3b8d12ac548a7c7a) 16 | #define DSFMT_PCV1 UINT64_C(0x3d84e1ac0dc82880) 17 | #define DSFMT_PCV2 UINT64_C(0x0000000000000001) 18 | #define DSFMT_IDSTR "dSFMT2-19937:117-19:ffafffffffb3f-ffdfffc90fffd" 19 | 20 | 21 | /* PARAMETERS FOR ALTIVEC */ 22 | #if defined(__APPLE__) /* For OSX */ 23 | #define ALTI_SL1 (vector unsigned char)(3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3) 24 | #define ALTI_SL1_PERM \ 25 | (vector unsigned char)(2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1) 26 | #define ALTI_SL1_MSK \ 27 | (vector unsigned int)(0xffffffffU,0xfff80000U,0xffffffffU,0xfff80000U) 28 | #define ALTI_MSK (vector unsigned int)(DSFMT_MSK32_1, \ 29 | DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4) 30 | #else /* For OTHER OSs(Linux?) */ 31 | #define ALTI_SL1 {3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3} 32 | #define ALTI_SL1_PERM \ 33 | {2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1} 34 | #define ALTI_SL1_MSK \ 35 | {0xffffffffU,0xfff80000U,0xffffffffU,0xfff80000U} 36 | #define ALTI_MSK \ 37 | {DSFMT_MSK32_1, DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4} 38 | #endif 39 | 40 | #endif /* DSFMT_PARAMS19937_H */ 41 | -------------------------------------------------------------------------------- /dSFMT-params216091.h: -------------------------------------------------------------------------------- 1 | #ifndef DSFMT_PARAMS216091_H 2 | #define DSFMT_PARAMS216091_H 3 | 4 | /* #define DSFMT_N 2077 */ 5 | /* #define DSFMT_MAXDEGREE 216136 */ 6 | #define DSFMT_POS1 1890 7 | #define DSFMT_SL1 23 8 | #define DSFMT_MSK1 UINT64_C(0x000bf7df7fefcfff) 9 | #define DSFMT_MSK2 UINT64_C(0x000e7ffffef737ff) 10 | #define DSFMT_MSK32_1 0x000bf7dfU 11 | #define DSFMT_MSK32_2 0x7fefcfffU 12 | #define DSFMT_MSK32_3 0x000e7fffU 13 | #define DSFMT_MSK32_4 0xfef737ffU 14 | #define DSFMT_FIX1 UINT64_C(0xd7f95a04764c27d7) 15 | #define DSFMT_FIX2 UINT64_C(0x6a483861810bebc2) 16 | #define DSFMT_PCV1 UINT64_C(0x3af0a8f3d5600000) 17 | #define DSFMT_PCV2 UINT64_C(0x0000000000000001) 18 | #define DSFMT_IDSTR "dSFMT2-216091:1890-23:bf7df7fefcfff-e7ffffef737ff" 19 | 20 | 21 | /* PARAMETERS FOR ALTIVEC */ 22 | #if defined(__APPLE__) /* For OSX */ 23 | #define ALTI_SL1 (vector unsigned char)(7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7) 24 | #define ALTI_SL1_PERM \ 25 | (vector unsigned char)(2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1) 26 | #define ALTI_SL1_MSK \ 27 | (vector unsigned int)(0xffffffffU,0xff800000U,0xffffffffU,0xff800000U) 28 | #define ALTI_MSK (vector unsigned int)(DSFMT_MSK32_1, \ 29 | DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4) 30 | #else /* For OTHER OSs(Linux?) */ 31 | #define ALTI_SL1 {7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7} 32 | #define ALTI_SL1_PERM \ 33 | {2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1} 34 | #define ALTI_SL1_MSK \ 35 | {0xffffffffU,0xff800000U,0xffffffffU,0xff800000U} 36 | #define ALTI_MSK \ 37 | {DSFMT_MSK32_1, DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4} 38 | #endif 39 | 40 | #endif /* DSFMT_PARAMS216091_H */ 41 | -------------------------------------------------------------------------------- /dSFMT-params2203.h: -------------------------------------------------------------------------------- 1 | #ifndef DSFMT_PARAMS2203_H 2 | #define DSFMT_PARAMS2203_H 3 | 4 | /* #define DSFMT_N 20 */ 5 | /* #define DSFMT_MAXDEGREE 2208 */ 6 | #define DSFMT_POS1 7 7 | #define DSFMT_SL1 19 8 | #define DSFMT_MSK1 UINT64_C(0x000fdffff5edbfff) 9 | #define DSFMT_MSK2 UINT64_C(0x000f77fffffffbfe) 10 | #define DSFMT_MSK32_1 0x000fdfffU 11 | #define DSFMT_MSK32_2 0xf5edbfffU 12 | #define DSFMT_MSK32_3 0x000f77ffU 13 | #define DSFMT_MSK32_4 0xfffffbfeU 14 | #define DSFMT_FIX1 UINT64_C(0xb14e907a39338485) 15 | #define DSFMT_FIX2 UINT64_C(0xf98f0735c637ef90) 16 | #define DSFMT_PCV1 UINT64_C(0x8000000000000000) 17 | #define DSFMT_PCV2 UINT64_C(0x0000000000000001) 18 | #define DSFMT_IDSTR "dSFMT2-2203:7-19:fdffff5edbfff-f77fffffffbfe" 19 | 20 | 21 | /* PARAMETERS FOR ALTIVEC */ 22 | #if defined(__APPLE__) /* For OSX */ 23 | #define ALTI_SL1 (vector unsigned char)(3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3) 24 | #define ALTI_SL1_PERM \ 25 | (vector unsigned char)(2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1) 26 | #define ALTI_SL1_MSK \ 27 | (vector unsigned int)(0xffffffffU,0xfff80000U,0xffffffffU,0xfff80000U) 28 | #define ALTI_MSK (vector unsigned int)(DSFMT_MSK32_1, \ 29 | DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4) 30 | #else /* For OTHER OSs(Linux?) */ 31 | #define ALTI_SL1 {3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3} 32 | #define ALTI_SL1_PERM \ 33 | {2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1} 34 | #define ALTI_SL1_MSK \ 35 | {0xffffffffU,0xfff80000U,0xffffffffU,0xfff80000U} 36 | #define ALTI_MSK \ 37 | {DSFMT_MSK32_1, DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4} 38 | #endif 39 | 40 | #endif /* DSFMT_PARAMS2203_H */ 41 | -------------------------------------------------------------------------------- /dSFMT-params4253.h: -------------------------------------------------------------------------------- 1 | #ifndef DSFMT_PARAMS4253_H 2 | #define DSFMT_PARAMS4253_H 3 | 4 | /* #define DSFMT_N 40 */ 5 | /* #define DSFMT_MAXDEGREE 4288 */ 6 | #define DSFMT_POS1 19 7 | #define DSFMT_SL1 19 8 | #define DSFMT_MSK1 UINT64_C(0x0007b7fffef5feff) 9 | #define DSFMT_MSK2 UINT64_C(0x000ffdffeffefbfc) 10 | #define DSFMT_MSK32_1 0x0007b7ffU 11 | #define DSFMT_MSK32_2 0xfef5feffU 12 | #define DSFMT_MSK32_3 0x000ffdffU 13 | #define DSFMT_MSK32_4 0xeffefbfcU 14 | #define DSFMT_FIX1 UINT64_C(0x80901b5fd7a11c65) 15 | #define DSFMT_FIX2 UINT64_C(0x5a63ff0e7cb0ba74) 16 | #define DSFMT_PCV1 UINT64_C(0x1ad277be12000000) 17 | #define DSFMT_PCV2 UINT64_C(0x0000000000000001) 18 | #define DSFMT_IDSTR "dSFMT2-4253:19-19:7b7fffef5feff-ffdffeffefbfc" 19 | 20 | 21 | /* PARAMETERS FOR ALTIVEC */ 22 | #if defined(__APPLE__) /* For OSX */ 23 | #define ALTI_SL1 (vector unsigned char)(3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3) 24 | #define ALTI_SL1_PERM \ 25 | (vector unsigned char)(2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1) 26 | #define ALTI_SL1_MSK \ 27 | (vector unsigned int)(0xffffffffU,0xfff80000U,0xffffffffU,0xfff80000U) 28 | #define ALTI_MSK (vector unsigned int)(DSFMT_MSK32_1, \ 29 | DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4) 30 | #else /* For OTHER OSs(Linux?) */ 31 | #define ALTI_SL1 {3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3} 32 | #define ALTI_SL1_PERM \ 33 | {2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1} 34 | #define ALTI_SL1_MSK \ 35 | {0xffffffffU,0xfff80000U,0xffffffffU,0xfff80000U} 36 | #define ALTI_MSK \ 37 | {DSFMT_MSK32_1, DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4} 38 | #endif 39 | 40 | #endif /* DSFMT_PARAMS4253_H */ 41 | -------------------------------------------------------------------------------- /dSFMT-params44497.h: -------------------------------------------------------------------------------- 1 | #ifndef DSFMT_PARAMS44497_H 2 | #define DSFMT_PARAMS44497_H 3 | 4 | /* #define DSFMT_N 427 */ 5 | /* #define DSFMT_MAXDEGREE 44536 */ 6 | #define DSFMT_POS1 304 7 | #define DSFMT_SL1 19 8 | #define DSFMT_MSK1 UINT64_C(0x000ff6dfffffffef) 9 | #define DSFMT_MSK2 UINT64_C(0x0007ffdddeefff6f) 10 | #define DSFMT_MSK32_1 0x000ff6dfU 11 | #define DSFMT_MSK32_2 0xffffffefU 12 | #define DSFMT_MSK32_3 0x0007ffddU 13 | #define DSFMT_MSK32_4 0xdeefff6fU 14 | #define DSFMT_FIX1 UINT64_C(0x75d910f235f6e10e) 15 | #define DSFMT_FIX2 UINT64_C(0x7b32158aedc8e969) 16 | #define DSFMT_PCV1 UINT64_C(0x4c3356b2a0000000) 17 | #define DSFMT_PCV2 UINT64_C(0x0000000000000001) 18 | #define DSFMT_IDSTR "dSFMT2-44497:304-19:ff6dfffffffef-7ffdddeefff6f" 19 | 20 | 21 | /* PARAMETERS FOR ALTIVEC */ 22 | #if defined(__APPLE__) /* For OSX */ 23 | #define ALTI_SL1 (vector unsigned char)(3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3) 24 | #define ALTI_SL1_PERM \ 25 | (vector unsigned char)(2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1) 26 | #define ALTI_SL1_MSK \ 27 | (vector unsigned int)(0xffffffffU,0xfff80000U,0xffffffffU,0xfff80000U) 28 | #define ALTI_MSK (vector unsigned int)(DSFMT_MSK32_1, \ 29 | DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4) 30 | #else /* For OTHER OSs(Linux?) */ 31 | #define ALTI_SL1 {3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3} 32 | #define ALTI_SL1_PERM \ 33 | {2,3,4,5,6,7,30,30,10,11,12,13,14,15,0,1} 34 | #define ALTI_SL1_MSK \ 35 | {0xffffffffU,0xfff80000U,0xffffffffU,0xfff80000U} 36 | #define ALTI_MSK \ 37 | {DSFMT_MSK32_1, DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4} 38 | #endif 39 | 40 | #endif /* DSFMT_PARAMS44497_H */ 41 | -------------------------------------------------------------------------------- /dSFMT-params521.h: -------------------------------------------------------------------------------- 1 | #ifndef DSFMT_PARAMS521_H 2 | #define DSFMT_PARAMS521_H 3 | 4 | /* #define DSFMT_N 4 */ 5 | /* #define DSFMT_MAXDEGREE 544 */ 6 | #define DSFMT_POS1 3 7 | #define DSFMT_SL1 25 8 | #define DSFMT_MSK1 UINT64_C(0x000fbfefff77efff) 9 | #define DSFMT_MSK2 UINT64_C(0x000ffeebfbdfbfdf) 10 | #define DSFMT_MSK32_1 0x000fbfefU 11 | #define DSFMT_MSK32_2 0xff77efffU 12 | #define DSFMT_MSK32_3 0x000ffeebU 13 | #define DSFMT_MSK32_4 0xfbdfbfdfU 14 | #define DSFMT_FIX1 UINT64_C(0xcfb393d661638469) 15 | #define DSFMT_FIX2 UINT64_C(0xc166867883ae2adb) 16 | #define DSFMT_PCV1 UINT64_C(0xccaa588000000000) 17 | #define DSFMT_PCV2 UINT64_C(0x0000000000000001) 18 | #define DSFMT_IDSTR "dSFMT2-521:3-25:fbfefff77efff-ffeebfbdfbfdf" 19 | 20 | 21 | /* PARAMETERS FOR ALTIVEC */ 22 | #if defined(__APPLE__) /* For OSX */ 23 | #define ALTI_SL1 (vector unsigned char)(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1) 24 | #define ALTI_SL1_PERM \ 25 | (vector unsigned char)(3,4,5,6,7,29,29,29,11,12,13,14,15,0,1,2) 26 | #define ALTI_SL1_MSK \ 27 | (vector unsigned int)(0xffffffffU,0xfe000000U,0xffffffffU,0xfe000000U) 28 | #define ALTI_MSK (vector unsigned int)(DSFMT_MSK32_1, \ 29 | DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4) 30 | #else /* For OTHER OSs(Linux?) */ 31 | #define ALTI_SL1 {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} 32 | #define ALTI_SL1_PERM \ 33 | {3,4,5,6,7,29,29,29,11,12,13,14,15,0,1,2} 34 | #define ALTI_SL1_MSK \ 35 | {0xffffffffU,0xfe000000U,0xffffffffU,0xfe000000U} 36 | #define ALTI_MSK \ 37 | {DSFMT_MSK32_1, DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4} 38 | #endif 39 | 40 | #endif /* DSFMT_PARAMS521_H */ 41 | -------------------------------------------------------------------------------- /dSFMT-params86243.h: -------------------------------------------------------------------------------- 1 | #ifndef DSFMT_PARAMS86243_H 2 | #define DSFMT_PARAMS86243_H 3 | 4 | /* #define DSFMT_N 829 */ 5 | /* #define DSFMT_MAXDEGREE 86344 */ 6 | #define DSFMT_POS1 231 7 | #define DSFMT_SL1 13 8 | #define DSFMT_MSK1 UINT64_C(0x000ffedff6ffffdf) 9 | #define DSFMT_MSK2 UINT64_C(0x000ffff7fdffff7e) 10 | #define DSFMT_MSK32_1 0x000ffedfU 11 | #define DSFMT_MSK32_2 0xf6ffffdfU 12 | #define DSFMT_MSK32_3 0x000ffff7U 13 | #define DSFMT_MSK32_4 0xfdffff7eU 14 | #define DSFMT_FIX1 UINT64_C(0x1d553e776b975e68) 15 | #define DSFMT_FIX2 UINT64_C(0x648faadf1416bf91) 16 | #define DSFMT_PCV1 UINT64_C(0x5f2cd03e2758a373) 17 | #define DSFMT_PCV2 UINT64_C(0xc0b7eb8410000001) 18 | #define DSFMT_IDSTR "dSFMT2-86243:231-13:ffedff6ffffdf-ffff7fdffff7e" 19 | 20 | 21 | /* PARAMETERS FOR ALTIVEC */ 22 | #if defined(__APPLE__) /* For OSX */ 23 | #define ALTI_SL1 (vector unsigned char)(5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5) 24 | #define ALTI_SL1_PERM \ 25 | (vector unsigned char)(1,2,3,4,5,6,7,31,9,10,11,12,13,14,15,0) 26 | #define ALTI_SL1_MSK \ 27 | (vector unsigned int)(0xffffffffU,0xffffe000U,0xffffffffU,0xffffe000U) 28 | #define ALTI_MSK (vector unsigned int)(DSFMT_MSK32_1, \ 29 | DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4) 30 | #else /* For OTHER OSs(Linux?) */ 31 | #define ALTI_SL1 {5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5} 32 | #define ALTI_SL1_PERM \ 33 | {1,2,3,4,5,6,7,31,9,10,11,12,13,14,15,0} 34 | #define ALTI_SL1_MSK \ 35 | {0xffffffffU,0xffffe000U,0xffffffffU,0xffffe000U} 36 | #define ALTI_MSK \ 37 | {DSFMT_MSK32_1, DSFMT_MSK32_2, DSFMT_MSK32_3, DSFMT_MSK32_4} 38 | #endif 39 | 40 | #endif /* DSFMT_PARAMS86243_H */ 41 | -------------------------------------------------------------------------------- /dSFMT-src-2.0.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/dSFMT-src-2.0.tar.gz -------------------------------------------------------------------------------- /dSFMT-src-2.0.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/dSFMT-src-2.0.zip -------------------------------------------------------------------------------- /dSFMT-src-2.1.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/dSFMT-src-2.1.1.tar.gz -------------------------------------------------------------------------------- /dSFMT-src-2.1.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/dSFMT-src-2.1.1.zip -------------------------------------------------------------------------------- /dSFMT-src-2.1.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/dSFMT-src-2.1.tar.gz -------------------------------------------------------------------------------- /dSFMT-src-2.1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/dSFMT-src-2.1.zip -------------------------------------------------------------------------------- /debug.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/debug.log -------------------------------------------------------------------------------- /html/annotated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT: Data Structures 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT 26 |  2.2 27 |
28 | 29 |
36 |
37 | 38 | 39 | 46 | 52 |
53 |
54 |
55 |
Data Structures
56 |
57 |
58 |
Here are the data structures with brief descriptions:
59 | 60 | 61 |
DSFMT_T128-bit internal state array
W128_T128-bit data structure
62 |
63 | 64 | 65 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/html/bc_s.png -------------------------------------------------------------------------------- /html/classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT: Data Structure Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT 26 |  2.2 27 |
28 | 29 |
36 |
37 | 38 | 39 | 46 | 52 |
53 |
54 |
55 |
Data Structure Index
56 |
57 |
58 |
D | W
59 | 60 | 63 | 64 | 65 | 66 |
  D  
61 |
  W  
62 |
DSFMT_T   W128_T   
67 |
D | W
68 |
69 | 70 | 71 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/html/closed.png -------------------------------------------------------------------------------- /html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/html/doxygen.png -------------------------------------------------------------------------------- /html/files.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT: File List 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT 26 |  2.2 27 |
28 | 29 |
36 |
37 | 38 | 39 | 46 | 52 |
53 |
54 |
55 |
File List
56 |
57 |
58 |
Here is a list of all files with brief descriptions:
59 | 60 | 61 | 62 |
dSFMT-common.h [code]SIMD oriented Fast Mersenne Twister(SFMT) pseudorandom number generator with jump function
dSFMT.cDouble precision SIMD-oriented Fast Mersenne Twister (dSFMT) based on IEEE 754 format
dSFMT.h [code]Double precision SIMD oriented Fast Mersenne Twister(dSFMT) pseudorandom number generator based on IEEE 754 format
63 |
64 | 65 | 66 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /html/functions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT: Data Fields 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT 26 |  2.2 27 |
28 | 29 |
36 |
37 | 38 | 39 | 46 | 52 | 58 |
59 |
60 |
Here is a list of all struct and union fields with links to the structures/unions they belong to:
77 |
78 | 79 | 80 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /html/functions_vars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT: Data Fields - Variables 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT 26 |  2.2 27 |
28 | 29 |
36 |
37 | 38 | 39 | 46 | 52 | 58 |
59 |
60 |   77 |
78 | 79 | 80 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /html/globals_defs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT: Globals 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT 26 |  2.2 27 |
28 | 29 |
36 |
37 | 38 | 39 | 46 | 52 | 61 |
62 |
63 |  
    64 |
  • DSFMT_MEXP 65 | : dSFMT.h 66 |
  • 67 |
  • DSFMT_N 68 | : dSFMT.h 69 |
  • 70 |
  • DSFMT_N32 71 | : dSFMT.h 72 |
  • 73 |
  • DSFMT_N64 74 | : dSFMT.h 75 |
  • 76 |
  • DSFMT_PRE_INLINE 77 | : dSFMT.h 78 |
  • 79 |
  • DSFMT_PST_INLINE 80 | : dSFMT.h 81 |
  • 82 |
  • inline 83 | : dSFMT.h 84 |
  • 85 |
  • PRIu64 86 | : dSFMT.h 87 |
  • 88 |
  • PRIx64 89 | : dSFMT.h 90 |
  • 91 |
  • UINT64_C 92 | : dSFMT.h 93 |
  • 94 |
95 |
96 | 97 | 98 | 103 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /html/globals_type.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT: Globals 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT 26 |  2.2 27 |
28 | 29 |
36 |
37 | 38 | 39 | 46 | 52 | 61 |
62 |
63 |  
    64 |
  • dsfmt_t 65 | : dSFMT.h 66 |
  • 67 |
  • w128_t 68 | : dSFMT.h 69 |
  • 70 |
71 |
72 | 73 | 74 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /html/globals_vars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT: Globals 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT 26 |  2.2 27 |
28 | 29 |
36 |
37 | 38 | 39 | 46 | 52 | 61 |
62 |
63 |  
    64 |
  • dsfmt_global_data 65 | : dSFMT.h 66 | , dSFMT.c 67 |
  • 68 |
  • dsfmt_global_mexp 69 | : dSFMT.h 70 |
  • 71 |
  • dsfmt_mexp 72 | : dSFMT.c 73 |
  • 74 |
75 |
76 | 77 | 78 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /html/mainpage_8txt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT: mainpage.txt File Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT 26 |  2.2 27 |
28 | 29 |
36 |
37 | 38 | 39 | 46 | 52 |
53 |
54 |
55 |
mainpage.txt File Reference
56 |
57 |
58 |
59 | 60 | 61 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/html/nav_f.png -------------------------------------------------------------------------------- /html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/html/nav_h.png -------------------------------------------------------------------------------- /html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/html/open.png -------------------------------------------------------------------------------- /html/struct_d_s_f_m_t___t.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT: DSFMT_T Struct Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT 26 |  2.2 27 |
28 | 29 |
36 |
37 | 38 | 39 | 46 | 52 |
53 |
54 | 56 |
57 |
DSFMT_T Struct Reference
58 |
59 |
60 | 61 |

the 128-bit internal state array 62 | More...

63 | 64 |

#include <dSFMT.h>

65 | 66 | 68 | 69 | 70 |

67 | Data Fields

w128_t status [DSFMT_N+1]
int idx
71 |

Detailed Description

72 |

the 128-bit internal state array

73 |

Field Documentation

74 | 75 |
76 |
77 | 78 | 79 | 80 | 81 |
int DSFMT_T::idx
82 |
83 | 88 |
89 | 90 | 104 |
The documentation for this struct was generated from the following file: 107 |
108 | 109 | 110 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/html/tab_a.png -------------------------------------------------------------------------------- /html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/html/tab_b.png -------------------------------------------------------------------------------- /html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/html/tab_h.png -------------------------------------------------------------------------------- /html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/html/tab_s.png -------------------------------------------------------------------------------- /html/tabs.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3 { 2 | background-image: url('tab_b.png'); 3 | width: 100%; 4 | z-index: 101; 5 | font-size: 13px; 6 | } 7 | 8 | .tabs2 { 9 | font-size: 10px; 10 | } 11 | .tabs3 { 12 | font-size: 9px; 13 | } 14 | 15 | .tablist { 16 | margin: 0; 17 | padding: 0; 18 | display: table; 19 | } 20 | 21 | .tablist li { 22 | float: left; 23 | display: table-cell; 24 | background-image: url('tab_b.png'); 25 | line-height: 36px; 26 | list-style: none; 27 | } 28 | 29 | .tablist a { 30 | display: block; 31 | padding: 0 20px; 32 | font-weight: bold; 33 | background-image:url('tab_s.png'); 34 | background-repeat:no-repeat; 35 | background-position:right; 36 | color: #283A5D; 37 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 38 | text-decoration: none; 39 | outline: none; 40 | } 41 | 42 | .tabs3 .tablist a { 43 | padding: 0 10px; 44 | } 45 | 46 | .tablist a:hover { 47 | background-image: url('tab_h.png'); 48 | background-repeat:repeat-x; 49 | color: #fff; 50 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 51 | text-decoration: none; 52 | } 53 | 54 | .tablist li.current a { 55 | background-image: url('tab_a.png'); 56 | background-repeat:repeat-x; 57 | color: #fff; 58 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 59 | } 60 | -------------------------------------------------------------------------------- /html/union_w128___t.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT: W128_T Union Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT 26 |  2.2 27 |
28 | 29 |
36 |
37 | 38 | 39 | 46 | 52 |
53 |
54 | 56 |
57 |
W128_T Union Reference
58 |
59 |
60 | 61 |

128-bit data structure 62 | More...

63 | 64 |

#include <dSFMT.h>

65 | 66 | 68 | 69 | 70 | 71 |

67 | Data Fields

uint64_t u [2]
uint32_t u32 [4]
double d [2]
72 |

Detailed Description

73 |

128-bit data structure

74 |

Field Documentation

75 | 76 |
77 |
78 | 79 | 80 | 81 | 82 |
double W128_T::d[2]
83 |
84 | 89 |
90 | 91 |
92 |
93 | 94 | 95 | 96 | 97 |
uint64_t W128_T::u[2]
98 |
99 |
100 | 101 |

Referenced by convert_o0o1(), do_recursion(), initial_mask(), and period_certification().

102 | 103 |
104 |
105 | 106 |
107 |
108 | 109 | 110 | 111 | 112 |
uint32_t W128_T::u32[4]
113 |
114 |
115 | 116 |

Referenced by dsfmt_chk_init_by_array(), and dsfmt_chk_init_gen_rand().

117 | 118 |
119 |
120 |
The documentation for this union was generated from the following file: 123 |
124 | 125 | 126 | 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /jump/CHANGE-LOG.txt: -------------------------------------------------------------------------------- 1 | ver 0.1 2 | ------- 3 | The first version. 4 | -------------------------------------------------------------------------------- /jump/FILES.txt: -------------------------------------------------------------------------------- 1 | This archive contails following directories and files. 2 | 3 | TOP DIRECTORY 4 | FILES.txt: This file. 5 | CHANGE-LOG.txt change log. 6 | LICENSE.txt: License file. 7 | Makefile: Makefile for test programs. 8 | readme.html readme file (English) 9 | readme-jp.html readme file (Japanese) 10 | dSFMT-jump.h jump function header file 11 | dSFMT-jump.c jump function 12 | dSFMT-calc-jump.hpp jump polynomial calculation 13 | calc-jump.cpp jump polynomial calculation executable main 14 | test-jump.cpp test 15 | check-jump.sh test shell 16 | sample1.c sample1 17 | sample2.c sample2 18 | poly.521.txt pre-calculated polynomial file for MEXP = 521 19 | poly.1279.txt pre-calculated polynomial file for MEXP = 1279 20 | poly.2203.txt pre-calculated polynomial file for MEXP = 2203 21 | poly.4253.txt pre-calculated polynomial file for MEXP = 4253 22 | poly.11213.txt pre-calculated polynomial file for MEXP = 11213 23 | poly.19937.txt pre-calculated polynomial file for MEXP = 19937 24 | poly.44497.txt pre-calculated polynomial file for MEXP = 44497 25 | poly.86243.txt pre-calculated polynomial file for MEXP = 86243 26 | poly.132049.tx pre-calculated polynomial file for MEXP = 132049 27 | poly.216091.txt pre-calculated polynomial file for MEXP = 216091 28 | 29 | html DIRECTORY: The documents generated by doxygen. 30 | -------------------------------------------------------------------------------- /jump/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007, 2008, 2009 Mutsuo Saito, Makoto Matsumoto 2 | and Hiroshima University. 3 | Copyright (c) 2011, 2012 Mutsuo Saito, Makoto Matsumoto, Hiroshima 4 | University and The University of Tokyo. 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are 9 | met: 10 | 11 | * Redistributions of source code must retain the above copyright 12 | notice, this list of conditions and the following disclaimer. 13 | * Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following 15 | disclaimer in the documentation and/or other materials provided 16 | with the distribution. 17 | * Neither the name of the Hiroshima University nor the names of 18 | its contributors may be used to endorse or promote products 19 | derived from this software without specific prior written 20 | permission. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 25 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 26 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 27 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 28 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 29 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 30 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 31 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 32 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 33 | -------------------------------------------------------------------------------- /jump/Makefile: -------------------------------------------------------------------------------- 1 | #for GNU make 2 | 3 | #DDEBUG = -O0 -g -DDEBUG=1 4 | # uncomment next line if you installed NTL with gf2x 5 | #LIBGF2X = -lgf2x 6 | # uncomment next line if you installed NTL with gmp 7 | #LIBGMP = -lgmp 8 | 9 | DEFINES = -D__STDC_CONSTANT_MACROS=1 -D__STDC_FORMAT_MACROS=1 10 | CPP = g++ 11 | #CPP = icc 12 | GPPFLAGS = -msse2 13 | #ICCPPFLAGS = -mssse3 14 | 15 | CC = gcc 16 | #CC = icc -fast 17 | GCCFLAGS = -msse2 --param max-inline-insns-single=1800 18 | #ICCFLAGS = -fast 19 | OPTI = -O3 -finline-functions -fomit-frame-pointer 20 | CCSTD = -std=c99 21 | WARN = -Wall #-Winline 22 | CCFLAGS = -I../ -Wmissing-prototypes $(GCCFLAGS) $(ICCFLAGS) $(OPTI) \ 23 | $(WARN) $(CCSTD) $(DDEBUG) 24 | CPPFLAGS = -I../ $(OPTI) $(GPPFLAGS) $(ICCPPFLAGS) $(WARN) $(DEFINES) $(DDEBUG) 25 | 26 | LINKOPT = -lntl $(LIBGF2X) $(LIBGMP) 27 | 28 | ALL_JUMP_TARGET = calc-jump test-jump-M521 test-jump-M1279 test-jump-M2203 \ 29 | test-jump-M4253 test-jump-M11213 test-jump-M19937 test-jump-M44497 \ 30 | test-jump-M86243 test-jump-M132049 test-jump-M216091 31 | 32 | # 33 | # jump 34 | # 35 | all:calc-jump 36 | 37 | check: ${ALL_JUMP_TARGET} 38 | ./check-jump.sh 39 | 40 | calc-jump:calc-jump.cpp dSFMT-calc-jump.hpp 41 | ${CPP} ${CPPFLAGS} -o $@ calc-jump.cpp ${LINKOPT} 42 | 43 | # 44 | # sample 45 | # 46 | sample1: sample1.c ../dSFMT.c dSFMT-jump.c ../dSFMT-common.h dSFMT-jump.h 47 | ${CC} ${CCFLAGS} -DDSFMT_MEXP=1279 -DHAVE_SSE2 -o $@ \ 48 | sample1.c ../dSFMT.c dSFMT-jump.c 49 | 50 | sample2: sample2.c ../dSFMT.c dSFMT-jump.c ../dSFMT-common.h dSFMT-jump.h 51 | ${CC} ${CCFLAGS} -DDSFMT_MEXP=521 -DHAVE_SSE2 -o $@ \ 52 | sample2.c ../dSFMT.c dSFMT-jump.c 53 | 54 | # 55 | # test 56 | # 57 | test-jump-M521: test-jump.cpp ../dSFMT.c dSFMT-jump.c dSFMT-calc-jump.hpp \ 58 | ../dSFMT-common.h dSFMT-jump.h 59 | ${CPP} ${CPPFLAGS} -DDSFMT_MEXP=521 -DHAVE_SSE2 -o $@ \ 60 | test-jump.cpp ../dSFMT.c dSFMT-jump.c ${LINKOPT} 61 | 62 | test-jump-M1279: test-jump.cpp ../dSFMT.c dSFMT-jump.c dSFMT-calc-jump.hpp \ 63 | ../dSFMT-common.h dSFMT-jump.h 64 | ${CPP} ${CPPFLAGS} -DDSFMT_MEXP=1279 -DHAVE_SSE2 -o $@ \ 65 | test-jump.cpp ../dSFMT.c dSFMT-jump.c ${LINKOPT} 66 | 67 | test-jump-M2203: test-jump.cpp ../dSFMT.c dSFMT-jump.c dSFMT-calc-jump.hpp \ 68 | ../dSFMT-common.h dSFMT-jump.h 69 | ${CPP} ${CPPFLAGS} -DDSFMT_MEXP=2203 -DHAVE_SSE2 -o $@ \ 70 | test-jump.cpp ../dSFMT.c dSFMT-jump.c ${LINKOPT} 71 | 72 | test-jump-M4253: test-jump.cpp ../dSFMT.c dSFMT-jump.c dSFMT-calc-jump.hpp \ 73 | ../dSFMT-common.h dSFMT-jump.h 74 | ${CPP} ${CPPFLAGS} -DDSFMT_MEXP=4253 -DHAVE_SSE2 -o $@ \ 75 | test-jump.cpp ../dSFMT.c dSFMT-jump.c ${LINKOPT} 76 | 77 | test-jump-M11213: test-jump.cpp ../dSFMT.c dSFMT-jump.c dSFMT-calc-jump.hpp \ 78 | ../dSFMT-common.h dSFMT-jump.h 79 | ${CPP} ${CPPFLAGS} -DDSFMT_MEXP=11213 -DHAVE_SSE2 -o $@ \ 80 | test-jump.cpp ../dSFMT.c dSFMT-jump.c ${LINKOPT} 81 | 82 | test-jump-M19937: test-jump.cpp ../dSFMT.c dSFMT-jump.c dSFMT-calc-jump.hpp \ 83 | ../dSFMT-common.h dSFMT-jump.h 84 | ${CPP} ${CPPFLAGS} -DDSFMT_MEXP=19937 -DHAVE_SSE2 -o $@ \ 85 | test-jump.cpp ../dSFMT.c dSFMT-jump.c ${LINKOPT} 86 | 87 | test-jump-M44497: test-jump.cpp ../dSFMT.c dSFMT-jump.c dSFMT-calc-jump.hpp \ 88 | ../dSFMT-common.h dSFMT-jump.h 89 | ${CPP} ${CPPFLAGS} -DDSFMT_MEXP=44497 -DHAVE_SSE2 -o $@ \ 90 | test-jump.cpp ../dSFMT.c dSFMT-jump.c ${LINKOPT} 91 | 92 | test-jump-M86243: test-jump.cpp ../dSFMT.c dSFMT-jump.c dSFMT-calc-jump.hpp \ 93 | ../dSFMT-common.h dSFMT-jump.h 94 | ${CPP} ${CPPFLAGS} -DDSFMT_MEXP=86243 -DHAVE_SSE2 -o $@ \ 95 | test-jump.cpp ../dSFMT.c dSFMT-jump.c ${LINKOPT} 96 | 97 | test-jump-M132049: test-jump.cpp ../dSFMT.c dSFMT-jump.c dSFMT-calc-jump.hpp \ 98 | ../dSFMT-common.h dSFMT-jump.h 99 | ${CPP} ${CPPFLAGS} -DDSFMT_MEXP=132049 -DHAVE_SSE2 -o $@ \ 100 | test-jump.cpp ../dSFMT.c dSFMT-jump.c ${LINKOPT} 101 | 102 | test-jump-M216091: test-jump.cpp ../dSFMT.c dSFMT-jump.c dSFMT-calc-jump.hpp \ 103 | ../dSFMT-common.h dSFMT-jump.h 104 | ${CPP} ${CPPFLAGS} -DDSFMT_MEXP=216091 -DHAVE_SSE2 -o $@ \ 105 | test-jump.cpp ../dSFMT.c dSFMT-jump.c ${LINKOPT} 106 | 107 | .cpp.o: 108 | ${CPP} -c $< 109 | 110 | .c.o: 111 | ${CC} -c $< 112 | 113 | clean: 114 | rm -rf *.o *~ *.dSYM 115 | 116 | clean-all: 117 | rm -f $(ALL_JUMP_TARGET) 118 | -------------------------------------------------------------------------------- /jump/Makefile.me: -------------------------------------------------------------------------------- 1 | # -*- makefile -*- 2 | #for GNU make 3 | 4 | #DDEBUG = -O0 -g -DDEBUG=1 5 | CPPOPT = -D__STDC_CONSTANT_MACROS=1 -D__STDC_FORMAT_MACROS=1 6 | CCOPT = -std=c99 -Wall -Wmissing-prototypes 7 | CC = gcc -O9 -I../ $(DDEBUG) $(DMEXP) $(DPG) 8 | CPP = g++ -Wall -O9 -I../ $(DDEBUG) $(DMEXP) $(DPG) 9 | OMP = -fopenmp 10 | 11 | LINKOPT = -lntl -lgf2x 12 | 13 | FILES = FILES.txt \ 14 | CHANGE-LOG.txt \ 15 | LICENSE.txt \ 16 | Makefile \ 17 | readme.html \ 18 | readme-jp.html \ 19 | dSFMT-jump.h \ 20 | dSFMT-jump.c \ 21 | dSFMT-calc-jump.hpp \ 22 | calc-jump.cpp \ 23 | test-jump.cpp \ 24 | check-jump.sh \ 25 | sample1.c \ 26 | sample2.c \ 27 | poly.521.txt \ 28 | poly.1279.txt \ 29 | poly.2203.txt \ 30 | poly.4253.txt \ 31 | poly.11213.txt \ 32 | poly.19937.txt \ 33 | poly.44497.txt \ 34 | poly.86243.txt \ 35 | poly.132049.txt \ 36 | poly.216091.txt \ 37 | html 38 | 39 | VERSION = 0.1 40 | DIR = dSFMTJump-src-${VERSION} 41 | 42 | doc: 43 | rm -rf html 44 | doxygen doxygen.cfg 45 | 46 | .PHONY : tar.gz 47 | tar.gz: $(FILES) 48 | mkdir ${DIR} 49 | mkdir ${DIR}/jump 50 | cp -r ${FILES} ${DIR}/jump 51 | tar czvf ${DIR}.tar.gz ${DIR}/* 52 | rm -rf ${DIR} 53 | 54 | .PHONY : zip 55 | zip: $(FILES) 56 | mkdir ${DIR} 57 | mkdir ${DIR}/jump 58 | cp -r ${FILES} ${DIR}/jump 59 | zip -r ${DIR}.zip ${DIR}/* 60 | rm -rf ${DIR} 61 | 62 | calc-characteristic: calc-characteristic.cpp dSFMText.hpp 63 | ${CPP} ${CPPOPT} -o $@ calc-characteristic.cpp ${LINKOPT} 64 | 65 | calc-characteristic-mpi: calc-characteristic-mpi.cpp dSFMText.hpp 66 | ${CPP} ${CPPOPT} ${OMP} -o $@ calc-characteristic-mpi.cpp ${LINKOPT} 67 | 68 | factorization:factorization.cpp 69 | ${CPP} ${CPPOPT} -o $@ factorization.cpp ${LINKOPT} 70 | 71 | degree:degree.cpp 72 | ${CPP} ${CPPOPT} -o $@ degree.cpp ${LINKOPT} 73 | 74 | 75 | .cpp.o: 76 | ${CPP} -c $< 77 | 78 | .c.o: 79 | ${CC} -c $< 80 | 81 | clean: 82 | rm -rf *.o *~ *.dSYM 83 | -------------------------------------------------------------------------------- /jump/calc-characteristic: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/calc-characteristic -------------------------------------------------------------------------------- /jump/calc-characteristic-mpi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/calc-characteristic-mpi -------------------------------------------------------------------------------- /jump/calc-characteristic-mpi.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file calc-characteristic.cpp 3 | * 4 | * @brief calculate characteristic polynomial. 5 | * 6 | * @author Mutsuo Saito (Hiroshima University) 7 | * @author Makoto Matsumoto (The University of Tokyo) 8 | * 9 | * Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, 10 | * Hiroshima University and The University of Tokyo. 11 | * All rights reserved. 12 | * 13 | * The 3-clause BSD License is applied to this software, see 14 | * LICENSE.txt 15 | */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include "dSFMText.hpp" 24 | #include "dSFMT-calc-jump.hpp" 25 | #include 26 | #include 27 | #include 28 | 29 | using namespace dsfmt; 30 | using namespace NTL; 31 | using namespace std; 32 | static void get_lcm_sub(GF2X& lcmpoly, dSFMText& dsfmt); 33 | 34 | void calc_minimal(GF2X& minimal, int maxdegree, w128_t outseq[], int bitpos) 35 | { 36 | uint64_t mask; 37 | vec_GF2 seq; 38 | seq.SetLength(2 * maxdegree); 39 | int idx; 40 | if (bitpos >= 64) { 41 | idx = 1; 42 | mask = UINT64_C(1) << (bitpos - 64); 43 | } else { 44 | idx = 0; 45 | mask = UINT64_C(1) << bitpos; 46 | } 47 | for (int i = 0; i < 2 * maxdegree; i++) { 48 | if (outseq[i].u[idx] & mask) { 49 | seq[i] = 1; 50 | } else { 51 | seq[i] = 0; 52 | } 53 | } 54 | MinPolySeq(minimal, seq, maxdegree); 55 | } 56 | 57 | void LCM(GF2X& lcm, const GF2X& x, const GF2X& y) { 58 | GF2X gcd; 59 | mul(lcm, x, y); 60 | GCD(gcd, x, y); 61 | lcm /= gcd; 62 | } 63 | 64 | void get_lcm(int rank, int num_process, GF2X& lcmpoly, dSFMText& dsfmt) { 65 | int maxdegree = dsfmt.get_mamaxdegree(); 66 | dsfmt.seeding(1234); 67 | get_lcm_sub(lcmpoly, dsfmt); 68 | int unit = maxdegree / num_process; 69 | int start = rank * num_process; 70 | for(int i = start; i < start + unit; i++) { 71 | dsfmt.init_basis(i); 72 | get_lcm_sub(lcmpoly, dsfmt); 73 | } 74 | } 75 | 76 | static void get_lcm_sub(GF2X& lcmpoly, dSFMText& dsfmt) { 77 | GF2X tmp; 78 | int mamaxdegree = dsfmt.get_mamaxdegree(); 79 | w128_t out_seq[2 * mamaxdegree]; 80 | int i, bitpos; 81 | 82 | for (int i = 0; i < 2 * mamaxdegree; i++) { 83 | out_seq[i] = dsfmt.next(); 84 | } 85 | 86 | GF2X minimal; 87 | for (bitpos = 0; bitpos < 128; bitpos++) { 88 | calc_minimal(minimal, mamaxdegree, out_seq, bitpos); 89 | LCM(tmp, lcmpoly, minimal); 90 | lcmpoly = tmp; 91 | } 92 | } 93 | 94 | #if defined(IRRE_CHECK) 95 | static int has_large_irreducible(GF2X& fpoly, int degree) { 96 | static const GF2X t2(2, 1); 97 | static const GF2X t1(1, 1); 98 | GF2X t2m; 99 | GF2X t; 100 | GF2X alpha; 101 | int m; 102 | 103 | t2m = t2; 104 | if (deg(fpoly) < degree) { 105 | return 0; 106 | } 107 | t = t1; 108 | t += t2m; 109 | 110 | for (m = 1; deg(fpoly) > degree; m++) { 111 | for(;;) { 112 | GCD(alpha, fpoly, t); 113 | if (IsOne(alpha)) { 114 | break; 115 | } 116 | fpoly /= alpha; 117 | if (deg(fpoly) < degree) { 118 | return 0; 119 | } 120 | } 121 | t2m *= t2m; 122 | t2m %= fpoly; 123 | add(t, t2m, t1); 124 | } 125 | if (deg(fpoly) != degree) { 126 | return 0; 127 | } 128 | return IterIrredTest(fpoly); 129 | } 130 | #endif 131 | 132 | int main(int argc, char *argv[]) { 133 | int rank; 134 | int num_process; 135 | int MPI_Status status; 136 | MPI_Init(&argc, &argv); 137 | MPI_Comm_rank(MPI_COMM_WORLD, &rank); 138 | MPI_Comm_size(MPI_COMM_WORLD, &num_process); 139 | if (argc < 6) { 140 | cout << argv[0] << " mexp pos1 sl1 mask1 mask2" << endl; 141 | MPI_Finalize(); 142 | return -1; 143 | } 144 | int mexp = strtol(argv[1], NULL, 10); 145 | int pos1 = strtol(argv[2], NULL, 10); 146 | int sl1 = strtol(argv[3], NULL, 10); 147 | uint64_t mask[2]; 148 | mask[0] = strtoull(argv[4], NULL, 16); 149 | mask[1] = strtoull(argv[5], NULL, 16); 150 | stringstream ss; 151 | ss << "lcm." << dec << mexp << "." << rank << ".txt"; 152 | string fname; 153 | ss >> fname; 154 | //ofstream fout("/tmp/results.txt", ios::trunc ); 155 | ofstream fout(fname.c_str()); 156 | 157 | dSFMText dsfmt(mexp, pos1, sl1, mask[0], mask[1]); 158 | GF2X characteristic(0,1); 159 | get_lcm(rank, num_process, characteristic, dsfmt); 160 | GF2X work; 161 | work = characteristic; 162 | #if defined(IRRE_CHECK) 163 | if (!has_large_irreducible(characteristic, mexp)) { 164 | fout << "error? does not have large irreducible" << endl; 165 | MPI_Finalize(); 166 | return -1; 167 | } 168 | #endif 169 | string x; 170 | polytostring(x, work); 171 | fout << "#" << dec << mexp; 172 | fout << "," << dec << pos1; 173 | fout << "," << dec << sl1; 174 | fout << "," << hex << mask[0]; 175 | fout << "," << hex << mask[1]; 176 | fout << dec << endl; 177 | fout << x << endl; 178 | fout << dec << flush; 179 | MPI_Finalize(); 180 | } 181 | -------------------------------------------------------------------------------- /jump/calc-jump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/calc-jump -------------------------------------------------------------------------------- /jump/calc-jump.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file calc-jump.cpp 3 | * 4 | * @brief calc jump function. 5 | * 6 | * @author Mutsuo Saito (Hiroshima University) 7 | * @author Makoto Matsumoto (The University of Tokyo) 8 | * 9 | * Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, 10 | * Hiroshima University and The University of Tokyo. 11 | * All rights reserved. 12 | * 13 | * The 3-clause BSD License is applied to this software, see 14 | * LICENSE.txt 15 | */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include "dSFMT-calc-jump.hpp" 28 | 29 | using namespace NTL; 30 | using namespace std; 31 | using namespace dsfmt; 32 | 33 | static void read_file(GF2X& lcmpoly, long line_no, const string& file); 34 | 35 | int main(int argc, char * argv[]) { 36 | if (argc <= 2) { 37 | cout << argv[0] << " jump-step poly-file" << endl; 38 | cout << " jump-step: a number between zero and 2^{DSFMT_MEXP}-1.\n" 39 | << " large decimal number is allowed." << endl; 40 | cout << " poly-file: one of poly.{MEXP}.txt " 41 | << "file" << endl; 42 | return -1; 43 | } 44 | string step_string = argv[1]; 45 | string filename = argv[2]; 46 | long no = 0; 47 | GF2X lcmpoly; 48 | read_file(lcmpoly, no, filename); 49 | ZZ step; 50 | stringstream ss(step_string); 51 | ss >> step; 52 | string jump_str; 53 | calc_jump(jump_str, step, lcmpoly); 54 | cout << "jump polynomial:" << endl; 55 | cout << jump_str << endl; 56 | return 0; 57 | } 58 | 59 | 60 | static void read_file(GF2X& lcmpoly, long line_no, const string& file) 61 | { 62 | ifstream ifs(file.c_str()); 63 | string line; 64 | for (int i = 0; i < line_no; i++) { 65 | ifs >> line; 66 | ifs >> line; 67 | } 68 | if (ifs) { 69 | ifs >> line; 70 | line = ""; 71 | ifs >> line; 72 | } 73 | stringtopoly(lcmpoly, line); 74 | } 75 | -------------------------------------------------------------------------------- /jump/check-jump.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | exps="521 1279 2203 4253 11213 19937 44497 86243 132049 216091" 3 | for mexp in $exps; do 4 | 5 | if ./test-jump-M${mexp} -c > /dev/null 6 | then 7 | echo jump in mexp = $mexp OK. 8 | else 9 | exit 1 10 | fi 11 | done 12 | exit 0 13 | -------------------------------------------------------------------------------- /jump/dSFMT-calc-jump.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef DSFMT_CALC_JUMP_HPP 3 | #define DSFMT_CALC_JUMP_HPP 4 | /** 5 | * @file dSFMT-calc-jump.hpp 6 | * 7 | * @brief functions for calculating jump polynomial. 8 | * 9 | * @author Mutsuo Saito (Hiroshima University) 10 | * @author Makoto Matsumoto (The University of Tokyo) 11 | * 12 | * Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, 13 | * Hiroshima University and The University of Tokyo. 14 | * All rights reserved. 15 | * 16 | * The 3-clause BSD License is applied to this software, see 17 | * LICENSE.txt 18 | */ 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | namespace dsfmt { 25 | /** 26 | * converts polynomial to string for convenient use in C language. 27 | * @param x output string 28 | * @param polynomial input polynomial 29 | */ 30 | static inline void polytostring(std::string& x, NTL::GF2X& polynomial) 31 | { 32 | using namespace NTL; 33 | using namespace std; 34 | 35 | long degree = deg(polynomial); 36 | int buff; 37 | stringstream ss; 38 | for (int i = 0; i <= degree; i+=4) { 39 | buff = 0; 40 | for (int j = 0; j < 4; j++) { 41 | if (IsOne(coeff(polynomial, i + j))) { 42 | buff |= 1 << j; 43 | } else { 44 | buff &= (0x0f ^ (1 << j)); 45 | } 46 | } 47 | ss << hex << buff; 48 | } 49 | ss << flush; 50 | x = ss.str(); 51 | } 52 | 53 | /** 54 | * converts string to polynomial 55 | * @param str string 56 | * @param poly output polynomial 57 | */ 58 | static inline void stringtopoly(NTL::GF2X& poly, std::string& str) 59 | { 60 | using namespace NTL; 61 | using namespace std; 62 | 63 | stringstream ss(str); 64 | char c; 65 | long p = 0; 66 | clear(poly); 67 | while(ss) { 68 | ss >> c; 69 | if (!ss) { 70 | break; 71 | } 72 | if (c >= 'a') { 73 | c = c - 'a' + 10; 74 | } else { 75 | c = c - '0'; 76 | } 77 | for (int j = 0; j < 4; j++) { 78 | if (c & (1 << j)) { 79 | SetCoeff(poly, p, 1); 80 | } else { 81 | SetCoeff(poly, p, 0); 82 | } 83 | p++; 84 | } 85 | } 86 | } 87 | 88 | /** 89 | * calculate the jump polynomial. 90 | * SFMT generates 4 32-bit integers from one internal state. 91 | * @param jump_str output string which represents jump polynomial. 92 | * @param step jump step of internal state 93 | * @param characteristic polynomial 94 | */ 95 | static inline void calc_jump(std::string& jump_str, 96 | NTL::ZZ& step, 97 | NTL::GF2X& characteristic) 98 | { 99 | using namespace NTL; 100 | using namespace std; 101 | GF2X jump; 102 | PowerXMod(jump, step, characteristic); 103 | polytostring(jump_str, jump); 104 | } 105 | } 106 | #endif 107 | -------------------------------------------------------------------------------- /jump/dSFMT-jump.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file dSFMT-jump.c 3 | * 4 | * @brief do jump using jump polynomial. 5 | * 6 | * @author Mutsuo Saito (Hiroshima University) 7 | * @author Makoto Matsumoto (The University of Tokyo) 8 | * 9 | * Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, 10 | * Hiroshima University and The University of Tokyo. 11 | * All rights reserved. 12 | * 13 | * The 3-clause BSD License is applied to this software, see 14 | * LICENSE.txt 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include "dSFMT-params.h" 22 | #include "dSFMT.h" 23 | #include "dSFMT-jump.h" 24 | #include "dSFMT-common.h" 25 | 26 | #if defined(__cplusplus) 27 | extern "C" { 28 | #endif 29 | 30 | struct FIX_T { 31 | int mexp; 32 | uint64_t fix[4]; 33 | }; 34 | 35 | struct FIX_T fix_table[] = { 36 | {521, {UINT64_C(0x3fff56977f035125), 37 | UINT64_C(0x3ff553857b015035), 38 | UINT64_C(0x4034434434434434), 39 | UINT64_C(0x0140151151351371)}}, 40 | {1279, {UINT64_C(0x3ff87befce70e89f), 41 | UINT64_C(0x3ff5f6afa3c60868), 42 | UINT64_C(0xa4ca4caccaccacdb), 43 | UINT64_C(0x40444444444c44c4)}}, 44 | {4253, {UINT64_C(0x3ff85a66da51a81a), 45 | UINT64_C(0x3ff4f4aeab9688eb), 46 | UINT64_C(0x20524524534d34d3), 47 | UINT64_C(0xc9cc9cc9cc9ccdcf)}}, 48 | {216091, {UINT64_C(0x3ff096d54a871071), 49 | UINT64_C(0x3ffafa9bfbd5d55d), 50 | UINT64_C(0x0470470470573573), 51 | UINT64_C(0x0250250251259259)}}, 52 | {0, {}} 53 | }; 54 | 55 | inline static void next_state(dsfmt_t * dsfmt); 56 | 57 | #if defined(HAVE_SSE2) 58 | /** 59 | * add internal state of src to dest as F2-vector. 60 | * @param dest destination state 61 | * @param src source state 62 | */ 63 | inline static void add(dsfmt_t *dest, dsfmt_t *src) { 64 | int dp = dest->idx / 2; 65 | int sp = src->idx / 2; 66 | int diff = (sp - dp + DSFMT_N) % DSFMT_N; 67 | int p; 68 | int i; 69 | for (i = 0; i < DSFMT_N - diff; i++) { 70 | p = i + diff; 71 | dest->status[i].si 72 | = _mm_xor_si128(dest->status[i].si, src->status[p].si); 73 | } 74 | for (i = DSFMT_N - diff; i < DSFMT_N; i++) { 75 | p = i + diff - DSFMT_N; 76 | dest->status[i].si 77 | = _mm_xor_si128(dest->status[i].si, src->status[p].si); 78 | } 79 | dest->status[DSFMT_N].si 80 | = _mm_xor_si128(dest->status[DSFMT_N].si, 81 | src->status[DSFMT_N].si); 82 | } 83 | #else 84 | inline static void add(dsfmt_t *dest, dsfmt_t *src) { 85 | int dp = dest->idx / 2; 86 | int sp = src->idx / 2; 87 | int diff = (sp - dp + DSFMT_N) % DSFMT_N; 88 | int p; 89 | int i; 90 | for (i = 0; i < DSFMT_N - diff; i++) { 91 | p = i + diff; 92 | dest->status[i].u[0] ^= src->status[p].u[0]; 93 | dest->status[i].u[1] ^= src->status[p].u[1]; 94 | } 95 | for (; i < DSFMT_N; i++) { 96 | p = i + diff - DSFMT_N; 97 | dest->status[i].u[0] ^= src->status[p].u[0]; 98 | dest->status[i].u[1] ^= src->status[p].u[1]; 99 | } 100 | dest->status[DSFMT_N].u[0] ^= src->status[DSFMT_N].u[0]; 101 | dest->status[DSFMT_N].u[1] ^= src->status[DSFMT_N].u[1]; 102 | } 103 | #endif 104 | 105 | /** 106 | * calculate next state 107 | * @param dsfmt dSFMT internal state 108 | */ 109 | inline static void next_state(dsfmt_t * dsfmt) { 110 | int idx = (dsfmt->idx / 2) % DSFMT_N; 111 | w128_t * lung; 112 | w128_t * pstate = &dsfmt->status[0]; 113 | 114 | lung = &pstate[DSFMT_N]; 115 | do_recursion(&pstate[idx], 116 | &pstate[idx], 117 | &pstate[(idx + DSFMT_POS1) % DSFMT_N], 118 | lung); 119 | dsfmt->idx = (dsfmt->idx + 2) % DSFMT_N64; 120 | } 121 | 122 | inline static void add_fix(dsfmt_t * dsfmt) { 123 | int i; 124 | int index = -1; 125 | for (i = 0; fix_table[i].mexp != 0; i++) { 126 | if (fix_table[i].mexp == DSFMT_MEXP) { 127 | index = i; 128 | } 129 | if (fix_table[i].mexp > DSFMT_MEXP) { 130 | break; 131 | } 132 | } 133 | if (index < 0) { 134 | return; 135 | } 136 | for (i = 0; i < DSFMT_N; i++) { 137 | dsfmt->status[i].u[0] ^= fix_table[index].fix[0]; 138 | dsfmt->status[i].u[1] ^= fix_table[index].fix[1]; 139 | } 140 | dsfmt->status[DSFMT_N].u[0] ^= fix_table[index].fix[2]; 141 | dsfmt->status[DSFMT_N].u[1] ^= fix_table[index].fix[3]; 142 | } 143 | 144 | /** 145 | * jump ahead using jump_string 146 | * @param dsfmt dSFMT internal state input and output. 147 | * @param jump_string string which represents jump polynomial. 148 | */ 149 | void dSFMT_jump(dsfmt_t * dsfmt, const char * jump_string) { 150 | dsfmt_t work; 151 | int index = dsfmt->idx; 152 | int bits; 153 | memset(&work, 0, sizeof(dsfmt_t)); 154 | add_fix(dsfmt); 155 | dsfmt->idx = DSFMT_N64; 156 | 157 | for (int i = 0; jump_string[i] != '\0'; i++) { 158 | bits = jump_string[i]; 159 | assert(isxdigit(bits)); 160 | bits = tolower(bits); 161 | if (bits >= 'a' && bits <= 'f') { 162 | bits = bits - 'a' + 10; 163 | } else { 164 | bits = bits - '0'; 165 | } 166 | bits = bits & 0x0f; 167 | for (int j = 0; j < 4; j++) { 168 | if ((bits & 1) != 0) { 169 | add(&work, dsfmt); 170 | } 171 | next_state(dsfmt); 172 | bits = bits >> 1; 173 | } 174 | } 175 | *dsfmt = work; 176 | add_fix(dsfmt); 177 | dsfmt->idx = index; 178 | } 179 | 180 | #if defined(__cplusplus) 181 | } 182 | #endif 183 | -------------------------------------------------------------------------------- /jump/dSFMT-jump.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef DSFMT_JUMP_H 3 | #define DSFMT_JUMP_H 4 | /** 5 | * @file SFMT-jump.h 6 | * 7 | * @brief jump header file. 8 | * 9 | * @author Mutsuo Saito (Hiroshima University) 10 | * @author Makoto Matsumoto (The University of Tokyo) 11 | * 12 | * Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, 13 | * Hiroshima University and The University of Tokyo. 14 | * All rights reserved. 15 | * 16 | * The 3-clause BSD License is applied to this software, see 17 | * LICENSE.txt 18 | */ 19 | #if defined(__cplusplus) 20 | extern "C" { 21 | #endif 22 | 23 | #include "dSFMT.h" 24 | void dSFMT_jump(dsfmt_t * dsfmt, const char * jump_str); 25 | 26 | #if defined(__cplusplus) 27 | } 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /jump/degree: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/degree -------------------------------------------------------------------------------- /jump/degree.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file calc-characteristic.cpp 3 | * 4 | * @brief calculate characteristic polynomial. 5 | * 6 | * @author Mutsuo Saito (Hiroshima University) 7 | * @author Makoto Matsumoto (The University of Tokyo) 8 | * 9 | * Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, 10 | * Hiroshima University and The University of Tokyo. 11 | * All rights reserved. 12 | * 13 | * The 3-clause BSD License is applied to this software, see 14 | * LICENSE.txt 15 | */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | using namespace NTL; 26 | using namespace std; 27 | using namespace dsfmt; 28 | 29 | static void read_file(GF2X& lcmpoly, long line_no, const string& file); 30 | 31 | int main(int argc, char *argv[]) { 32 | if (argc < 2) { 33 | cout << argv[0] << " filename" << endl; 34 | return -1; 35 | } 36 | string filename = argv[1]; 37 | GF2X poly; 38 | read_file(poly, 0, filename); 39 | 40 | cout << "degree = " << dec << deg(poly) << endl; 41 | } 42 | 43 | static void read_file(GF2X& lcmpoly, long line_no, const string& file) 44 | { 45 | ifstream ifs(file.c_str()); 46 | string line; 47 | for (int i = 0; i < line_no; i++) { 48 | ifs >> line; 49 | ifs >> line; 50 | } 51 | if (ifs) { 52 | ifs >> line; 53 | line = ""; 54 | ifs >> line; 55 | } 56 | stringtopoly(lcmpoly, line); 57 | } 58 | -------------------------------------------------------------------------------- /jump/degree.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/degree.xlsx -------------------------------------------------------------------------------- /jump/fac.fix.2203.txt: -------------------------------------------------------------------------------- 1 | degree = 2205 2 | === factors === 3 | [1 0 0 1 1 1 0 0 1 0 1 1 0 1 1 0 1 1 0 1 1 0 0 1 0 1 1 0 0 1 1 1 0 0 1 0 0 0 1 1 1 1 0 1 0 1 1 1 1 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 1 1 1 0 0 0 0 1 0 1 1 1 1 0 0 0 0 1 1 1 0 1 1 0 0 1 0 0 1 0 1 0 1 1 0 1 0 1 1 0 0 1 0 0 0 0 1 0 0 1 1 0 1 1 0 1 0 1 0 0 1 0 1 1 0 0 0 0 1 0 0 0 0 1 1 1 0 1 1 0 1 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 1 0 0 1 1 0 0 0 0 0 0 1 0 1 0 1 1 1 1 1 1 1 1 0 0 0 1 0 1 0 1 0 0 1 1 0 0 1 1 0 1 1 0 0 0 1 0 0 1 1 0 0 0 1 1 1 1 1 1 0 1 0 1 0 0 1 1 0 0 0 0 1 0 1 0 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 0 0 1 1 0 0 1 1 0 1 0 1 0 0 1 1 0 1 1 1 1 1 0 1 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 0 0 1 1 1 0 0 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 1 0 0 1 0 1 0 1 0 1 1 0 1 1 0 1 0 1 0 0 1 0 0 1 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 1 1 1 1 0 1 0 0 1 0 0 1 0 1 1 1 0 0 0 0 0 1 0 0 1 0 1 0 0 0 1 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 1 1 0 1 0 1 1 1 1 0 1 1 0 1 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 1 1 0 1 1 0 1 1 0 0 1 1 0 1 0 1 1 0 0 0 0 1 1 0 1 1 0 0 0 0 0 1 0 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 1 1 0 0 0 1 0 0 1 1 1 1 0 0 1 1 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 0 0 0 1 1 1 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 1 0 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 1 1 1 0 1 1 0 1 1 0 1 0 1 1 1 0 1 0 0 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 0 1 0 1 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 1 0 1 1 1 0 1 0 0 0 1 1 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 1 1 0 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0 1 0 0 0 1 0 1 0 1 1 1 0 0 1 1 0 0 1 0 1 1 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 0 1 1 0 1 1 0 0 0 1 0 1 1 0 1 1 1 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 1 1 1 0 1 0 0 1 0 1 1 0 0 0 1 1 1 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 1 0 0 1 0 0 1 1 1 0 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 0 1 1 1 1 0 0 1 1 1 0 1 1 0 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 0 1 1 0 1 0 0 0 0 1 1 1 0 1 1 0 0 1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 1 1 0 1 1 1 1 1 1 1 0 0 1 0 1 1 1 1 1 0 1 0 1 1 0 0 1 1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 0 1 0 0 1 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 1 1 0 1 0 1 0 1 1 1 0 0 1 1 0 1 1 1 0 1 0 0 0 1 1 0 1 0 1 0 1 1 1 0 0 0 0 1 0 1 0 1 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 0 0 1 1 1 1 0 1 0 0 1 1 1 1 1 0 1 0 0 0 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 0 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 0 0 1 0 0 1 1 1 0 1 0 0 1 1 0 1 1 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 1 0 1 1 0 1 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 1 0 1 1 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 0 0 0 0 0 1 0 1 0 0 1 1 1 1 1 0 1 0 1 1 1 1 0 0 1 1 1 1 1 0 1 1 0 0 1 1 1 0 0 1 0 0 0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 1 1 0 0 1 1 1 0 1 1 1 0 0 0 0 1 0 0 0 1 0 1 1 1 1 0 0 1 0 1 1 1 0 1 0 1 1 0 1 0 0 0 0 1 1 0 0 0 1 1 0 0 1 1 1 1 1 1 1 1 1 0 0 1 0 1 1 0 0 0 0 1 1 0 1 1 1 1 0 1 1 0 0 0 0 1 0 0 1 0 0 1 1 0 1 1 0 0 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 0 1 1 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 1 1 0 1 1 0 1 1 0 1 0 0 0 1 0 1 1 1 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 0 0 1 0 1 1 1 1 0 0 0 1 1 1 0 0 1 1 0 0 0 0 0 1 0 1 0 1 1 1 0 0 0 1 1 1 0 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 0 1 1 1 1 1 0 1 0 1 1 1 1 0 1 0 1 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 1 0 0 1 0 1 1 0 0 0 0 0 0 1 0 0 1 1 1 0 1 0 0 1 1 0 1 0 1 0 1 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 1 0 1 0 1 0 0 0 1 0 0 1 1 1 0 1 0 1 1 1 1 1 0 0 0 1 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 1 1 1 0 1 1 0 1 0 0 1 1 0 0 0 1 0 1 1 0 0 0 1 1 0 1 0 0 1 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 0 1 0 0 0 1 0 1 0 1 0 1 1 0 0 1 0 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 0 0 1 1 1 0 1 0 1 1 0 1 1 0 0 0 0 0 1 0 1 0 0 1 0 1 1 1 1 0 1 0 0 0 1 0 1 1 1 1 0 1 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1 1 0 1 0 0 0 0 0 1 0 1 1 0 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 1 0 1 1 1 1 0 0 1 0 1 0 1 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 0 1 1 0 0 1 0 0 1 1 1 1 0 1 1 0 0 0 0 1 0 0 1 1 1 1 0 1 1]:2203:1 4 | [1 1]:1:2 5 | === factors === 6 | -------------------------------------------------------------------------------- /jump/fac.lcm.2203.txt: -------------------------------------------------------------------------------- 1 | degree = 2228 2 | === factors === 3 | [1 0 1 1]:3:1 4 | [1 0 0 1 1 1 0 0 1 0 1 1 0 1 1 0 1 1 0 1 1 0 0 1 0 1 1 0 0 1 1 1 0 0 1 0 0 0 1 1 1 1 0 1 0 1 1 1 1 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 1 1 1 0 0 0 0 1 0 1 1 1 1 0 0 0 0 1 1 1 0 1 1 0 0 1 0 0 1 0 1 0 1 1 0 1 0 1 1 0 0 1 0 0 0 0 1 0 0 1 1 0 1 1 0 1 0 1 0 0 1 0 1 1 0 0 0 0 1 0 0 0 0 1 1 1 0 1 1 0 1 0 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1 1 0 1 0 0 1 1 0 0 0 0 0 0 1 0 1 0 1 1 1 1 1 1 1 1 0 0 0 1 0 1 0 1 0 0 1 1 0 0 1 1 0 1 1 0 0 0 1 0 0 1 1 0 0 0 1 1 1 1 1 1 0 1 0 1 0 0 1 1 0 0 0 0 1 0 1 0 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 0 1 0 1 0 0 1 1 0 0 1 1 0 1 0 1 0 0 1 1 0 1 1 1 1 1 0 1 1 0 0 1 1 0 1 1 1 1 1 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 0 1 1 1 0 0 1 1 1 0 0 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 1 0 0 1 0 1 0 1 0 1 1 0 1 1 0 1 0 1 0 0 1 0 0 1 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 1 1 1 1 0 1 0 0 1 0 0 1 0 1 1 1 0 0 0 0 0 1 0 0 1 0 1 0 0 0 1 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 0 0 0 1 1 0 0 1 1 1 0 1 0 0 0 1 0 1 0 0 1 1 1 1 1 0 1 0 1 1 1 1 0 1 1 0 1 0 0 0 0 0 0 0 1 1 0 0 0 1 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 1 1 0 1 1 0 1 1 0 0 1 1 0 1 0 1 1 0 0 0 0 1 1 0 1 1 0 0 0 0 0 1 0 1 1 1 1 0 1 0 0 0 1 1 1 1 1 1 1 1 0 0 0 1 0 0 1 1 1 1 0 0 1 1 0 1 0 0 0 1 0 0 0 0 0 1 0 0 0 1 1 0 0 1 0 0 0 0 1 1 1 1 1 0 1 0 1 0 1 1 1 1 1 0 0 0 1 0 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 1 1 1 0 1 1 0 1 1 0 1 0 1 1 1 0 1 0 0 1 0 0 0 0 0 1 1 1 1 1 0 0 0 0 1 1 1 0 1 0 1 1 0 1 1 1 0 1 1 1 1 1 0 1 0 1 1 0 1 1 1 0 1 0 0 0 1 1 1 0 0 0 1 0 0 1 0 0 1 0 0 0 1 0 0 0 0 0 1 1 1 1 0 0 0 1 0 1 0 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0 1 0 0 0 1 0 1 0 1 1 1 0 0 1 1 0 0 1 0 1 1 1 0 1 0 0 0 0 1 0 1 0 1 0 1 0 0 0 1 1 0 1 1 0 0 0 1 0 1 1 0 1 1 1 0 0 0 0 0 0 0 0 1 0 1 1 0 0 1 0 0 1 0 0 0 0 0 0 1 0 0 1 1 1 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 1 1 1 0 1 0 0 1 0 1 1 0 0 0 1 1 1 1 0 1 1 0 1 0 0 1 1 0 1 0 1 1 1 0 0 1 0 0 1 1 1 0 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 1 1 0 1 1 1 1 1 1 1 0 0 0 1 1 1 1 0 1 0 1 0 0 1 1 1 1 0 0 1 1 1 0 1 1 0 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 0 1 1 0 0 0 1 1 0 1 0 1 1 0 1 1 0 1 0 0 0 0 1 1 1 0 1 1 0 0 1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 1 1 0 1 1 1 1 1 1 1 0 0 1 0 1 1 1 1 1 0 1 0 1 1 0 0 1 1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 0 1 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 0 1 0 0 1 0 0 1 1 0 0 0 1 0 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 1 0 1 1 0 1 0 1 0 1 1 1 0 0 1 1 0 1 1 1 0 1 0 0 0 1 1 0 1 0 1 0 1 1 1 0 0 0 0 1 0 1 0 1 0 0 0 0 1 1 1 0 0 0 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 0 0 0 1 1 1 1 0 1 0 0 1 1 1 1 1 0 1 0 0 0 1 1 0 1 1 1 0 1 1 1 1 0 0 1 0 1 1 0 0 1 1 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 1 1 1 0 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 0 0 1 0 0 1 1 1 0 1 0 0 1 1 0 1 1 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 1 0 1 1 0 1 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 1 1 0 0 1 1 1 0 0 1 1 1 0 1 0 1 1 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 0 0 0 0 0 1 0 1 0 0 1 1 1 1 1 0 1 0 1 1 1 1 0 0 1 1 1 1 1 0 1 1 0 0 1 1 1 0 0 1 0 0 0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 1 0 1 0 0 0 0 1 0 1 0 1 1 0 1 1 1 1 0 1 1 0 0 1 1 1 0 1 1 1 0 0 0 0 1 0 0 0 1 0 1 1 1 1 0 0 1 0 1 1 1 0 1 0 1 1 0 1 0 0 0 0 1 1 0 0 0 1 1 0 0 1 1 1 1 1 1 1 1 1 0 0 1 0 1 1 0 0 0 0 1 1 0 1 1 1 1 0 1 1 0 0 0 0 1 0 0 1 0 0 1 1 0 1 1 0 0 1 1 1 0 0 0 1 1 1 1 1 1 1 0 1 0 0 0 1 1 0 1 1 0 0 1 1 1 1 0 1 0 0 1 1 1 1 0 1 1 1 0 1 1 0 1 1 0 1 0 0 0 1 0 1 1 1 0 1 0 1 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0 1 1 1 1 0 1 1 0 1 1 0 1 1 0 1 1 0 1 0 0 1 0 1 1 1 1 0 0 0 1 1 1 0 0 1 1 0 0 0 0 0 1 0 1 0 1 1 1 0 0 0 1 1 1 0 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 0 1 1 1 1 1 0 1 0 1 1 1 1 0 1 0 1 0 1 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 1 0 1 0 0 1 0 1 1 0 0 0 0 0 0 1 0 0 1 1 1 0 1 0 0 1 1 0 1 0 1 0 1 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 1 0 1 0 1 0 0 0 1 0 0 1 1 1 0 1 0 1 1 1 1 1 0 0 0 1 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 1 1 1 0 1 1 0 1 0 0 1 1 0 0 0 1 0 1 1 0 0 0 1 1 0 1 0 0 1 1 0 1 0 1 0 1 0 0 0 0 1 0 1 0 1 0 1 1 0 0 0 1 1 0 1 1 0 0 0 1 1 0 1 0 1 0 1 0 1 1 0 1 1 1 0 1 0 1 1 1 1 0 0 1 1 0 1 1 0 1 0 0 0 1 0 1 0 1 0 1 1 0 0 1 0 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 0 0 1 1 1 0 1 0 1 1 0 1 1 0 0 0 0 0 1 0 1 0 0 1 0 1 1 1 1 0 1 0 0 0 1 0 1 1 1 1 0 1 0 0 0 1 1 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 1 1 0 0 0 1 1 0 1 0 0 0 0 0 1 0 1 1 0 0 0 0 1 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 1 0 1 0 1 1 1 1 0 0 1 0 1 0 1 1 1 1 0 0 1 1 1 0 0 0 0 0 0 1 0 1 1 0 0 1 0 0 1 1 1 1 0 1 1 0 0 0 0 1 0 0 1 1 1 1 0 1 1]:2203:1 5 | [1 1]:1:6 6 | [1 1 1 1 1]:4:4 7 | === factors === 8 | -------------------------------------------------------------------------------- /jump/factorization: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/factorization -------------------------------------------------------------------------------- /jump/factorization.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file calc-characteristic.cpp 3 | * 4 | * @brief calculate characteristic polynomial. 5 | * 6 | * @author Mutsuo Saito (Hiroshima University) 7 | * @author Makoto Matsumoto (The University of Tokyo) 8 | * 9 | * Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, 10 | * Hiroshima University and The University of Tokyo. 11 | * All rights reserved. 12 | * 13 | * The 3-clause BSD License is applied to this software, see 14 | * LICENSE.txt 15 | */ 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | using namespace NTL; 26 | using namespace std; 27 | using namespace dsfmt; 28 | 29 | static void read_file(GF2X& lcmpoly, long line_no, const string& file); 30 | 31 | int main(int argc, char *argv[]) { 32 | if (argc < 2) { 33 | cout << argv[0] << " filename" << endl; 34 | return -1; 35 | } 36 | string filename = argv[1]; 37 | GF2X poly; 38 | read_file(poly, 0, filename); 39 | 40 | vec_pair_GF2X_long factors; 41 | CanZass(factors, poly); 42 | cout << "degree = " << dec << deg(poly) << endl; 43 | cout << "=== factors ===" << endl; 44 | for (int i = 0; i < factors.length(); i++) { 45 | cout << factors[i].a; 46 | cout << ":"; 47 | cout << dec << deg(factors[i].a); 48 | cout << ":"; 49 | cout << factors[i].b << endl; 50 | } 51 | cout << "=== factors ===" << endl; 52 | } 53 | 54 | static void read_file(GF2X& lcmpoly, long line_no, const string& file) 55 | { 56 | ifstream ifs(file.c_str()); 57 | string line; 58 | for (int i = 0; i < line_no; i++) { 59 | ifs >> line; 60 | ifs >> line; 61 | } 62 | if (ifs) { 63 | ifs >> line; 64 | line = ""; 65 | ifs >> line; 66 | } 67 | stringtopoly(lcmpoly, line); 68 | } 69 | -------------------------------------------------------------------------------- /jump/fix.11213.txt: -------------------------------------------------------------------------------- 1 | #11213,37,19,ffffffdf7fffd,dfffffff6bfff 2 | 101100115cf68ab39e5737fb55908dd25d64e88e9b8e5fad4f8c5a310ce351af5a3956936725072c3b71ccf3a4344cea2ca1b8789c9a0a21ef763b96ce0a6fce9e8abd09a69fdb1245f14794b2da8d2a775ba744e9aae218b87cea8c48bf06b6d7bd3dbace00e92cd91f304ad4c9a34b3849e8264ba9921dba73d80350d2a38c335668862deffe62b9f6b7a4cebd3cd802eeb870b7eaf6f860c2458a4051a10d0c0b701a7e1790b751732f0ebee5d7e4271da1d464d661d41885c8e09722ca2a86ee8b91532d012d9fc13745fec5568b09f5fe9480da2c7531395a4b001a771650d54b82a9f50945f1aa691fba1d5e72fa450d7ee6ea5c1c103acadb9b5ec8abcc3f01701d091f46f282719cd667e9f6f0a7862f4272b11aa7af1f0cb49cc2c7be3b299dd60c5e229acada8c6dd37233fe75a3b8c41af397de763d63c2f2e4a84d8f65569f9c95306aaa57847b641dd6315726529630fae999a6c30a1e96bf9a94df69e00abf3f789d4307c3321d7fe038edd0e5a2d98f7d677ecca11c3f5d950a6fb1d0cebda4e53a7353c7423f9ac6d735e49709ae0c435c4afa73bb13785a7063dc83d20f7bc66977f379bc517c063241564e5969b8e5093817ee75bbcb2f3f3b41a4cc0e924c9fca773a55f56eae1609891b8b7881928dda9cd42945692e2edf1e1997942ec3f05920a7a409ff3269bb3676ab9834aa417a2c3ef995751c41d5095f6c4d94a619e0da7ea3b1092634cb7981267e3eae26b9c3dae9d02241ddb4b4409d871c8b8d0764b49c11944d6f2366b85fba68df034fa927c20534942471165ab9c62ee241c94fddd7fd77aa91530b5f1394427fa5269bc287e193c4f364ca7c7144555c00af6111cb7be38adbd7eeee487fa57ceeaa6ccc9aaa94ded7047693c282f68a348778614e87a0a9a74618f66551656db6b94e63307f162c78f2e2777797a3ccfbef9fe6d75f1df81f30c61e1ff9c0b4382d0c081d4c2789ae8d120ba51bef046253404c486dbd99adaac05da886904839e370e8933b3d4477ac4cef6f90f50e68a9b83770d3eaf40af7dfd4855e5cafd28ed9b651337fbd091e9c3ce2ca90afdec0df42ad1d66131c5c6ec543f4dee4c765524a7f634c9af4c43898f8d6d2e9a9a08cf83f367e0aebf3f77898958530ba1af491d5d46370c389299c3f683ccb23e7122a5628ce0b74f70744ab378ef98a15897f2b0618a050c1c403441ccc3457343912c7132bc980253f8879f9864e1123586afcd82cc78d493efe823f7ff37dd608d7d3da6527304fc1ab10cf863ff024bc517217fb8db462b055a429868ca19fd9cf90b4d627241217b4b6d755948b1b5abb13cc81a356e0068a1d5e6ef299793da6b3391d9370de8a18141ac9005bb7516f884f7d01b7540d484da6e815aeec2639ffd3242b7eb585882488b766d5b27ef1ccf895ee1e7595e71ccf6e6d3f5d6fd1185ccfe0727799d0113039d5c63f01a14998ebbd50960aec6c2f67d5e1f9d4b7dbee2ec48ef7ace8d446d74a4b6efaaf55225e36e016444e32f726f5e4c638ae96865292e068d17d7d7b504ce7f3dce4e2aa544c010aad6073f0471ff6a53ea358bd911007202cc549c0b10deafeacc0904f6ddeec416cd5d9db07ccbd6d7837c170fea5145b572c50b748a2bfd3b0986bac707615aeb451328c84608832e4d1e2c858ba5f6ecb06fe6cd0f260cd2f0fa9c7d0b517fd48fdeb787cb8be3725546ae3b4a1655d1b0a4fd513f8026bad168549d2c9f808d38d6b1c1dd094180c95d0455cb5d24b6340c60e2a40ce0680a6df028057000aaaf1401fffa509acffadaea8bffcebaab77ef991576ee56eedcce5665fccb166461319e609f748e30cbefbebaebebfbeeab440144ab44ef55ff55ff5d55ff50aa00af50affaaffaaffaeabfe2154015401545454545454fefefaaaaaaaaaaaaaaaaaaaaaafffff555555555555455555555555555000000000000000001 3 | doesn't have fixpoint. 4 | -------------------------------------------------------------------------------- /jump/fix.19937.txt: -------------------------------------------------------------------------------- 1 | #19937,117,19,ffafffffffb3f,ffdfffc90fffd 2 | ff333f003c33f0c3cfc333cc0cc3f4969f9108106e789ff18ff189fff990510fccfccff03cfc3c0c3cfffc0f7acb40e6a990450e1ba73f910899f9dfff3f3a69e49ffa086fd9208fec80f2e8eb0658eac476f25ae04903861f03c3ccff0f30f03f3fc0c303003c0cfead958c4a6aef3be1068f789f998da2204459caa7c5d9bec292b7a6c4f0e460daf08f127e26dcfe58c7a8669ef6a5e034c924efc3c39a96a93c10a4c831ad3e56c7b3b43547a370a9d6b358be2726c23df027795360bb9209e97489678b399f09fd68b932ad7d05beadd2123f69f96a88b3b65e770b7a041f48a509e4b147b72cfc5c01c80af902add987472ad531200ffcc4b6e4141f18b677269cc41a7f867f57a7278855165d6ac36ddf76b065a80778728e84c8adf855690a5e6231b8e0b187b07e0bbe7dcf78b096d9987993ec11079ccd8bb8a199bc691aae4377af01fb45da15b1c6b43b953ed00140a4e5235544b1fe483522d49de9f64a3b396fccd498214b982862aa28030cb3b011450eaf3bcb8f06380ca6348c8f79e401e3676de5ab222e1491b2a753352f59e4b66952cd552b6c1428ad4b6ce33e4c46705bf861526ea460ec5729f8ad5979e3eaa8e5a803244620e3aaa7bd5b82c4f3fa011820df6debcea8f8c40fe6c6237408bd251210a8f2b37c6384639cf98dccdf4bd7f3feca54cb174ede6f2856dd396c77628a16a5f0e002901888595e9d389b06cf3bcd148b92d2a1d6d8da3110d4607e6213937d7c7bbb88507c47208b878edadce3273054d8386a24b30ed82dfc04deba6fbcea957849441ac239cae32e14c36cbeae0467510037621d32fdc0cd7700247f448565cedb67094dac88755d4dc0c647b57b4a05e97fe73722701a69915e518aee1c643bf582be652d375c9c454ae9bbb1a4d6051623e42ebfc9f09ff8379f757840d3f8a36dc524663654b2bc50df7514eaa5b722ab21a36e1871fb9571471f783bfd7d3fed3be56b3ec36af6b494ed45b0927dba99d78296699c3a0f4ea9ba2999811b5e142ca99e3b10e3360304a174fbde47201b282ead5a021f09294dc1fec2208a7f2fed091ec715044d027ed98e13c7b6b6f46fe331c209985eff875c76cbdb5604ef1f94268cd46f368d6231df100c503140c38a9f040284d313b6212f928bea9eb50ceb8812fca96fd44082dda6d23ea1338ae1409c7531b4222656b04179518e02586446a69c4fbfe85d187fd9fae15823ee5b7068a094cdb88ecb591d4afe2f3a6ea34f4183bae0dad451be71081e8f247f1857c5b3c7b1e69505f8513b8d7d1adf60f4f473d8aa941b7455bf08bb99381db4b93b82dd5b3df96867f874658029d4bbcc2bd59f04f0354a2597a3eefd58df2fab1cf284e0b982501efb8214282ac1d7caf61f8ec254d158dd6a899e484b9aed1b178713a7450731e23a079bc989129ac5a1d46e7473d35ba2e4b0b0813a8bb7487fbee2e66192b72279446f0fde155e6462a497ea9c50018fb306a6b536cdf2eca747b84073c38cd67b684fbf856fd34a43e87bd5139e1fe10ec96ecbf83aef16fb0032d386dc86fa7b9fd7efab534f775f2b7dd74458dbb120084015aa991f082125b806b0de0d01130046847d1fdd1a230e11ab8cd818a8f66f3470d92cfd8423a7c1d98678dd54fc4b65e382132ff42d6653f0074cf898bd1888b6711352a51d2989f7d2667290eb3c3b32dfb1cae1871ad4a5df0f8bf2400c19a1747c1ec72cf51d484354824728c61b7cd0222086c48fc260d89bd843c969495a67ccb6e5f735607607ea82265b23ecf3e38f975ebb1efd5ce1a0baf4ae7ad9938c1928f830c7a3dd8b311848f80d5c571a644aa81c652ee2d3555d174f67af9d4e40a96664134365448943e6d8e3d444902dcb0fcb009ddf7090e841f045bdb7c2c1b27a06f3c76bc53a6a5fd27331d852051e006263fa7b2bda5f3a583fcd76be3d78c50fda3731a192f002aab5f4eef9997dee11ba16d93c23c949463083183ac7224d9820b789804dd7950c01d21c18639a3a5b0699cb087d9e6b9fa546ecfca05dfaa5de203dd764639bc1f27393d55ffc6afa8948a36a01fb2f9dd4bf57f6f61db820f4abda8ce8bdaf91c5502250a27b8a865e33e163ac07ed782edbcda61c87e64bd5ac21c4295fc91b91ccc31e23923598e2fe7efdb6491a28b838b3019a2ed10528ff0c1a4ea9fa5429ceff92e0feab0bd52dbc29b8cb730c9fd33a67c92bab0c55ce2946f7b3ab1afe0a29a5d82119b01fd983415632e027a498f82dcfc3b2a972be78e0dc959cc94384a81c8670fad8b4efa4f0ce79e74f66778ac526c6bfe1acbd0cd7d490e4c9a3ffcc37aa1dd0ae47ee7c7f3b62ef4ed96255f35413b13dd6d5bb596f594c0b9f5ebfa21a31d55ae944541193b743896bcb4eae29cb60efdb7d9c794efaea6503785b937e46e1c4d6053b63ffc4df991c4aff4e1264cbc40d2a3a86988e4cf7eb4c4d6055161da600f6a59d892c37b6f16da1a283cd58e21b6e534e8dcb5c92eb41ec90e483a957ad56fe46fed592a804ac0cc0beeb13814553c746355b3cf37f7e24cb6a0551035cf800e217bf7267ae581fff5c54b0b3f19a9f27bf479eae00cdc3251a56fea5596fff0111f333a6387857e8f3e2709cfcb3ce2361575bb8349f83cbe97b689bec64c67a2c18ef1ed3e34fb9af05579e34c4ea7827bc381c1238030fc4a567a38fea4ce82eed7f63f7e6cc9a518b663b47aa750ec5545848aa1ee2bdcc56651e59541c96a662023710a2207227c58431e6db8b6886ac3c8fc2ae8d90a330149aff028b904bc1c98f3ecbe605de20cc7426d2fbdd1519f62d63813b96a0f334b70811cb01d39a08dae899360b836fb60f804684a897d3630534552ce95263e92876cf17b951a5ea968fc2c6552e21c71b83d0f354cb00e345015779f2d0e1dd40d81b4ec1fd199a305639b0d3a7e6765057b12877fefbbbf1fc3a5f37454dbe70f913220f74d418cb531dbc7c27df8c63a3d07d4d72aa2b0fef1dd930a1574cd47fd75123ac64a01da2c4b69d742ae56acabfb137e3975fa848707c3f9e6391fd4066ac42009991417baa1c4d6823ce661703a09d7b4a8a2104ee78a9a4e769dbddbe7800fe417fe843c6bf2f7e6d334a3b9295183f6aa5266cc3076cb33fd2dc3103fd82546aed9c0b1c7c26ef922375d44e0c4e1e1f861cde1b17c16f5000909bf108803bb99804e9b2481a5416acfdb05774e9644af71f86cc10032bfc42cc27a546964e3f200faec3ad2f37896d965ee0ccaa5daa467971a57e3c6af5ff60519bc060922e49bcb11d768c089d0569566a614245aaa172496ac7bde055f1eb853f6af359613c07666266fb00a1553833ad95343cf30ff81f3823041f07666e869e456289aeb69595ae379d0461820b6df4920b6df4ad38a100300828e8d8e4d8e818e818e8d424d814d4efccffaa99aa956a996699669966996a6a665630303030303c3c3c0f0f0f0f0f0f033333ccccccccccccccffffffffffffffffff 3 | doesn't have fixpoint. 4 | -------------------------------------------------------------------------------- /jump/fix.2203.txt: -------------------------------------------------------------------------------- 1 | #2203,7,19,fdffff5edbfff,f77fffffffbfe 2 | dd9d6fc77d4446d7a9466db16cb4f689356d01880c6280a83f124061cfbbeb12c72ad872ef1e54fb05411db5410cc30b16be0144a62b9643a72cadf25c1196287faa586501dae664bf17ee842d0ca3f9a8af232885dfc75b15613661ba88596b6ba89545df824f7a420abbca18cb58eeb30bccd43f8ee6fd0c28d483fab99ded1b9ca787035c28311ff400aa15c68d71ba02c0afa470d409d4beb89c19ea27eb1cc0b33f0bbcbe6bdb96ef7066a276fe548ff488322f8ebb270d8485afa6a2935c4edf0837e2d96febd02dd727aad492c61055f3d6b99c6f324bd53ce00c119009241ecc1abc30d0644834d54c27e91dc79b3f042077770ca8c7350e5e63a71b32629294f50e3de44e47300d04e09734ed9e47a3 3 | doesn't have fixpoint. 4 | -------------------------------------------------------------------------------- /jump/html/annotated.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT-jump: Data Structures 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT-jump 26 |  0.1 27 |
28 | 29 |
36 |
37 | 38 | 39 | 47 | 53 |
54 |
55 |
56 |
Data Structures
57 |
58 |
59 |
Here are the data structures with brief descriptions:
60 | 61 |
FIX_T
62 |
63 | 64 | 65 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /jump/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/html/bc_s.png -------------------------------------------------------------------------------- /jump/html/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/html/bdwn.png -------------------------------------------------------------------------------- /jump/html/classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT-jump: Data Structure Index 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT-jump 26 |  0.1 27 |
28 | 29 |
36 |
37 | 38 | 39 | 47 | 53 |
54 |
55 |
56 |
Data Structure Index
57 |
58 |
59 | 60 | 61 | 63 | 64 | 65 | 66 |
  F  
62 |
FIX_T   
67 | 68 |
69 | 70 | 71 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /jump/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/html/closed.png -------------------------------------------------------------------------------- /jump/html/d_s_f_m_t-calc-jump_8hpp.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT-jump: dSFMT-calc-jump.hpp File Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT-jump 26 |  0.1 27 |
28 | 29 |
36 |
37 | 38 | 39 | 47 | 53 |
54 |
55 |
56 | Namespaces | 57 | Functions
58 |
59 |
dSFMT-calc-jump.hpp File Reference
60 |
61 |
62 | 63 |

functions for calculating jump polynomial. 64 | More...

65 |
#include <iostream>
66 | #include <iomanip>
67 | #include <sstream>
68 | #include <NTL/GF2X.h>
69 |
70 |

Go to the source code of this file.

71 | 72 | 74 | 75 | 77 | 78 | 79 | 80 | 81 | 82 | 83 |

73 | Namespaces

namespace  dsfmt

76 | Functions

static void dsfmt::polytostring (std::string &x, NTL::GF2X &polynomial)
 converts polynomial to string for convenient use in C language.
static void dsfmt::stringtopoly (NTL::GF2X &poly, std::string &str)
 converts string to polynomial
static void dsfmt::calc_jump (std::string &jump_str, NTL::ZZ &step, NTL::GF2X &characteristic)
 calculate the jump polynomial.
84 |

Detailed Description

85 |

functions for calculating jump polynomial.

86 |
Author:
Mutsuo Saito (Hiroshima University)
87 |
88 | Makoto Matsumoto (The University of Tokyo)
89 |

Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, Hiroshima University and The University of Tokyo. All rights reserved.

90 |

The 3-clause BSD License is applied to this software, see LICENSE.txt

91 |
92 | 93 | 94 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /jump/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/html/doxygen.png -------------------------------------------------------------------------------- /jump/html/files.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT-jump: File List 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT-jump 26 |  0.1 27 |
28 | 29 |
36 |
37 | 38 | 39 | 47 | 53 |
54 |
55 |
56 |
File List
57 |
58 |
59 |
Here is a list of all files with brief descriptions:
60 | 61 | 62 |
dSFMT-calc-jump.hpp [code]Functions for calculating jump polynomial
dSFMT-jump.cDo jump using jump polynomial
63 |
64 | 65 | 66 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /jump/html/functions.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT-jump: Data Fields 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT-jump 26 |  0.1 27 |
28 | 29 |
36 |
37 | 38 | 39 | 47 | 53 | 59 |
60 |
61 |
Here is a list of all struct and union fields with links to the structures/unions they belong to:
    62 |
  • fix 63 | : FIX_T 64 |
  • 65 |
  • mexp 66 | : FIX_T 67 |
  • 68 |
69 |
70 | 71 | 72 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /jump/html/functions_vars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT-jump: Data Fields - Variables 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT-jump 26 |  0.1 27 |
28 | 29 |
36 |
37 | 38 | 39 | 47 | 53 | 59 |
60 |
61 |  
    62 |
  • fix 63 | : FIX_T 64 |
  • 65 |
  • mexp 66 | : FIX_T 67 |
  • 68 |
69 |
70 | 71 | 72 | 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /jump/html/globals.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT-jump: Globals 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT-jump 26 |  0.1 27 |
28 | 29 |
36 |
37 | 38 | 39 | 47 | 53 | 60 |
61 |
62 |
Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
79 |
80 | 81 | 82 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /jump/html/globals_func.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT-jump: Globals 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT-jump 26 |  0.1 27 |
28 | 29 |
36 |
37 | 38 | 39 | 47 | 53 | 60 |
61 |
62 |   76 |
77 | 78 | 79 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /jump/html/globals_vars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT-jump: Globals 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT-jump 26 |  0.1 27 |
28 | 29 |
36 |
37 | 38 | 39 | 47 | 53 | 60 |
61 |
62 |   67 |
68 | 69 | 70 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /jump/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT-jump: Main Page 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT-jump 26 |  0.1 27 |
28 | 29 |
36 |
37 | 38 | 39 | 47 |
48 |
49 |
50 |
dSFMT-jump Documentation
51 |
52 |
53 |

This is SIMD oriented Fast Mersenne Twister pseudorandom number generator(dSFMT) with jump function. This Project provides jump function of dSFMT.

54 |

There are two steps for jumpping.

55 |
    56 |
  1. 57 | Calculate jump polynomial using magic polynomial.
      58 |
    • 59 | calc-jump executable file calculates a jump polynomial.
    • 60 |
    • 61 | calc-jump is written in C++ language and needs NTL for compile.
    • 62 |
    • 63 | Additionally, users can call dsfmt::calc_jump(std::string& jump_str, NTL::ZZ& step, NTL::GF2X& characteristic) in SFMT-calc-jump.hpp from their programs.
    • 64 |
    • 65 | jump steps used above is based on internal state, i.e, doubles are skipped 2 * jump steps.
    • 66 |
    67 |
  2. 68 |
  3. 69 | Change internal state of dSFMT into jumpped state. 76 |
  4. 77 |
78 |

Caution: The jump polynomial calculated using a magic polynomial is only available for jumpping dSFMT states which has MEXP correspond to the magic polynomial.

79 |
Author:
Mutsuo Saito (Hiroshima University)
80 |
81 | Makoto Matsumoto (The University of Tokyo)
82 |
Date:
2012-07-03
83 |

Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, Hiroshima University and The University of Tokyo. All rights reserved.

84 |

The 3-clause BSD License is applied to this software.

85 |
Copyright (c) 2007, 2008, 2009 Mutsuo Saito, Makoto Matsumoto
 86 | and Hiroshima University.
 87 | Copyright (c) 2011, 2012 Mutsuo Saito, Makoto Matsumoto, Hiroshima
 88 | University and The University of Tokyo.
 89 | All rights reserved.
 90 | 
 91 | Redistribution and use in source and binary forms, with or without
 92 | modification, are permitted provided that the following conditions are
 93 | met:
 94 | 
 95 |     * Redistributions of source code must retain the above copyright
 96 |       notice, this list of conditions and the following disclaimer.
 97 |     * Redistributions in binary form must reproduce the above
 98 |       copyright notice, this list of conditions and the following
 99 |       disclaimer in the documentation and/or other materials provided
100 |       with the distribution.
101 |     * Neither the name of the Hiroshima University nor the names of
102 |       its contributors may be used to endorse or promote products
103 |       derived from this software without specific prior written
104 |       permission.
105 | 
106 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
107 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
108 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
109 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
110 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
111 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
112 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
113 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
114 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
115 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
116 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
117 | 
118 | 119 | 120 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /jump/html/mainpage_8txt.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT-jump: mainpage.txt File Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT-jump 26 |  0.1 27 |
28 | 29 |
36 |
37 | 38 | 39 | 47 | 53 |
54 |
55 |
56 |
mainpage.txt File Reference
57 |
58 |
59 |
60 | 61 | 62 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /jump/html/namespacemembers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT-jump: Namespace Members 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT-jump 26 |  0.1 27 |
28 | 29 |
36 |
37 | 38 | 39 | 47 | 53 | 59 |
60 |
61 |
Here is a list of all namespace members with links to the namespace documentation for each member:
    62 |
  • calc_jump() 63 | : dsfmt 64 |
  • 65 |
  • polytostring() 66 | : dsfmt 67 |
  • 68 |
  • stringtopoly() 69 | : dsfmt 70 |
  • 71 |
72 |
73 | 74 | 75 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /jump/html/namespacemembers_func.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT-jump: Namespace Members 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT-jump 26 |  0.1 27 |
28 | 29 |
36 |
37 | 38 | 39 | 47 | 53 | 59 |
60 |
61 |  
    62 |
  • calc_jump() 63 | : dsfmt 64 |
  • 65 |
  • polytostring() 66 | : dsfmt 67 |
  • 68 |
  • stringtopoly() 69 | : dsfmt 70 |
  • 71 |
72 |
73 | 74 | 75 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /jump/html/namespaces.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT-jump: Namespace List 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT-jump 26 |  0.1 27 |
28 | 29 |
36 |
37 | 38 | 39 | 47 | 53 |
54 |
55 |
56 |
Namespace List
57 |
58 |
59 |
Here is a list of all namespaces with brief descriptions:
60 | 61 |
dsfmt
62 |
63 | 64 | 65 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /jump/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/html/nav_f.png -------------------------------------------------------------------------------- /jump/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/html/nav_h.png -------------------------------------------------------------------------------- /jump/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/html/open.png -------------------------------------------------------------------------------- /jump/html/struct_f_i_x___t.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | dSFMT-jump: FIX_T Struct Reference 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | 35 |
25 |
dSFMT-jump 26 |  0.1 27 |
28 | 29 |
36 |
37 | 38 | 39 | 47 | 53 |
54 |
55 | 57 |
58 |
FIX_T Struct Reference
59 |
60 |
61 | 62 | 64 | 65 | 66 |

63 | Data Fields

int mexp
uint64_t fix [4]
67 |

Field Documentation

68 | 69 |
70 |
71 | 72 | 73 | 74 | 75 |
uint64_t FIX_T::fix[4]
76 |
77 |
78 | 79 |

Referenced by add_fix().

80 | 81 |
82 |
83 | 84 |
85 |
86 | 87 | 88 | 89 | 90 |
int FIX_T::mexp
91 |
92 |
93 | 94 |

Referenced by add_fix().

95 | 96 |
97 |
98 |
The documentation for this struct was generated from the following file: 101 |
102 | 103 | 104 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /jump/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/html/tab_a.png -------------------------------------------------------------------------------- /jump/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/html/tab_b.png -------------------------------------------------------------------------------- /jump/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/html/tab_h.png -------------------------------------------------------------------------------- /jump/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/html/tab_s.png -------------------------------------------------------------------------------- /jump/html/tabs.css: -------------------------------------------------------------------------------- 1 | .tabs, .tabs2, .tabs3 { 2 | background-image: url('tab_b.png'); 3 | width: 100%; 4 | z-index: 101; 5 | font-size: 13px; 6 | } 7 | 8 | .tabs2 { 9 | font-size: 10px; 10 | } 11 | .tabs3 { 12 | font-size: 9px; 13 | } 14 | 15 | .tablist { 16 | margin: 0; 17 | padding: 0; 18 | display: table; 19 | } 20 | 21 | .tablist li { 22 | float: left; 23 | display: table-cell; 24 | background-image: url('tab_b.png'); 25 | line-height: 36px; 26 | list-style: none; 27 | } 28 | 29 | .tablist a { 30 | display: block; 31 | padding: 0 20px; 32 | font-weight: bold; 33 | background-image:url('tab_s.png'); 34 | background-repeat:no-repeat; 35 | background-position:right; 36 | color: #283A5D; 37 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); 38 | text-decoration: none; 39 | outline: none; 40 | } 41 | 42 | .tabs3 .tablist a { 43 | padding: 0 10px; 44 | } 45 | 46 | .tablist a:hover { 47 | background-image: url('tab_h.png'); 48 | background-repeat:repeat-x; 49 | color: #fff; 50 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 51 | text-decoration: none; 52 | } 53 | 54 | .tablist li.current a { 55 | background-image: url('tab_a.png'); 56 | background-repeat:repeat-x; 57 | color: #fff; 58 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); 59 | } 60 | -------------------------------------------------------------------------------- /jump/lcm.1279.txt: -------------------------------------------------------------------------------- 1 | #1279,9,19,efff7ffddffee,fbffffff77fff 2 | 14ca4b14ed4dab59798009986994e69dd13077f1a9e440dbf8b8ed606eeed432fd13b37e501ad87f3078e483cb19c2bd6c4ab7c088a032491825bec1cb67695ca591a4f2b9d9bef559f1f0df86b93107b474c08f65655a38c4dcba34722136b0ce066fbc37a441267541b17a44a7815c27069b930fb28d4d21b55d9d648187a8c361119d3c42dcc534812c607b48fead6d3b4443aad6e11b62511ea1520fa1df6f6920f9df8b94986d91e5e21 3 | fix:index:0 4 | 00087befce70e89f 0005f6afa3c60868 5 | 00087befce70e89f 0005f6afa3c60868 6 | 00087befce70e89f 0005f6afa3c60868 7 | 00087befce70e89f 0005f6afa3c60868 8 | 00087befce70e89f 0005f6afa3c60868 9 | 00087befce70e89f 0005f6afa3c60868 10 | 00087befce70e89f 0005f6afa3c60868 11 | 00087befce70e89f 0005f6afa3c60868 12 | 00087befce70e89f 0005f6afa3c60868 13 | 00087befce70e89f 0005f6afa3c60868 14 | 00087befce70e89f 0005f6afa3c60868 15 | 00087befce70e89f 0005f6afa3c60868 16 | a4ca4caccaccacdb 40444444444c44c4 17 | -------------------------------------------------------------------------------- /jump/lcm.132049.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/lcm.132049.tar.gz -------------------------------------------------------------------------------- /jump/lcm.216091.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/lcm.216091.tar.gz -------------------------------------------------------------------------------- /jump/lcm.4253.txt: -------------------------------------------------------------------------------- 1 | #4253,19,19,7b7fffef5feff,ffdffeffefbfc 2 | 11110a3af24f296024e376f219a750d04bac6afd10cff9221e5d6bbf24b7970687dabb371262579d55820616b7eef3ad2979f44619d0d21a422c56968795ddba6f92bca413c1787299e56c271dc053d10e7675b8973938f1851ca195e3457c6022d6f894977e69be85838bb2ef0266ad19311b944de9a7b9bcbbe9453421c723d84a3832bbebc316ec1a951edf54d1e0ff7de2e2fc6ac5d72439e56d2e4caa0f95ab3243ee2b6b89144dc92bb542c61c3611a625e33c4cbc67bdfd5012ce34e332eeecf028a105fce45bb220295362ccf8aa176c92b99383c37faa63defba250bf1cb32251f9ad36a8722ede5baa33d8b5a16c577777b9493f4e4c021a8d5d3ce07b54eddfd3a796997a2a65decd4b6890b7bdc5bf139d2ffbfa6cfc4636932ae195c937c9a00770a5146839461315adabab10511697ab431275373b47563da464fa3a4f4c4378dc62fae3b56e269df2e8a21a23fc3ef78bb52fabea47377967bdfd8b238cb0dc55fa5ff974c469d926a8108b4b27ec8a8f863f3f2a2e517d3fe4ab86af410c0bb85085d285edb9d5e548c6e1f5db0c77167bc9f2d8c66322dc0897e1bd225632aa4ed55987883f062daa6020355986826f65f7d672d18d26f66352b2e46b86c1c39bb1ca976b353d043c6cde4ba4741ad83e7969ae374ef96b4aad17d6eaa95cc6fc99d609bd78c60eb0695794397e9c7e9e8bcbc343e3e3e6ee6eeebbaaa00aaabafffff7777777777fffffaaaaa000001 3 | fix:index:0 4 | 00085a66da51a81a 0004f4aeab9688eb 5 | 00085a66da51a81a 0004f4aeab9688eb 6 | 00085a66da51a81a 0004f4aeab9688eb 7 | 00085a66da51a81a 0004f4aeab9688eb 8 | 00085a66da51a81a 0004f4aeab9688eb 9 | 00085a66da51a81a 0004f4aeab9688eb 10 | 00085a66da51a81a 0004f4aeab9688eb 11 | 00085a66da51a81a 0004f4aeab9688eb 12 | 00085a66da51a81a 0004f4aeab9688eb 13 | 00085a66da51a81a 0004f4aeab9688eb 14 | 00085a66da51a81a 0004f4aeab9688eb 15 | 00085a66da51a81a 0004f4aeab9688eb 16 | 00085a66da51a81a 0004f4aeab9688eb 17 | 00085a66da51a81a 0004f4aeab9688eb 18 | 00085a66da51a81a 0004f4aeab9688eb 19 | 00085a66da51a81a 0004f4aeab9688eb 20 | 00085a66da51a81a 0004f4aeab9688eb 21 | 00085a66da51a81a 0004f4aeab9688eb 22 | 00085a66da51a81a 0004f4aeab9688eb 23 | 00085a66da51a81a 0004f4aeab9688eb 24 | 00085a66da51a81a 0004f4aeab9688eb 25 | 00085a66da51a81a 0004f4aeab9688eb 26 | 00085a66da51a81a 0004f4aeab9688eb 27 | 00085a66da51a81a 0004f4aeab9688eb 28 | 00085a66da51a81a 0004f4aeab9688eb 29 | 00085a66da51a81a 0004f4aeab9688eb 30 | 00085a66da51a81a 0004f4aeab9688eb 31 | 00085a66da51a81a 0004f4aeab9688eb 32 | 00085a66da51a81a 0004f4aeab9688eb 33 | 00085a66da51a81a 0004f4aeab9688eb 34 | 00085a66da51a81a 0004f4aeab9688eb 35 | 00085a66da51a81a 0004f4aeab9688eb 36 | 00085a66da51a81a 0004f4aeab9688eb 37 | 00085a66da51a81a 0004f4aeab9688eb 38 | 00085a66da51a81a 0004f4aeab9688eb 39 | 00085a66da51a81a 0004f4aeab9688eb 40 | 00085a66da51a81a 0004f4aeab9688eb 41 | 00085a66da51a81a 0004f4aeab9688eb 42 | 00085a66da51a81a 0004f4aeab9688eb 43 | 00085a66da51a81a 0004f4aeab9688eb 44 | 20524524534d34d3 c9cc9cc9cc9ccdcf 45 | -------------------------------------------------------------------------------- /jump/lcm.521.txt: -------------------------------------------------------------------------------- 1 | #521,3,25,fbfefff77efff,ffeebfbdfbfdf 2 | 148e2d345750a90fa0b09763ecb70053a2490bdaedef3aa8fa0c85fc079aa729496743b5d59b0d7a9cea17df2a67dd59ea7a3bb1beef4c3d1ec90221d62cc371642710111 3 | fix:index:0 4 | 000f56977f035125 000553857b015035 5 | 000f56977f035125 000553857b015035 6 | 000f56977f035125 000553857b015035 7 | 000f56977f035125 000553857b015035 8 | 4034434434434434 0140151151351371 9 | -------------------------------------------------------------------------------- /jump/lcm.86243.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/lcm.86243.tar.gz -------------------------------------------------------------------------------- /jump/mainpage.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * \mainpage 3 | * 4 | * This is SIMD oriented Fast Mersenne Twister pseudorandom number 5 | * generator(dSFMT) with jump function. 6 | * 7 | * This Project provides jump function of dSFMT. 8 | * 9 | * There are two steps for jumpping. 10 | *
    11 | *
  1. Calculate jump polynomial using magic polynomial. 12 | *
      13 | *
    • \b calc-jump executable file calculates a jump polynomial. 14 | *
    • \b calc-jump is written in C++ language and needs NTL for compile. 15 | *
    • Additionally, users can call 16 | * dsfmt::calc_jump(std::string& jump_str, NTL::ZZ& step, 17 | * NTL::GF2X& characteristic) in SFMT-calc-jump.hpp from their 18 | * programs. 19 | *
    • jump steps used above is based on internal state, 20 | * i.e, doubles are skipped 2 * jump steps. 21 | *
    22 | *
  2. Change internal state of dSFMT into jumpped state. 23 | *
      24 | *
    • \b dSFMT_jump(dsfmt_t * dsfmt, const char * jump_str) 25 | * changes internal state of \b dsfmt in user's programs. 26 | *
    • @see sample1.c sample2.c 27 | *
    28 | *
29 | * 30 | * Caution: 31 | * The jump polynomial calculated using a magic polynomial 32 | * is only available for jumpping dSFMT states which has MEXP 33 | * correspond to the magic polynomial. 34 | * 35 | * @author Mutsuo Saito (Hiroshima University) 36 | * @author Makoto Matsumoto (The University of Tokyo) 37 | * 38 | * @date 2012-07-03 39 | * 40 | * Copyright (C) 2012 Mutsuo Saito, Makoto Matsumoto, Hiroshima 41 | * University and The University of Tokyo. 42 | * All rights reserved. 43 | * 44 | * The 3-clause BSD License is applied to this software. 45 | * \verbinclude LICENSE.txt 46 | */ 47 | -------------------------------------------------------------------------------- /jump/memo.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/memo.txt -------------------------------------------------------------------------------- /jump/params.csv: -------------------------------------------------------------------------------- 1 | # mexp pos1 sl1 mask1 mask2 2 | 521 3 25 0x000fbfefff77efff 0x000ffeebfbdfbfdf 3 | 1279 9 19 0x000efff7ffddffee 0x000fbffffff77fff 4 | 2203 7 19 0x000fdffff5edbfff 0x000f77fffffffbfe 5 | 4253 19 19 0x0007b7fffef5feff 0x000ffdffeffefbfc 6 | 11213 37 19 0x000ffffffdf7fffd 0x000dfffffff6bfff 7 | 19937 117 19 0x000ffafffffffb3f 0x000ffdfffc90fffd 8 | 44497 304 19 0x000ff6dfffffffef 0x0007ffdddeefff6f 9 | 86243 231 13 0x000ffedff6ffffdf 0x000ffff7fdffff7e 10 | 132049 371 23 0x000fb9f4eff4bf77 0x000fffffbfefff37 11 | 216091 1890 23 0x000bf7df7fefcfff 0x000e7ffffef737ff 12 | -------------------------------------------------------------------------------- /jump/poly.11213.txt: -------------------------------------------------------------------------------- 1 | #11213,37,19,ffffffdf7fffd,dfffffff6bfff 2 | 101100115cf68ab39e5737fb551005d2d5e60fba461aa514f056fe3dea7932881ec502691a4f73cee271a369a9c6952890ba8150ad73d12700639ab4a95b024b5d4e5959ff9028ab91c737cfc42ef9f71f1e1bba39b04d120cd97cd02964bcebe59278ed5ec52a4b8d7dfd3a61771ea2dd1f98290a475aecb8a5f64e4a03e9cb726c3542b50a25f4f16431b9da54aeeb46d7d787c477314555e4b86ba611b6f8cf8647cdc95496ad7521a503b685bf37a7ce5960e96ceacd6870b74ea00b724700cd2daad58d4d0bd84d0653af9161f7d57fe7fc893652fc0b9e24e93c42b8b1a4f1cdd3425c8087abfae9c40aafd058ae58c256ac455947d8cf123968c992832f4836a2fde99e102c5ea3ea9b31008e732feee730c5a58123492433732bcff38749ba00565163daea2f7eea73668b6a3293935ab58ea5418a1dd3f05b651f85d8c9c589032a668901bcc0935e2e71ad93ebd2be3733af33ad0d90a2f82f35ab264bd86755737a468d93f37ec6c9d19b7fed0d1c5115e56559ef544a6bbe1273054a2f9c35d6179357f3ba3dae1fc13b513319f2260fd7d942786387edadc17ddc5b99f3b89d1911b2ea2bea7e8277905ed74eb50f52735a92fdfd6d150ad1ad0dc10a6183265384a831da640c0c97f4132fe9ef9994f7493c0033f75cb55162e683cd551388c81716706a8ce57801c291778257d50fbeeb4c4f04f1088eb8cdf2e8dd9e491717f7f81f16d503db870efeb8136503c67928f5c45ed2a8610c9a91b507b1e8f6a1c51b58a2b5869f71e84daf0a0833e600eca6eb41a3e86e4d8791bbe30977be349f08ff577c73dcdc2a238e4d6e648e4c355bc82429b23d19dc299c5e5eea3974e056b35e9dddd4f0ac083cec44ea1fa80766a4b7938e744ae9a076bdee61e583d952632db5e879900a1b500c61518049defdbb32563d32249cbfc9487c5c721e8e807e1416e6bcdaef848b7a2309169f484f93b6f0fa84d68f1e75ed4d20baa664029b22257428c179b5f76802d8a50a5a3b813b057f765812fdc9085b6d59ba9d6f6521ee1278df96658c2b5ba52d116a1b3d57a18613a003ff323ece8f3c84511b7a56d95075a6e7fd3b78114e02a86ab578ba29c7f3aef98aeeaf3e8ff8e94bbb7bf7eadbe158ab2f3431ce87d8c0345dd30522a58bbcef704de5b09eedec1c8f69b401c526d242b01e7485c56e91499bc7b83953d5b79862ec1d37bb5814189c4d69a2829125cfa8379fee985337e7d13de073a29c256ef982f1bab0c776613e01ee96bde60fe6c73b5850ef54600f3e9a2a0a5ba6f1f3b9b2be211dde87294b1c4170cc51f5b2ae373ef082bad96ac5efdf1d2afd213be345b830b972b62044a12bcabeab2a934406686be38602c93e0ac8a764dcfb756794ad160d2c35afa5986cc2975e96031cffe0bfecadc0076c7d80e0e52b68c23a34b12a2f71cbfec05b881d3fac344c5dc7f7a36ad9c3be38bfc3cf3e1b7001961e8b65a209deadecf310f8060caaf4d994c5936a69588ce6d0adde2306a10387d066f000ad7502b93c193c67b1d2a0c2994e4cc25c76fda207e85676bd57828ae146b2719ff88991822b717ad5914d64abbbcff1378cac976c612c10475cdf826b2a58d1bcd0b9dbe9724c270794a6faf59974665a234176ed331f160cdaac244c396377117af50c79b13261707d4ff5efdf62dd6811e5ceca39cd6c1da3cb474a3b1b6c6b72d1c64a6be2e74b0bc3aa32c8c9aa10eac1a048f283a8427821a8522d25fc5c068d74242653ce821c7bce20b3a8208a8a0022a08a0432a49a0c120c9a8012198f910c128fb92498bfa934a83f8184b91281980b980112090a1102998a992a992a882e8c2f048d06ad8c0726ad8c8f2605a4ab0a00a0aa08202820282028202800000000000001010101018b218b218b218b21832983288228822808080808080808080000000000001000000008aaaaaaaaaaaaaaaa2aaaaabaaaaaaaa200000000000000008 3 | -------------------------------------------------------------------------------- /jump/poly.1279.txt: -------------------------------------------------------------------------------- 1 | #1279,9,19,efff7ffddffee,fbffffff77fff 2 | 14ca4b14ed4dab59798009986994e69dd13077f1a9e440dbf8b8ed606eeed432fd13b37e501ad87f3078e483cb19c2bd6c4ab7c088a032491825bec1cb67695ca591a4f2b9d9bef559f1f0df86b93107b474c08f65655a38c4dcba34722136b0ce066fbc37a441267541b17a44a7815c27069b930fb28d4d21b55d9d648187a8c361119d3c42dcc534812c607b48fead6d3b4443aad6e11b62511ea1520fa1df6f6920f9df8b94986d91e5e21 3 | -------------------------------------------------------------------------------- /jump/poly.19937.txt: -------------------------------------------------------------------------------- 1 | #19937,117,19,ffafffffffb3f,ffdfffc90fffd 2 | 10455110544511444054554514541dbbb0a20820a288a00a80a82208280b73237d2ff2ab5e2fcac914510101df18802aaaa08a022820a02aaa202ae822c364b91fb08598fe4410154041f028a266586e59cf12ce316b3a56af45cb49d02c7059cb89d2d81b0d288badbb25fa4e53b280aa88a22aa82abe7fc0645b7d7a4650c1dec48f21224e3d0e6e04c062c2273ef0d8361415c724dbc8f79118d5fac429f35dc460f6007e54c3966c28808e4c9308cc46e2e0e153bd922223796d4101af867e16e6641e6831e06ebbd2beaf52b2b47076dbf3a3e36c6d14d19dbf5d4b2b44b4d3aa6e1ea102578d765f08e1cb0749220075b8aae81c6e99692a56b35ddd4cf91b1034f1398c98e2d4ac8dbed09bc73ede098514cf3ffdf45cbb59335e3ec42f5f6a5672acc4ca8daa02a2502350ac0485f8b36f27d7a1d4d4b22fc7601e22a4f7c6ba53782b335837a21a068e8fcf3fdebb28860157301519cdea328b1ef4b8d5bc512ce65ff33298c34cc98ea1558f7b6d4db594f4bcab58d9f7bcf5cc59e259216de13f77569bbcee1c8abd55de985b7129e611d156c08cafa022ad7a2206a34a61e5c4c91e75495112003ec03c182a0155d9221382d0b30f45a00d6c19740f9ecebb448de78dfc0342f14166f54afdb97d00ac1a390355ce2aa9de1b3c919d8dd188fc9451ce9c86fa560a2da9dcaa681efd21fe5b6055f8e35a833e5704936245d06e387bf9956251bf0a252628be7a3cb0edab4aaaf141e6d7a9929cc03afa76ca433016d880def9e4cf10f7274e58aa35c372b7b7fb210fe0dc1a6b8445e7774ad6001b9aa1f2a01a790ee849e7ac810e0a646e733a7121bd727a9b593e0c9f5306dff5105af5967e3cee81069100d7e91a9c266e64c9e073a6e527765308879b22ca062668f9a564da6314dcad51405f160e8259582b7c06c313c84b0acba44958c052e6be540a7688e240232bee40b990dc48ee07d560786ca34e7df1bbdd2bca38a30c548ec57e91906b8417ff0da68db9c154d8ad83b06a6fc2b2e14ca5fbe7bd50382949c9b1f6e8540d9d43b35fa76a6ded27c2f17095a4f330626c5e86e8ff88ae53e05a434356a04a1ddae43b6e2ab883719360fbece72b6090ab17414ca7006e49d183813422c808fde53a30f872254bb554653aef86855f95a9361782100de2402efd749cc8cf6a837066c1c40c0160e415d8119e53a09877f1160ef8b99b2839e9b8c09b1e461e906041344c8fc2ef0a8eda04e319da41e001e60bc64dcdfc0593dff0f4b390580e1cd5b3c16204e77df10217791f99de49fcdc9160b793fd980bff7ae0cbd570425eb439352e5032e03797461376b5fb92aa156ad64935cc201a162f10f04b6d2d20a0415ae16f299e98baa86466f6f517f05f430254884a4010ac196540b0644e3c274323d4f0206780d38175f1e41fcb65bd387be073abee61b99d43f6b9106953ae4f6906e6ac0741e26af05fa9150c4f380558668aa667e404e3784b839d631e35af015024dbfc3dce4685574cd1e58eb72c70011090a2a876b65e34cb6cf297d24cb61ccca5a9706f34ae1f66345998f850de4e48d77cdf6e00fb0d2210ec9fb53fed02a781f7dfcdb609b9f955504f450e4b7b623cb0f5ba1ea09d92cd8d14f7e827b4580855f3a7dc2e5a45817df9e26adb5934f6026f745cb0f65e71c590bd954d1abc3826379719b7c6f4a0cbe6eb22a903b98bef785bb96efe2fc96988722c91f3e59d28d8244c8bfb59ee26082d82cad937ee70f178b44082533308ca24f236d8b91ca7af5b3d865c90d61410e1ffe39be6433a12ef2932e101b4bb34befa76748e0364a96f06e7932f44297fd5f85765b662c3ade19d9a9d9479f6de20b6b753d3dcbadf63e344578b98af85b4c4c63be9d154864f5d341f210f3503a60efec38ee59069499d0049aedfaef9264a7ce9de460a01e5437254fc68dfaebaa5e0e791380806bc149aedbc1d771457770937a5d606fc5ae728993783e6c45e1f5e1b9492a32f9df46a01020792a3803af04837a3905e7cc6ae68c512cb58f4facb457476729bac1ac89a7a32dc6857edbd6624ebeffed9d4e84a2f4ded9759962635aac94ca72d039c14af6e932fc84c25de28688acab0f41ae931a0f35b9c4195483d902f95e0d3e745e08f334cf5062da9fbd18fbb9efeb275a50a8a479939aa3e376821a030f0d241a4c4f6e3298a43a7f2166db483946c5ca623087b6252e27b09805d92a834ad914b9555f9c36150bb17d7e85f6b1a10b41a5c36a1fd0fdc354ec91720b245b0abcde6b38fdd33f471aa6ba1dbb4f178c3c6d8140a1f0700e072b0f9aafe1208abc94eea750b84e74ba6781b48c398ddfd2842e5447a11767e4f467864e4447382379010669f07870339ca42ac290063b40eaba1daa63cf6cd70c5a600c018f6933dc8bec000a521344cad7320ba121dd21f4723d38a8d3ab8c1f0f6c5a6995b796af79407ae1a7ce6d78922677d9990dd2a588f8a3323d80e9a69417f5224565afa60b64604e7316229514dcb7282b4e638981a5751d114da1ac9bf31f0e2fff5213f2020f9f2f31a8fd0c614e80c1a056d4b1af3ded2f696578f56427962ca54f4a28a502a0ac59013416abd81515fb1956ccb494c05ef61cab48474b6b1609cc5a3871a5111f8bf0a76b378f0e646687829e30f5762156da66c1b1c7abc0eb84e6ff2b9f5b22d34540ab97d643e8dd2e35f6e9e4fc2c30d8af88b2caab7bd5d4a6cf967e8ef79967c1ae85bf7d410a79f4630f13fdc6507d339909b81a29d84741103371310e5b4e279758431df627553b6826fc4c98e5fb6551315b0bd811b7b0f357198210dd99ccd8fba2904114c3e0b344eba43832b3c507e8b6b586e4ab3dc7a2ec71e150c54a13eca2340328d0b3e419ab2ba862ee93fc239fb46d907628055e105318e7fa52f9a83deb0e3cb02c62b8817702ead02a315f76aa1d08860cc5214a867808e33f8e075241956f148f876f3bc66566773610c9c5935b559c0ac47d84b6bfb112f59842be58df51055cf9180264f53f7795d4c934718bc65f359e34a8d230408854685b59c3a9f4d73a229bb465d4da3165404c6786c767299f57dfa85a83492fb4f61386441c928224cd88a7f4b36f245b7aa2b5c97b545ac4db8afe9a1a87e27b57d94c2bbffdb6e88f812aa27e0908048812086c2a72289d7bf136b3a1042a44d1913d39caec24ffda22814706f080b6cbe00e9cd442ccdcb600a436c0daeacbc5482021ba8a06c1fedbb333793557d5175b9313799ff91dfa620380a9e2a10132f0818bba72072e359726e2bd1f2ec98e0face32e0f88ee2c6f7cef7c2fbceffe8d3ccdff97b7ff71d861ba8b98237ccfb00176ee02206ccc08026cee082a88a8a349a1c9016983ea10789272105032f89b3113fd9b75b35c884622ec884622ee8aee2aaa2aeae86868c868ea68ea6862e0624062ea22aa66ee66ee44ee64ce64ce64ce646464c4808081808080a0a0828282828282822222a8898888888888aaaa2aaaaaaaaaaaaa2000000000000000008 3 | -------------------------------------------------------------------------------- /jump/poly.2203.txt: -------------------------------------------------------------------------------- 1 | #2203,7,19,fdffff5edbfff,f77fffffffbfe 2 | 1407b8c6688f1c0775fea3883299244920796c03596070e493f8a2466b86e7415739c0304943507214066639931675ff67f0b7aa0d5a59fcd60b35a658e3b0718ced7e1d63afa917bd3f2e0ba47059a48846f24d2145184e41b4b552020209d27237e6afdd3bfa9cfc958b26802191881eaf9240b1543e395e50247e31992d5dac592c5780c5ab642461fd9aaaf9fdf04f0c2a7bce50d70550d2e8269ef57a1bc1b14aa3108d0555d03299d068fa02520574ddc5c4b121037e2a5f9d0142fc871fc146b947aa81adcb6d32f0d801094c8de6573c027a0a0418f7fff8f2c85e16cd1086d5dce3b93d546a4b4bcea0864eb26213230195583f6eb49fccb02659a558b7bcfd09f218e3160356515144401010555550100001 3 | -------------------------------------------------------------------------------- /jump/poly.4253.txt: -------------------------------------------------------------------------------- 1 | #4253,19,19,7b7fffef5feff,ffdffeffefbfc 2 | 11110a3af24f296024e376f219a750d04bac6afd10cff9221e5d6bbf24b7970687dabb371262579d55820616b7eef3ad2979f44619d0d21a422c56968795ddba6f92bca413c1787299e56c271dc053d10e7675b8973938f1851ca195e3457c6022d6f894977e69be85838bb2ef0266ad19311b944de9a7b9bcbbe9453421c723d84a3832bbebc316ec1a951edf54d1e0ff7de2e2fc6ac5d72439e56d2e4caa0f95ab3243ee2b6b89144dc92bb542c61c3611a625e33c4cbc67bdfd5012ce34e332eeecf028a105fce45bb220295362ccf8aa176c92b99383c37faa63defba250bf1cb32251f9ad36a8722ede5baa33d8b5a16c577777b9493f4e4c021a8d5d3ce07b54eddfd3a796997a2a65decd4b6890b7bdc5bf139d2ffbfa6cfc4636932ae195c937c9a00770a5146839461315adabab10511697ab431275373b47563da464fa3a4f4c4378dc62fae3b56e269df2e8a21a23fc3ef78bb52fabea47377967bdfd8b238cb0dc55fa5ff974c469d926a8108b4b27ec8a8f863f3f2a2e517d3fe4ab86af410c0bb85085d285edb9d5e548c6e1f5db0c77167bc9f2d8c66322dc0897e1bd225632aa4ed55987883f062daa6020355986826f65f7d672d18d26f66352b2e46b86c1c39bb1ca976b353d043c6cde4ba4741ad83e7969ae374ef96b4aad17d6eaa95cc6fc99d609bd78c60eb0695794397e9c7e9e8bcbc343e3e3e6ee6eeebbaaa00aaabafffff7777777777fffffaaaaa000001 3 | -------------------------------------------------------------------------------- /jump/poly.521.txt: -------------------------------------------------------------------------------- 1 | #521,3,25,fbfefff77efff,ffeebfbdfbfdf 2 | 148e2d345750a90fa0b09763ecb70053a2490bdaedef3aa8fa0c85fc079aa729496743b5d59b0d7a9cea17df2a67dd59ea7a3bb1beef4c3d1ec90221d62cc371642710111 3 | -------------------------------------------------------------------------------- /jump/readme-jp.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | dSFMT jump function 9 | 16 | 17 | 18 |

目次

19 | 30 | 31 |

dSFMT ジャンプ機能について

32 | 33 |

34 | ジャンプ機能を使うと、dSFMTのある内部状態からNステップ後の状態を計算することが 35 | 出来ます。これはdSFMTの乱数生成を2N回呼び出すのと同じことですが、 36 | Nが大きい場合、乱数生成よりずっと速くNステップ後の状態に移ることができます。 37 | ジャンプ機能の典型的な使用法は、dSFMTによって生成される(長い)周期の中で、 38 | 互いに重ならないという保証のある複数の部分列を取得することです。 39 |

40 |

41 | ジャンプを実行するには二つのステップがあります。ジャンプ多項式の計算と内部状態の 42 | 変更です。 43 |

44 | 45 |

ステップ1:ジャンプ多項式の計算

46 |

47 | ジャンプ多項式を計算するために、計算済みの多項式を使用します。 48 | 計算済みの多項式は poly.{DSFMT_MEXP}.txtファイルに 49 | 保存されています。(この多項式についての説明は省略します) 50 |
51 | make によって作られる実行可能ファイル 'calc-jump'を使って、 52 | コマンドラインからジャンプ多項式を計算することができます。 53 | 使用法は以下のとおりです。 54 |

55 |
56 |
 57 | ./calc-jump jump-step polynomial-file
 58 |     jump-step: a number between zero and 2^{DSFMT_MEXP}-1.
 59 |                large decimal number is allowed.
 60 |     polynomial-file: one of poly.{DSFMT_MEXP}.txt file
 61 | 
62 |
63 |

64 | jump-stepは十進数で指定してください。大きな数を指定することが出来ます。 65 | no. は、params ディレクトリにある poly.{DSFMT_MEXP}.txt 66 | ファイルを使用する時に、指定してください。 67 |
68 | C++ の関数 'dsfmt::calc_jump' を使ってジャンプ多項式を計算することも 69 | できます。この関数は 'dSFMT-calc-jump.hpp' ファイルの中で定義されています。 70 |

71 |

ジャンプ多項式の計算にはVictor Shoup教授の 72 | NTL: A Library for doing Number 73 | Theory が必要です。 74 |
75 | また、ジャンプ多項式の計算にはdSFMTの内部状態は必要ありませんし、 76 | 計算済み多項式の格納されたファイル名以外はメルセンヌ指数にも依存しません。 77 |

78 | 79 |

ステップ2:dSFMTの内部状態をジャンプ後の状態に変更する

80 | 81 |

82 | このステップは、dSFMTのメルセンヌ指数に依存します。 83 | ジャンプ多項式の計算に使用した計算済み多項式に対応するメルセンヌ指数を 84 | 必ず使用してください。 85 |
86 | C言語で書かれたdSFMT_jump関数がこのステップを実行します。 87 | この関数は、dSFMT-jump.hの中で宣言されています。 88 | この関数のコンパイルには、dSFMT バージョン2.2 が必要です。 89 |

90 | 91 |

インストール、コンパイル、テスト

92 |

93 |

94 | Jump プログラムは単独ではコンパイルできません。dSFMT 2.2 のソースファイルが 95 | 必要です。

96 |
    97 |
  1. NTLをインストールしていなければ 98 | インストールする。
  2. 99 |
  3. アーカイブファイルを解凍します。
  4. 100 |
  5. 出来たディレクトリ(dSFMTJump-src-xxx)の中のjumpディレクトリを 101 | dSFMTのディクレクトリにコピーします。
  6. 102 |
    103 | dSFMT-src-2.2
    104 |    +---html
    105 |    +---jump
    106 | 
    107 |
  7. コピーしたjumpディレクトリにcd します。
  8. 108 |
  9. NTLのインストール時にgmp か gf2x を使用した場合は、Makefile の 109 | 以下の行のどちらかのコメントを外す必要があります。
  10. 110 |
    111 | #LIBGF2X = -lgf2x
    112 | #LIBGMP = -lgmp
    113 | 
    114 |
  11. make を実行します
  12. 115 |
    116 |
    117 | make all
    118 | make check
    119 | 
    120 |
    121 |
  13. make check の結果 OK と表示されればテストは成功です
  14. 122 |
123 |

make check で作られた test-jump-MXXX ファイルは、-s 124 | を指定して実行するとジャンプ多項式の計算時間とジャンプの実行時間を表示します。 125 |

126 |
127 |
128 | $ ./test-jump-M19937 -s
129 | mexp 19937 jump 10^04 steps  calc_jump: 0.707ms
130 | mexp 19937 jump 10^04 steps dSFMT_jump: 0.166ms
131 | mexp 19937 jump 10^06 steps  calc_jump: 3.527ms
132 | mexp 19937 jump 10^06 steps dSFMT_jump: 3.657ms
133 | mexp 19937 jump 10^08 steps  calc_jump: 6.310ms
134 | mexp 19937 jump 10^08 steps dSFMT_jump: 3.628ms
135 | mexp 19937 jump 10^10 steps  calc_jump: 9.221ms
136 | mexp 19937 jump 10^10 steps dSFMT_jump: 3.579ms
137 | mexp 19937 jump 10^12 steps  calc_jump:12.175ms
138 | mexp 19937 jump 10^12 steps dSFMT_jump: 3.638ms
139 | mexp 19937 jump 10^14 steps  calc_jump:15.176ms
140 | mexp 19937 jump 10^14 steps dSFMT_jump: 3.630ms
141 | mexp 19937 jump 10^16 steps  calc_jump:18.064ms
142 | mexp 19937 jump 10^16 steps dSFMT_jump: 3.626ms
143 | mexp 19937 jump 10^18 steps  calc_jump:20.959ms
144 | mexp 19937 jump 10^18 steps dSFMT_jump: 3.606ms
145 | mexp 19937 jump 10^20 steps  calc_jump:23.884ms
146 | mexp 19937 jump 10^20 steps dSFMT_jump: 3.600ms
147 | mexp 19937 jump 10^22 steps  calc_jump:26.920ms
148 | mexp 19937 jump 10^22 steps dSFMT_jump: 3.592ms
149 | 
150 |
151 | 152 |

並列生成サンプル

153 |

154 | アーカイブに同梱されている sample1.cファイルは、 155 | dSFMT1279を使って、1020 156 | ステップのジャンプをすることによって、重なりのないことが保証された部分列を5個生成 157 | しています。5個のdSFMTが1020以下の疑似乱数を生成する限り、 158 | 部分列が重なることはありません。 159 |

160 |

161 | 大きめのジャンプステップを指定して、重なりのない部分列を生成することが 162 | ジャンプ機能の重要な目的ですが、 163 | ジャンプ機能を使って、並列にひとつながりの疑似乱数列を生成することも出来ます。 164 | sample2.cでは5個のdSFMT521を使用して 165 | ひとつながりの疑似乱数列を生成し、 166 | ひとつのdSFMT521で順次生成した疑似乱数列と比較しています。 167 |
168 | このサンプルでは、順次生成と比較するために、小さなジャンプステップを使って 169 | いますが、実際にひとつながりの疑似乱数列を並列生成するなら、もっと大きな 170 | ジャンプステップを使用することになるはずです。 171 |

172 | 173 |

ライセンス

174 |

175 | dSFMT-jump は dSFMT と同様に商用にも利用することができます。
176 | 詳細はLICENSE.txt を参照してください。 177 |

178 | 179 | 180 | -------------------------------------------------------------------------------- /jump/readme.html: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | SFMT jump function 9 | 16 | 17 | 18 |

Index

19 | 31 | 32 |

About dSFMT jump function

33 |

34 | For a given integer N, this jump function executes the N-step 35 | jump. Namely, from the given state, obtain the state of dSFMT 36 | after N steps generation. This is equivalent to call the dSFMT 37 | double precision floating point number generation 2N times 38 | with discarding the 39 | outputs. A typical usage of a jump function is to obtain 40 | distinct sub streams from a whole period of pseudorandom number 41 | sequence generated by one dSFMT. 42 |

43 |

44 | There are two steps for doing jump. Calculations of jump polynomial 45 | and changing internal state. 46 |

47 | 48 |

Step 1: Calculations of jump polynomial

49 | 50 |

To calculate jump polynomial, we use pre-calculated polynomials for 51 | MEXPs, we omit explanation of the polynomial. 52 | The pre-calculated polynomials are stored in 53 | 'poly.{MEXP}.txt files.
54 | The executable binary file 'calc-jump' calculates jump polynomial 55 | from command line. Here is a usage: 56 |

57 |
 58 | ./calc-jump jump-step polynomial-file
 59 |     jump-step: a number between zero and 2^{DSFMT_MEXP}-1.
 60 |                large decimal number is allowed.
 61 |     polynomial-file: one of poly.{DSFMT_MEXP}.txt file
 62 | 
63 |
64 |

65 | Users can call C++ function 'dsfmt::calc_jump' in C++ header file 66 | 'dSFMT-calc-jump.hpp' to calculate jump polynomials. 67 |

68 |

NTL: A Library for doing Number 69 | Theory by Victor Shoup is used for polynomial calculation and 70 | handling large integers. 71 |

72 |

This step does not use dSFMT internal state and independent 73 | from MEXPs except file names of the pre-calculated polynomials. 74 |

75 | 76 |

77 | Step 2: Changing internal state of dSFMT to jumped state.

78 | 79 |

This step depends on MEXPs of dSFMT, and the 80 | polynomial file dSFMT should be the same as one used for the jump 81 | polynomial calculation. 82 |

83 |

The function dSFMT_jump written in C language does this step. 84 | For our convenience, we used C structure for dSFMT internal state, 85 | and almost of all functions provided in dSFMT ver. 2.2 were 86 | re-written to use dSFMT structures. 87 |

88 | 89 |

Install, Compile and Test

90 |

Test program needs source programs of SFMT ver. 2.2 to be compiled. 91 |

92 | 93 |
    94 |
  1. Install NTL 95 | if not installed.
  2. 96 |
  3. Expand archive file
  4. 97 |
  5. Copy jump directory in dSFMTJump-src-xxxx to 98 | the directory of dSFMT.
  6. 99 |
    100 | SFMT-src-2.2
    101 |    +---html
    102 |    +---jump
    103 | 
    104 |
  7. Change directory to copied jump directory
  8. 105 |
  9. If you specify gmp or gf2x when you installed NTL, 106 | you need to uncomment one of below lines in Makefile. 107 |
  10. 108 |
    109 | #LIBGF2X = -lgf2x
    110 | #LIBGMP = -lgmp
    111 | 
    112 |
  11. make
  12. 113 |
    114 |
    115 | make all
    116 | make check
    117 | 
    118 |
    119 |
  13. Check if OK is showed and no NG
  14. 120 |
121 | 122 |

test-jump-MXXX files made by above can invoke with '-s' 123 | argument like this: 124 |

125 |
126 |
127 | $ ./test-jump-M19937 -s
128 | mexp 19937 jump 10^04 steps  calc_jump: 0.707ms
129 | mexp 19937 jump 10^04 steps dSFMT_jump: 0.166ms
130 | mexp 19937 jump 10^06 steps  calc_jump: 3.527ms
131 | mexp 19937 jump 10^06 steps dSFMT_jump: 3.657ms
132 | mexp 19937 jump 10^08 steps  calc_jump: 6.310ms
133 | mexp 19937 jump 10^08 steps dSFMT_jump: 3.628ms
134 | mexp 19937 jump 10^10 steps  calc_jump: 9.221ms
135 | mexp 19937 jump 10^10 steps dSFMT_jump: 3.579ms
136 | mexp 19937 jump 10^12 steps  calc_jump:12.175ms
137 | mexp 19937 jump 10^12 steps dSFMT_jump: 3.638ms
138 | mexp 19937 jump 10^14 steps  calc_jump:15.176ms
139 | mexp 19937 jump 10^14 steps dSFMT_jump: 3.630ms
140 | mexp 19937 jump 10^16 steps  calc_jump:18.064ms
141 | mexp 19937 jump 10^16 steps dSFMT_jump: 3.626ms
142 | mexp 19937 jump 10^18 steps  calc_jump:20.959ms
143 | mexp 19937 jump 10^18 steps dSFMT_jump: 3.606ms
144 | mexp 19937 jump 10^20 steps  calc_jump:23.884ms
145 | mexp 19937 jump 10^20 steps dSFMT_jump: 3.600ms
146 | mexp 19937 jump 10^22 steps  calc_jump:26.920ms
147 | mexp 19937 jump 10^22 steps dSFMT_jump: 3.592ms
148 | 
149 |
150 | 151 |

Samples of Parallel generation

152 |

153 | sample1.c file included in the 154 | archive shows generation of 155 | 5 distinct sub-sequences using 1020 steps jump. 156 | As far as the length of each sub-sequence is smaller than 157 | 1020 the sub-sequences are not overlapping. 158 |

159 |

160 | Getting distinct sub sequences is an important purpose of 161 | jump function, however jump function is also available to get 162 | a sub-sequence using parallel computing. 163 |
164 | Here is a sample of generating a sequence using 5 dSFMT instances. 165 | This sample is included in the archive. 166 | sample2.c 167 |

168 | 169 |

License

170 |

171 | sSFMT-jump, as well as sSFMT, can be used freely for any purpose, 172 | including commercial use.
173 | See LICENSE.txt for detail. 174 |

175 | 176 | 177 | -------------------------------------------------------------------------------- /jump/sample1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/sample1 -------------------------------------------------------------------------------- /jump/sample1.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file sample.c 3 | * 4 | * @brief sample jump using pre-computed jump polynomial. 5 | * 6 | * The jump polynomial used in this program was calculated like this: 7 |
 8 | $ ./calc-jump 100000000000000000000 poly.1279.txt
 9 | jump polynomial:
10 | 2c6b058dca1fbfb57ebf41e67fec066c8828f2bf9414331d2767fa740aba89987685a79114b3543edbc83476e35fd1e52b8b2436932b9d18a728d8c7d7009a31aabed9bf4646909b8138f3e2a05e611c48dd1ce58a46183adabf3314da38599af92720efca1535872e7f85ef916b2c1e41dfe8ea764730f6ba2654ab287a55214bcf08cfae416906e4979108d606819b5d9e5b2f11ce028577f6c3788a9c688f1d64f5ae341eb95169824954
11 | 
12 | */ 13 | /* 14 | * In this sample, jump polynomial is fixed, then DSFMT_MEXP should be fixed. 15 | */ 16 | #define DSFMT_MEXP 1279 17 | #include 18 | #include "dSFMT.h" 19 | #include "dSFMT-jump.h" 20 | 21 | /* 22 | * jump step is dSFMT internal state step, 23 | * for double, 2 * jump step numbers are skipped. 24 | */ 25 | static const int size = 5; 26 | /* 10^20 will be enough */ 27 | static const char * jumppoly = "2c6b058dca1fbfb57ebf41e67fec066c8828f2bf" 28 | "9414331d2767fa740aba89987685a79114b3543edbc83476e35fd1e52b8b2436932" 29 | "b9d18a728d8c7d7009a31aabed9bf4646909b8138f3e2a05e611c48dd1ce58a4618" 30 | "3adabf3314da38599af92720efca1535872e7f85ef916b2c1e41dfe8ea764730f6b" 31 | "a2654ab287a55214bcf08cfae416906e4979108d606819b5d9e5b2f11ce028577f6" 32 | "c3788a9c688f1d64f5ae341eb95169824954"; 33 | 34 | int main(int argc, char * argv[]) 35 | { 36 | uint32_t seed = 4321; 37 | dsfmt_t dsfmt[size]; 38 | 39 | dsfmt_init_gen_rand(&dsfmt[0], seed); 40 | for (int i = 1; i < size; i++) { 41 | dsfmt[i] = dsfmt[i - 1]; 42 | dSFMT_jump(&dsfmt[i], jumppoly); 43 | } 44 | 45 | for (int i = 0; i < 10; i++) { 46 | /* simulating parallel generation */ 47 | printf("%f %f %f %f %f\n", 48 | dsfmt_genrand_close_open(&dsfmt[0]), 49 | dsfmt_genrand_close_open(&dsfmt[1]), 50 | dsfmt_genrand_close_open(&dsfmt[2]), 51 | dsfmt_genrand_close_open(&dsfmt[3]), 52 | dsfmt_genrand_close_open(&dsfmt[4])); 53 | } 54 | return 0; 55 | } 56 | -------------------------------------------------------------------------------- /jump/sample2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/sample2 -------------------------------------------------------------------------------- /jump/sample2.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file sample.c 3 | * 4 | * @brief sample jump using pre-computed jump polynomial. 5 | * 6 | * The jump polynomial used in this program was calculated like this: 7 |
 8 | $ ./calc-jump 10000 lcm.521.txt
 9 | jump polynomial:
10 | 61cfe6581dea7caf5009f3366e7ba5c81e78da9f2700af2ad3cddc005b1b542bf9295a1a81c7d41ebae4edd16780347d604da7b861074aa7abadbfb4a5cbf9ea0d6a65bbd
11 | 
12 | * This jump step is too small for actual use, just for check. 13 | * Use larger step for your application. 14 | */ 15 | /* 16 | * In this sample, jump polynomial is fixed, then DSFMT_MEXP should be fixed. 17 | */ 18 | #define DSFMT_MEXP 521 19 | #include 20 | #include "dSFMT.h" 21 | #include "dSFMT-jump.h" 22 | 23 | /* 24 | * jump step is dSFMT internal state step, 25 | * for double, 2 * jump step numbers are skipped. 26 | */ 27 | static const int step = 2 * 2000; 28 | static const int size = 5; 29 | static const char * jump2000 = "19976402611e3971602315ac42c1362b69367b411" 30 | "1785f40aa0ab67ce3e41e8d60eb1f3b012ed9854d7b594094b4b58670b30b9b1ea18a" 31 | "dba31d715592b6595195e01d458"; 32 | static const char * jump8000 = "b615c968ff87afc24e13d91dc2c27737a396667f6e" 33 | "b2979039b0de4d622a169d4d0b8200d2ee3b86d5f4528573abb4e55330bb0f002d66b" 34 | "762f42956f74a38e1cb5dbee2c"; 35 | 36 | int main(int argc, char * argv[]) 37 | { 38 | uint32_t seed = 1234; 39 | dsfmt_t dsfmt[size]; 40 | dsfmt_t serial; 41 | uint32_t array[size * step]; 42 | 43 | /* set up initial position of six sfmt instances 44 | * sfmt[0]: position 0 -- 2000, jump, 10000 -- 12000 45 | * sfmt[1]: position 2000 -- 4000, jump, 12000 -- 14000 46 | * sfmt[2]: position 4000 -- 6000 47 | * sfmt[3]: position 6000 -- 8000 48 | * sfmt[4]: position 8000 -- 10000 49 | */ 50 | dsfmt_init_gen_rand(&dsfmt[0], seed); 51 | for (int i = 1; i < size; i++) { 52 | dsfmt[i] = dsfmt[i - 1]; 53 | dSFMT_jump(&dsfmt[i], jump2000); 54 | } 55 | /* initialize serial generator */ 56 | dsfmt_init_gen_rand(&serial, seed); 57 | /* generate and compare with serial generation */ 58 | for (int i = 0; i < 10; i++) { 59 | /* simulating parallel generation */ 60 | for (int j = 0; j < step; j++) { 61 | array[j + 0 * step] = dsfmt_genrand_uint32(&dsfmt[0]); 62 | array[j + 1 * step] = dsfmt_genrand_uint32(&dsfmt[1]); 63 | array[j + 2 * step] = dsfmt_genrand_uint32(&dsfmt[2]); 64 | array[j + 3 * step] = dsfmt_genrand_uint32(&dsfmt[3]); 65 | array[j + 4 * step] = dsfmt_genrand_uint32(&dsfmt[4]); 66 | } 67 | /* checking */ 68 | printf("comparing with serial generation %d to %d", 69 | i * 10000, (i + 1) * 10000 -1); 70 | for (int j = 0; j < size * step; j++) { 71 | if (dsfmt_genrand_uint32(&serial) != array[j]) { 72 | printf("something wrong! i=%d, j=%d\n", i, j); 73 | return -1; 74 | } 75 | } 76 | printf(" OK\n"); 77 | /* simulating parallel jump */ 78 | dSFMT_jump(&dsfmt[0], jump8000); 79 | dSFMT_jump(&dsfmt[1], jump8000); 80 | dSFMT_jump(&dsfmt[2], jump8000); 81 | dSFMT_jump(&dsfmt[3], jump8000); 82 | dSFMT_jump(&dsfmt[4], jump8000); 83 | } 84 | return 0; 85 | } 86 | -------------------------------------------------------------------------------- /jump/test-jump-M11213: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/test-jump-M11213 -------------------------------------------------------------------------------- /jump/test-jump-M1279: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/test-jump-M1279 -------------------------------------------------------------------------------- /jump/test-jump-M132049: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/test-jump-M132049 -------------------------------------------------------------------------------- /jump/test-jump-M19937: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/test-jump-M19937 -------------------------------------------------------------------------------- /jump/test-jump-M216091: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/test-jump-M216091 -------------------------------------------------------------------------------- /jump/test-jump-M2203: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/test-jump-M2203 -------------------------------------------------------------------------------- /jump/test-jump-M4253: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/test-jump-M4253 -------------------------------------------------------------------------------- /jump/test-jump-M44497: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/test-jump-M44497 -------------------------------------------------------------------------------- /jump/test-jump-M521: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/test-jump-M521 -------------------------------------------------------------------------------- /jump/test-jump-M86243: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MersenneTwister-Lab/dSFMT/27f852c55270c382afe0dc2a76b572468c7b6a72/jump/test-jump-M86243 -------------------------------------------------------------------------------- /mainpage.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * \mainpage 3 | * 4 | * This is double precision SIMD oriented Fast Mersenne Twister pseudorandom 5 | * number generator (dSFMT). 6 | * 7 | * This program is based on the IEEE Standard for Binary 8 | * Floating-Point Arithmetic (ANSI/IEEE Std 754-1985) format. 9 | * 10 | * dSFMT ver. 2.xx is completely different from dSFMT ver. 1.xx. 11 | * The recursion formula is changed. And the output sequences 12 | * are changed. 13 | * 14 | * This version uses \b structure of C language. 15 | * Don't use different \b DSFMT_MEXP for compiling dSFMT.c and your program. 16 | * 17 | * This Project provides pseudorandom number generators of various 18 | * Mersenne Prime Period: from 2521-1 to 19 | * 2216091-1. 20 | * 21 | * To get dSFMT which has the period of 2521-1, you have to 22 | * specify -DMEXP=521 as a compile option. For example, 23 | * @verbatim 24 | gcc -DDSFMT_MEXP=521 -msse2 -DHAVE_SSE2 -c dSFMT.c 25 | @endverbatim 26 | * will make dSFMT which has the period of 2521-1 and is 27 | * optimized for SSE2. 28 | * 29 | * See How to compile to compile 30 | * your program with SFMT optimized for SIMD. 31 | * 32 | * - void dsfmt_init_gen_rand() initializes the generator with a 32-bit 33 | * integer seed. 34 | * - void dsfmt_init_by_array() initializes the generator with an array of 35 | * 32-bit integers as the seeds. 36 | * - const char * dsfmt_get_idstring() returns the IDSTRING which identify 37 | the generator. 38 | * - int dsfmt_get_min_array_size() returns the minimum size of array used for 39 | * \b fill_array functions. 40 | * - inline double dsfmt_genrand_close1_open2() generates and returns a 41 | * double precision pseudorandom number which distributes uniformly 42 | * in the range [1, 2). This is the primitive and faster than 43 | * generating numbers in other ranges. 44 | * - inline double dsfmt_genrand_close_open() generates and returns a double 45 | * precision pseudorandom number which distributes uniformly in the 46 | * range [0, 1). 47 | * - inline double dsfmt_genrand_open_close() generates and returns a double 48 | * precision pseudorandom number which distributes uniformly in the 49 | * range (0, 1]. 50 | * - inline double dsfmt_genrand_open_open() generates and returns a double 51 | * precision pseudorandom number which distributes uniformly in the 52 | * range (0, 1). 53 | * - void dsfmt_fill_array_close1_open2() fills the user-specified array 54 | * with double precision pseudorandom numbers which distribute 55 | * uniformly in the range [1, 2). 56 | * - void dsfmt_fill_array_close_open() fills the user-specified array 57 | * with double precision pseudorandom numbers which distribute 58 | * uniformly in the range [0, 1). 59 | * - void dsfmt_fill_array_open_close() fills the user-specified array 60 | * with double precision pseudorandom numbers which distribute 61 | * uniformly in the range (0, 1]. 62 | * - void dsfmt_fill_array_open_open() fills the user-specified array 63 | * with double precision pseudorandom numbers which distribute 64 | * function uniformly in the range (0, 1). 65 | * - uinit32_t dsfmt_genrand_uint32() generates and returns a 32 bit 66 | * unsigned integer. This function is useful for generating a small number of 67 | * integers among a large number of floating point numbers. This function 68 | * does not have corresponding fill_array function, because the purpose of 69 | * fill_array function is to generate a large number of pseudorandom numbers. 70 | * 71 | * Old names init_gen_rand, init_by_array, etc. are also defined unless 72 | * you define DSFMT_DO_NOT_USE_OLD_NAMES. 73 | * 74 | * @author Mutsuo Saito (saito\@our-domain) Hiroshima University 75 | * @author Makoto Matsumoto (m-mat\@our-domain) Hiroshima University 76 | * 77 | * Please change \b our-domain to \b math.sci.hiroshima-u.ac.jp 78 | * 79 | * @date 2012-06-29 80 | * 81 | * Copyright (C) 2007, 2008, 2009 Mutsuo Saito, Makoto Matsumoto and Hiroshima 82 | * University. 83 | * Copyright (c) 2011, 2012 Mutsuo Saito, Makoto Matsumoto, Hiroshima 84 | * University and The University of Tokyo. 85 | * All rights reserved. 86 | * 87 | * The new BSD License is applied to this software. 88 | * \verbinclude LICENSE.txt 89 | */ 90 | -------------------------------------------------------------------------------- /sample1.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "dSFMT.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | int i, cnt, seed; 7 | double x, y, pi; 8 | const int NUM = 10000; 9 | dsfmt_t dsfmt; 10 | 11 | if (argc >= 2) { 12 | seed = strtol(argv[1], NULL, 10); 13 | } else { 14 | seed = 12345; 15 | } 16 | cnt = 0; 17 | dsfmt_init_gen_rand(&dsfmt, seed); 18 | for (i = 0; i < NUM; i++) { 19 | x = dsfmt_genrand_close_open(&dsfmt); 20 | y = dsfmt_genrand_close_open(&dsfmt); 21 | if (x * x + y * y < 1.0) { 22 | cnt++; 23 | } 24 | } 25 | pi = (double)cnt / NUM * 4; 26 | printf("%f\n", pi); 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /sample2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #define _XOPEN_SOURCE 600 3 | #include 4 | #include "dSFMT.h" 5 | 6 | int main(int argc, char* argv[]) { 7 | int i, j, cnt, seed; 8 | double x, y, pi; 9 | const int NUM = 10000; 10 | const int R_SIZE = 2 * NUM; 11 | int size; 12 | double *array; 13 | dsfmt_t dsfmt; 14 | 15 | if (argc >= 2) { 16 | seed = strtol(argv[1], NULL, 10); 17 | } else { 18 | seed = 12345; 19 | } 20 | size = dsfmt_get_min_array_size(); 21 | if (size < R_SIZE) { 22 | size = R_SIZE; 23 | } 24 | #if defined(__APPLE__) || \ 25 | (defined(__FreeBSD__) && __FreeBSD__ >= 3 && __FreeBSD__ <= 6) 26 | printf("malloc used\n"); 27 | array = malloc(sizeof(double) * size); 28 | if (array == NULL) { 29 | printf("can't allocate memory.\n"); 30 | return 1; 31 | } 32 | #elif defined(_POSIX_C_SOURCE) 33 | printf("posix_memalign used\n"); 34 | if (posix_memalign((void **)&array, 16, sizeof(double) * size) != 0) { 35 | printf("can't allocate memory.\n"); 36 | return 1; 37 | } 38 | #elif defined(__GNUC__) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) 39 | printf("memalign used\n"); 40 | array = memalign(16, sizeof(double) * size); 41 | if (array == NULL) { 42 | printf("can't allocate memory.\n"); 43 | return 1; 44 | } 45 | #else /* in this case, gcc doesn't suppport SSE2 */ 46 | array = malloc(sizeof(double) * size); 47 | if (array == NULL) { 48 | printf("can't allocate memory.\n"); 49 | return 1; 50 | } 51 | #endif 52 | cnt = 0; 53 | j = 0; 54 | dsfmt_init_gen_rand(&dsfmt, seed); 55 | dsfmt_fill_array_close_open(&dsfmt, array, size); 56 | for (i = 0; i < NUM; i++) { 57 | x = array[j++]; 58 | y = array[j++]; 59 | if (x * x + y * y < 1.0) { 60 | cnt++; 61 | } 62 | } 63 | free(array); 64 | pi = (double)cnt / NUM * 4; 65 | printf("%f\n", pi); 66 | return 0; 67 | } 68 | -------------------------------------------------------------------------------- /sample3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "dSFMT.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | int i, cnt, seed_cnt; 7 | double x, y, pi; 8 | const int NUM = 10000; 9 | uint32_t seeds[100]; 10 | dsfmt_t dsfmt; 11 | 12 | if (argc >= 2) { 13 | seed_cnt = 0; 14 | for (i = 0; (i < 100) && (i < strlen(argv[1])); i++) { 15 | seeds[i] = argv[1][i]; 16 | seed_cnt++; 17 | } 18 | } else { 19 | seeds[0] = 12345; 20 | seed_cnt = 1; 21 | } 22 | cnt = 0; 23 | dsfmt_init_by_array(&dsfmt, seeds, seed_cnt); 24 | for (i = 0; i < NUM; i++) { 25 | x = dsfmt_genrand_close_open(&dsfmt); 26 | y = dsfmt_genrand_close_open(&dsfmt); 27 | if (x * x + y * y < 1.0) { 28 | cnt++; 29 | } 30 | } 31 | pi = (double)cnt / NUM * 4; 32 | printf("%f\n", pi); 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /sample4.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "dSFMT.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | int i, cnt, seed_cnt; 7 | double x, y, pi; 8 | const int NUM = 10000; 9 | uint32_t seeds[100]; 10 | dsfmt_t dsfmt; 11 | 12 | if (argc >= 2) { 13 | seed_cnt = 0; 14 | for (i = 0; (i < 100) && (i < strlen(argv[1])); i++) { 15 | seeds[i] = argv[1][i]; 16 | seed_cnt++; 17 | } 18 | } else { 19 | seeds[0] = 12345; 20 | seed_cnt = 1; 21 | } 22 | cnt = 0; 23 | dsfmt_init_by_array(&dsfmt, seeds, seed_cnt); 24 | for (i = 0; i < NUM; i++) { 25 | x = dsfmt_genrand_close_open(&dsfmt); 26 | y = dsfmt_genrand_close_open(&dsfmt); 27 | if (x * x + y * y < 1.0) { 28 | cnt++; 29 | } 30 | } 31 | pi = (double)cnt / NUM * 4; 32 | printf("%f\n", pi); 33 | return 0; 34 | } 35 | --------------------------------------------------------------------------------