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

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

?? rngs.c

?? Simulation Modeling,Discrete Event Simulation,Statistical Analysis of Simulation Models
?? C
字號:
/* ------------------------------------------------------------------------- * This is an ANSI C library for multi-stream random number generation.   * The use of this library is recommended as a replacement for the ANSI C  * rand() and srand() functions, particularly in simulation applications  * where the statistical 'goodness' of the random number generator is  * important.  The library supplies 256 streams of random numbers; use  * SelectStream(s) to switch between streams indexed s = 0,1,...,255. * * The streams must be initialized.  The recommended way to do this is by * using the function PlantSeeds(x) with the value of x used to initialize  * the default stream and all other streams initialized automatically with * values dependent on the value of x.  The following convention is used  * to initialize the default stream: *    if x > 0 then x is the state *    if x < 0 then the state is obtained from the system clock *    if x = 0 then the state is to be supplied interactively. * * The generator used in this library is a so-called 'Lehmer random number * generator' which returns a pseudo-random number uniformly distributed * 0.0 and 1.0.  The period is (m - 1) where m = 2,147,483,647 and the * smallest and largest possible values are (1 / m) and 1 - (1 / m) * respectively.  For more details see: *  *       "Random Number Generators: Good Ones Are Hard To Find" *                   Steve Park and Keith Miller *              Communications of the ACM, October 1988 * * Name            : rngs.c  (Random Number Generation - Multiple Streams) * Authors         : Steve Park & Dave Geyer * Language        : ANSI C * Latest Revision : 09-22-98 * -------------------------------------------------------------------------  */#include <stdio.h>#include <time.h>#include "rngs.h"#define MODULUS    2147483647 /* DON'T CHANGE THIS VALUE                  */#define MULTIPLIER 48271      /* DON'T CHANGE THIS VALUE                  */#define CHECK      399268537  /* DON'T CHANGE THIS VALUE                  */#define STREAMS    256        /* # of streams, DON'T CHANGE THIS VALUE    */#define A256       22925      /* jump multiplier, DON'T CHANGE THIS VALUE */#define DEFAULT    123456789  /* initial seed, use 0 < DEFAULT < MODULUS  */      static long seed[STREAMS] = {DEFAULT};  /* current state of each stream   */static int  stream        = 0;          /* stream index, 0 is the default */static int  initialized   = 0;          /* test for stream initialization */   double Random(void)/* ---------------------------------------------------------------- * Random returns a pseudo-random real number uniformly distributed  * between 0.0 and 1.0.  * ---------------------------------------------------------------- */{  const long Q = MODULUS / MULTIPLIER;  const long R = MODULUS % MULTIPLIER;        long t;  t = MULTIPLIER * (seed[stream] % Q) - R * (seed[stream] / Q);  if (t > 0)     seed[stream] = t;  else     seed[stream] = t + MODULUS;  return ((double) seed[stream] / MODULUS);}   void PlantSeeds(long x)/* --------------------------------------------------------------------- * Use this function to set the state of all the random number generator  * streams by "planting" a sequence of states (seeds), one per stream,  * with all states dictated by the state of the default stream.  * The sequence of planted states is separated one from the next by  * 8,367,782 calls to Random(). * --------------------------------------------------------------------- */{  const long Q = MODULUS / A256;  const long R = MODULUS % A256;        int  j;        int  s;  initialized = 1;  s = stream;                            /* remember the current stream */  SelectStream(0);                       /* change to stream 0          */  PutSeed(x);                            /* set seed[0]                 */  stream = s;                            /* reset the current stream    */  for (j = 1; j < STREAMS; j++) {    x = A256 * (seed[j - 1] % Q) - R * (seed[j - 1] / Q);    if (x > 0)      seed[j] = x;    else      seed[j] = x + MODULUS;   }}   void PutSeed(long x)/* --------------------------------------------------------------- * Use this function to set the state of the current random number  * generator stream according to the following conventions: *    if x > 0 then x is the state (unless too large) *    if x < 0 then the state is obtained from the system clock *    if x = 0 then the state is to be supplied interactively * --------------------------------------------------------------- */{  char ok = 0;  if (x > 0)    x = x % MODULUS;                       /* correct if x is too large  */  if (x < 0)                                     x = ((unsigned long) time((time_t *) NULL)) % MODULUS;                if (x == 0)                                    while (!ok) {      printf("\nEnter a positive integer seed (9 digits or less) >> ");      scanf("%ld", &x);      ok = (0 < x) && (x < MODULUS);      if (!ok)        printf("\nInput out of range ... try again\n");    }  seed[stream] = x;}   void GetSeed(long *x)/* --------------------------------------------------------------- * Use this function to get the state of the current random number  * generator stream.                                                    * --------------------------------------------------------------- */{  *x = seed[stream];}   void SelectStream(int index)/* ------------------------------------------------------------------ * Use this function to set the current random number generator * stream -- that stream from which the next random number will come. * ------------------------------------------------------------------ */{  stream = ((unsigned int) index) % STREAMS;  if ((initialized == 0) && (stream != 0))   /* protect against        */    PlantSeeds(DEFAULT);                     /* un-initialized streams */}   void TestRandom(void)/* ------------------------------------------------------------------ * Use this (optional) function to test for a correct implementation. * ------------------------------------------------------------------     */{  long   i;  long   x;  double u;  char   ok = 0;    SelectStream(0);                  /* select the default stream */  PutSeed(1);                       /* and set the state to 1    */  for(i = 0; i < 10000; i++)    u = Random();  GetSeed(&x);                      /* get the new state value   */  ok = (x == CHECK);                /* and check for correctness */  SelectStream(1);                  /* select stream 1                 */   PlantSeeds(1);                    /* set the state of all streams    */  GetSeed(&x);                      /* get the state of stream 1       */  ok = ok && (x == A256);           /* x should be the jump multiplier */      if (ok)    printf("\n The implementation of rngs.c is correct.\n\n");  else    printf("\n\a ERROR -- the implementation of rngs.c is not correct.\n\n");}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人午夜视频在线观看| 99精品视频中文字幕| 一区二区视频在线看| 国产视频一区二区三区在线观看| 精品日韩一区二区三区免费视频| 69堂精品视频| 日韩欧美视频在线| 日韩女优av电影在线观看| 亚洲精品一区二区三区蜜桃下载 | 亚洲视频每日更新| 亚洲丝袜制服诱惑| 三级亚洲高清视频| 精品一区二区三区免费播放| 国产黄色精品网站| 99久久亚洲一区二区三区青草 | 香蕉加勒比综合久久| 日本中文字幕不卡| 国产激情精品久久久第一区二区 | 亚洲综合一二区| 天天免费综合色| 国产伦精品一区二区三区免费| 粉嫩aⅴ一区二区三区四区五区 | 中文字幕欧美激情一区| 亚洲免费观看高清完整版在线观看| 亚洲高清视频中文字幕| 久久99精品久久久| 91免费国产在线观看| 欧美一区二区三区电影| 国产精品福利av| 蜜桃av噜噜一区| jlzzjlzz亚洲日本少妇| 欧美高清你懂得| 中文字幕一区二| 麻豆精品久久精品色综合| 成人综合激情网| 8x8x8国产精品| 国产精品网曝门| 日本美女一区二区三区视频| 99久久伊人精品| 日韩欧美的一区| 亚洲第一成人在线| 99久久精品国产一区| 欧美第一区第二区| 亚洲一二三四区不卡| 国产99久久久国产精品免费看| 欧美日韩aaa| 日韩毛片高清在线播放| 国产一区欧美一区| 欧美日韩久久久一区| 国产精品对白交换视频| 韩国精品久久久| 日韩欧美国产三级| 亚洲成av人影院| 欧美在线色视频| 亚洲欧美另类图片小说| 不卡av电影在线播放| 久久久精品蜜桃| 国产又黄又大久久| 337p粉嫩大胆噜噜噜噜噜91av | 精品裸体舞一区二区三区| 婷婷综合久久一区二区三区| 欧美伊人久久大香线蕉综合69| 国产精品网站在线| 国产传媒一区在线| 国产网红主播福利一区二区| 麻豆成人免费电影| 88在线观看91蜜桃国自产| 亚洲国产精品久久不卡毛片 | 欧美日韩国产区一| 亚洲与欧洲av电影| 欧美日韩亚洲综合一区二区三区| 亚洲欧美日韩国产成人精品影院 | 欧美一二三区在线观看| 日韩一区欧美二区| 日韩一级免费观看| 久久精品国产亚洲a| 欧美精品一区二区在线观看| 国产一区二区免费在线| 久久久久久免费网| 国产成人免费高清| 国产精品超碰97尤物18| 日本精品一级二级| 午夜精品久久久久久久| 欧美xxxxxxxx| 成人免费看黄yyy456| 亚洲色图制服诱惑| 欧美伦理视频网站| 极品尤物av久久免费看| 欧美国产国产综合| 欧美综合在线视频| 美美哒免费高清在线观看视频一区二区| 91精品国产综合久久精品| 久久国产精品免费| 成人免费在线播放视频| 欧美午夜免费电影| 精品无人码麻豆乱码1区2区| 中文字幕一区在线观看视频| 欧美日韩一级黄| 国产一区二区网址| 亚洲一区日韩精品中文字幕| 91精品国产入口| 成人av在线播放网址| 亚洲h精品动漫在线观看| 国产亚洲成av人在线观看导航| 色综合色狠狠天天综合色| 日韩激情中文字幕| 国产精品另类一区| 欧美日韩视频在线第一区| 国产精品一品二品| 亚洲a一区二区| 成人免费在线播放视频| 日韩你懂的在线播放| 91成人免费电影| 国产一区在线视频| 亚洲图片一区二区| 国产欧美日韩久久| 日韩一区二区视频在线观看| 91日韩精品一区| 国产精品系列在线观看| 亚洲成a人v欧美综合天堂下载| 国产精品视频在线看| 日韩一级片网址| 欧美日韩小视频| 97久久久精品综合88久久| 轻轻草成人在线| 五月婷婷色综合| 亚洲欧美色一区| 国产精品电影一区二区三区| 精品国产伦一区二区三区免费| 91久久国产综合久久| 成人av动漫网站| 国产精品原创巨作av| 毛片一区二区三区| 免费观看久久久4p| 香蕉成人伊视频在线观看| 亚洲精品日韩一| 亚洲黄一区二区三区| 国产精品嫩草影院com| 国产三级精品三级在线专区| 欧美一卡2卡3卡4卡| 欧美日韩三级在线| 欧美日韩一区三区| 欧美日韩一区久久| 欧美精品123区| 欧美美女一区二区在线观看| 欧美视频中文字幕| 欧美亚洲一区二区三区四区| 欧洲另类一二三四区| 欧美吻胸吃奶大尺度电影| 欧洲一区二区av| 欧美精品1区2区| 日韩亚洲欧美成人一区| 精品久久久三级丝袜| 久久综合狠狠综合| 国产亚洲美州欧州综合国| 欧美国产精品v| 亚洲欧美另类图片小说| 亚洲一区二区三区四区五区黄| 夜夜嗨av一区二区三区网页| 亚洲福利一二三区| 蜜桃久久精品一区二区| 国产伦精一区二区三区| 不卡视频免费播放| 欧美午夜寂寞影院| 日韩欧美高清在线| 欧美韩国日本一区| 亚洲综合999| 麻豆成人91精品二区三区| 国产麻豆视频精品| 成人av片在线观看| 欧美日韩一区二区三区视频| 日韩视频在线一区二区| 国产视频视频一区| 亚洲欧美日本韩国| 蜜芽一区二区三区| 成人亚洲精品久久久久软件| 日本韩国精品一区二区在线观看| 欧美日韩视频不卡| 久久久久国产一区二区三区四区| 国产精品久久精品日日| 亚洲成av人片在www色猫咪| 国内成人精品2018免费看| av日韩在线网站| 欧美不卡一二三| 亚洲综合在线观看视频| 九九国产精品视频| 91热门视频在线观看| 精品国产亚洲在线| 一个色在线综合| 高清视频一区二区| 欧美一个色资源| 伊人色综合久久天天人手人婷| 狠狠色综合日日| 欧美日韩一区不卡| 日韩理论片一区二区| 久久精品国产亚洲a| 欧美日韩精品三区| 中文字幕成人av| 国产在线精品不卡| 91精品国产黑色紧身裤美女|