亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mt-rand.c

?? 卡內基梅隆大學(CMU)開發的移動機器人控制開發軟件包。可對多種機器人進行控制
?? C
字號:
/* comments are changed from C++ style to ANSI C style,   then wrappers are added by Naoki Takebayashi.   Also testing code at the bottom is changed.   Other than that the main functions are not changed at all   Jun 01, 2000*//* for RandDecimal() to return closed interval [0,1], #define MT_CLOSED_INTVL   Otherwise RandDecimal reuturns interval[0,1)*/#include "mt-rand.h"/* This is the ``Mersenne Twister'' random number generator MT19937, which * generates pseudorandom integers uniformly distributed in 0..(2^32 - 1) * starting from any odd seed in 0..(2^32 - 1).  This version is a recode * by Shawn Cokus (Cokus@math.washington.edu) on March 8, 1998 of a version by * Takuji Nishimura (who had suggestions from Topher Cooper and Marc Rieffel in * July-August 1997). * * Effectiveness of the recoding (on Goedel2.math.washington.edu, a DEC Alpha * running OSF/1) using GCC -O3 as a compiler: before recoding: 51.6 sec. to * generate 300 million random numbers; after recoding: 24.0 sec. for the same * (i.e., 46.5% of original time), so speed is now about 12.5 million random * number generations per second on this machine. * * According to the URL <http://www.math.keio.ac.jp/~matumoto/emt.html> * (and paraphrasing a bit in places), the Mersenne Twister is ``designed * with consideration of the flaws of various existing generators,'' has * a period of 2^19937 - 1, gives a sequence that is 623-dimensionally * equidistributed, and ``has passed many stringent tests, including the * die-hard test of G. Marsaglia and the load test of P. Hellekalek and * S. Wegenkittl.''  It is efficient in memory usage (typically using 2506 * to 5012 bytes of static data, depending on data type sizes, and the code * is quite short as well).  It generates random numbers in batches of 624 * at a time, so the caching and pipelining of modern systems is exploited. * It is also divide- and mod-free. * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Library General Public License as published by * the Free Software Foundation (either version 2 of the License or, at your * option, any later version).  This library is distributed in the hope that * it will be useful, but WITHOUT ANY WARRANTY, without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See * the GNU Library General Public License for more details.  You should have * received a copy of the GNU Library General Public License along with this * library; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307, USA. * * The code as Shawn received it included the following notice: * *   Copyright (C) 1997 Makoto Matsumoto and Takuji Nishimura.  When *   you use this, send an e-mail to <matumoto@math.keio.ac.jp> with *   an appropriate reference to your work. * * It would be nice to CC: <Cokus@math.washington.edu> when you write. */#include <stdio.h>#include <stdlib.h>/* * uint32 must be an unsigned integer type capable of holding at least 32 * bits; exactly 32 should be fastest, but 64 is better on an Alpha with * GCC at -O3 optimization so try your options and see what's best for you */#define N             (624)               /* length of state vector */#define M             (397)               /* a period parameter */#define K             (0x9908B0DFU)       /* a magic constant */#define hiBit(u)      ((u) & 0x80000000U) /* mask all but highest   bit of u */#define loBit(u)      ((u) & 0x00000001U) /* mask all but lowest    bit of u */#define loBits(u)     ((u) & 0x7FFFFFFFU) /* mask    the highest    bit of u */#define mixBits(u, v) (hiBit(u)|loBits(v))/* move hi bit of u to hi bit of v */static uint32   state[N+1];  /* state vector + 1 extra to not violate ANSI C */static uint32   *next;       /* next random value is computed from here */static int      left = -1;   /* can *next++ this many times before reloading */void seedMT(uint32 seed) {    /*     * We initialize state[0..(N-1)] via the generator     *     *   x_new = (69069 * x_old) mod 2^32     *     * from Line 15 of Table 1, p. 106, Sec. 3.3.4 of Knuth's     * _The Art of Computer Programming_, Volume 2, 3rd ed.     *     * Notes (SJC): I do not know what the initial state requirements     * of the Mersenne Twister are, but it seems this seeding generator     * could be better.  It achieves the maximum period for its modulus     * (2^30) iff x_initial is odd (p. 20-21, Sec. 3.2.1.2, Knuth); if     * x_initial can be even, you have sequences like 0, 0, 0, ...;     * 2^31, 2^31, 2^31, ...; 2^30, 2^30, 2^30, ...; 2^29, 2^29 + 2^31,     * 2^29, 2^29 + 2^31, ..., etc. so I force seed to be odd below.     *     * Even if x_initial is odd, if x_initial is 1 mod 4 then     *     *   the          lowest bit of x is always 1,     *   the  next-to-lowest bit of x is always 0,     *   the 2nd-from-lowest bit of x alternates      ... 0 1 0 1 0 1 0 1 ... ,     *   the 3rd-from-lowest bit of x 4-cycles        ... 0 1 1 0 0 1 1 0 ... ,     *   the 4th-from-lowest bit of x has the 8-cycle ... 0 0 0 1 1 1 1 0 ... ,     *    ...     *     * and if x_initial is 3 mod 4 then     *     *   the          lowest bit of x is always 1,     *   the  next-to-lowest bit of x is always 1,     *   the 2nd-from-lowest bit of x alternates      ... 0 1 0 1 0 1 0 1 ... ,     *   the 3rd-from-lowest bit of x 4-cycles        ... 0 0 1 1 0 0 1 1 ... ,     *   the 4th-from-lowest bit of x has the 8-cycle ... 0 0 1 1 1 1 0 0 ... ,     *    ...     *     * The generator's potency (min. s>=0 with (69069-1)^s = 0 mod 2^32) is     * 16, which seems to be alright by p. 25, Sec. 3.2.1.3 of Knuth.  It     * also does well in the dimension 2..5 spectral tests, but it could be     * better in dimension 6 (Line 15, Table 1, p. 106, Sec. 3.3.4, Knuth).     *     * Note that the random number user does not see the values generated     * here directly since reloadMT() will always munge them first, so maybe     * none of all of this matters.  In fact, the seed values made here could     * even be extra-special desirable if the Mersenne Twister theory says     * so-- that's why the only change I made is to restrict to odd seeds.     */    register uint32 x = (seed | 1U) & 0xFFFFFFFFU, *s = state;    register int    j;    for(left=0, *s++=x, j=N; --j;        *s++ = (x*=69069U) & 0xFFFFFFFFU); }uint32 reloadMT(void) {    register uint32 *p0=state, *p2=state+2, *pM=state+M, s0, s1;    register int    j;    if(left < -1)        seedMT(4357U);    left=N-1, next=state+1;    for(s0=state[0], s1=state[1], j=N-M+1; --j; s0=s1, s1=*p2++)        *p0++ = *pM++ ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U);    for(pM=state, j=M; --j; s0=s1, s1=*p2++)        *p0++ = *pM++ ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U);    s1=state[0], *p0 = *pM ^ (mixBits(s0, s1) >> 1) ^ (loBit(s1) ? K : 0U);    s1 ^= (s1 >> 11);    s1 ^= (s1 <<  7) & 0x9D2C5680U;    s1 ^= (s1 << 15) & 0xEFC60000U;    return(s1 ^ (s1 >> 18)); }uint32 randomMT(void) {    uint32 y;    if(--left < 0)        return(reloadMT());    y  = *next++;    y ^= (y >> 11);    y ^= (y <<  7) & 0x9D2C5680U;    y ^= (y << 15) & 0xEFC60000U;    return(y ^ (y >> 18)); }double MTrandDec(void) {#ifdef MT_CLOSED_INTVL  /* for reals with closed interval [0,1] */  return ( (double) randomMT() * 2.3283064370807974e-10 );#else  /* for reals: [0,1)-interval */  return ( (double) randomMT() * 2.3283064365386963e-10 );#endif}/* returns a int [0, max] both-end  inclusive */int MTrandInt(int max) {  return ( (int) (MTrandDec() * (max + 1)) );}#ifdef TEST#define MAX 200000000UL#define DM 10000int main(void) {    int j;    unsigned long k;    unsigned long dummy[DM];    /* you can seed with any uint32, but the best are odds in 0..(2^32 - 1) */    seedMT(4357U);    /* print the first 2,002 random numbers seven to a line as an example */    for(j=0; j<2002; j++)        printf(" %10lu%s", (unsigned long) randomMT(), (j%7)==6 ? "\n" : "");    /* added for bench mark */    for(k=0; k<MAX; k++) {      dummy[(k % DM)] = (unsigned long) MTrandInt(1000);    }    return(EXIT_SUCCESS); }#endif/* TEST */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本伦理一区二区| 99在线热播精品免费| 亚洲国产一区在线观看| 最新日韩av在线| 国产精品天天看| 国产精品国产三级国产aⅴ中文 | 日韩限制级电影在线观看| 色综合天天做天天爱| 欧洲一区在线电影| 欧美中文字幕不卡| 色婷婷av一区二区| 在线视频亚洲一区| 3d动漫精品啪啪一区二区竹菊| 欧美日韩夫妻久久| 欧美不卡视频一区| 中文字幕成人网| 亚洲欧美激情一区二区| 午夜精品视频一区| 麻豆精品久久精品色综合| 国产精品自拍三区| 91传媒视频在线播放| 欧美日韩国产一二三| 欧美成人a∨高清免费观看| 久久久精品国产99久久精品芒果 | 亚洲欧美福利一区二区| 亚洲自拍都市欧美小说| 日韩不卡一区二区| 丁香亚洲综合激情啪啪综合| 91久久精品国产91性色tv| 在线播放日韩导航| 中文字幕欧美区| 丝袜亚洲另类欧美| 精品在线免费视频| 色狠狠色狠狠综合| 久久精品亚洲精品国产欧美kt∨| 自拍视频在线观看一区二区| 日产国产欧美视频一区精品| 懂色av一区二区在线播放| 欧美日韩亚洲不卡| 国产精品不卡在线| 久久爱www久久做| 欧美午夜一区二区三区| 国产三级欧美三级日产三级99 | 国产精品三级久久久久三级| 首页亚洲欧美制服丝腿| 成人精品gif动图一区| 在线观看成人小视频| 久久九九久久九九| 香蕉成人伊视频在线观看| 成人18视频在线播放| 精品国产乱码久久久久久蜜臀| 最新欧美精品一区二区三区| 国产一区二区在线看| 欧美日韩亚洲综合一区二区三区| 国产精品乱子久久久久| 国产盗摄精品一区二区三区在线 | 国产色综合一区| 丝袜亚洲另类欧美| 欧美在线小视频| 亚洲日本在线看| 国产福利视频一区二区三区| 日韩视频免费观看高清完整版| 亚洲综合成人网| 色综合久久久久久久| 中文字幕制服丝袜成人av | 综合色天天鬼久久鬼色| 国产久卡久卡久卡久卡视频精品| 在线播放视频一区| 五月激情综合色| 欧美日韩午夜影院| 亚洲国产欧美另类丝袜| 91精彩视频在线| 一区二区三区丝袜| 91豆麻精品91久久久久久| 亚洲女同一区二区| 91色.com| 亚洲成av人片一区二区| 欧美亚洲免费在线一区| 一区二区三区四区乱视频| 在线精品视频一区二区三四 | 欧美三级三级三级| 亚洲国产精品欧美一二99| 欧美性极品少妇| 视频一区在线播放| 在线观看91av| 蜜臀91精品一区二区三区| 91精品国产色综合久久不卡蜜臀 | 国产精品乱人伦中文| 波多野结衣一区二区三区| 欧美韩日一区二区三区| 91偷拍与自偷拍精品| 亚洲精品乱码久久久久久| 欧美午夜精品理论片a级按摩| 亚洲自拍都市欧美小说| 91麻豆精品国产91久久久久久| 日本不卡一区二区| 久久精品日产第一区二区三区高清版| 成人午夜私人影院| 亚洲成人先锋电影| 精品国产91洋老外米糕| 成人av资源站| 亚洲一区二区三区中文字幕在线| 欧美一三区三区四区免费在线看 | 91精品国产综合久久久久久久| 青青草成人在线观看| 国产午夜亚洲精品不卡| 在线亚洲高清视频| 国产在线精品一区二区| 亚洲欧美日韩国产综合在线| 777a∨成人精品桃花网| 国产精品亚洲第一区在线暖暖韩国| 最新不卡av在线| 日韩精品在线看片z| av男人天堂一区| 精品一区二区三区在线观看| 亚洲欧洲99久久| 精品国产91久久久久久久妲己| 一本久道中文字幕精品亚洲嫩| 蜜桃久久av一区| 伊人开心综合网| 久久精品人人做人人综合| 久久综合一区二区| 色呦呦日韩精品| 成人影视亚洲图片在线| 日韩av网站免费在线| 亚洲女厕所小便bbb| 精品国产免费人成在线观看| 在线观看亚洲a| 波多野结衣中文字幕一区二区三区| 免费日本视频一区| 亚洲精品大片www| 中文字幕在线观看不卡视频| 精品久久久久久久久久久院品网| 色婷婷综合久久久| 成人国产精品免费观看视频| 蜜臀av国产精品久久久久| 香蕉加勒比综合久久| 玉足女爽爽91| 亚洲品质自拍视频| 日本一区二区高清| 国产网站一区二区三区| wwwwww.欧美系列| 日韩免费观看2025年上映的电影| 欧美巨大另类极品videosbest | 制服视频三区第一页精品| 色噜噜狠狠成人网p站| 成人av网在线| 99久精品国产| 一本久久精品一区二区| 97精品国产露脸对白| gogogo免费视频观看亚洲一| 国产精品羞羞答答xxdd| 韩国三级在线一区| 国模娜娜一区二区三区| 国产一区二区三区黄视频| 国产最新精品免费| 国产精品一区免费在线观看| 韩国欧美国产1区| 成人在线综合网| 91在线免费视频观看| eeuss鲁片一区二区三区| 国产91精品入口| 91在线国产福利| 一本大道久久a久久精二百| 色综合久久天天| 欧美精品日韩一本| 日韩女优av电影| 中文字幕乱码一区二区免费| 亚洲欧美怡红院| 香蕉久久夜色精品国产使用方法 | 五月婷婷色综合| 久久99精品久久久久久国产越南 | 久久精品视频在线免费观看| 欧美激情中文字幕一区二区| 亚洲视频每日更新| 午夜精品久久久| 精品亚洲国内自在自线福利| 丁香桃色午夜亚洲一区二区三区| 99在线精品视频| 56国语精品自产拍在线观看| 久久午夜国产精品| 亚洲精品一二三| 久久精品国产一区二区三| 成人一区在线看| 91精品国产综合久久国产大片| 久久夜色精品一区| 亚洲日本在线a| 国产综合久久久久影院| 91麻豆文化传媒在线观看| 91麻豆精品国产91久久久久久久久 | 制服视频三区第一页精品| 精品成人一区二区| 国产精品国产成人国产三级| 天堂va蜜桃一区二区三区漫画版| 国产一区二区不卡老阿姨| 91久久线看在观草草青青| 精品国产一区二区三区av性色| ...中文天堂在线一区| 精品在线一区二区三区| 欧美私人免费视频|