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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? rand.c

?? ldpc的11個程序 encode decode extract make-gen make-ldpc make-pchk print-gen print-pchk rand-src transm
?? C
字號:
/* RAND.C - Random number generation module. *//* Copyright (c) 1995, 1996, 2000, 2001 by Radford M. Neal  * * Permission is granted for anyone to copy, use, or modify this program  * for purposes of research or education, provided this copyright notice  * is retained, and note is made of any changes that have been made.  * * This program is distributed without any warranty, express or implied. * As this program was written for research purposes only, it has not been * tested to the degree that would be advisable in any important application. * All use of this program is entirely at the user's own risk. *//* NOTE:  See rand.html for documentation on these procedures. */#include <stdlib.h>#include <stdio.h>#include <string.h>#include <math.h>#include "rand.h"
#define RAND_FILE "c:\\randfile"/* This module uses the 'drand48' pseudo-random number generator found   on most Unix systems, the output of which is combined with a file   of real random numbers.   Many of the methods used in this module may be found in the following   reference:      Devroye, L. (1986) Non-Uniform Random Variate Generation,         New York: Springer-Verlag.   The methods used here are not necessarily the fastest available.  They're   selected to be reasonably fast while also being easy to write.*//* CONSTANT PI.  Defined here if not in <math.h>. */#ifndef M_PI#define M_PI 3.14159265358979323846#endif/* TABLES OF REAL RANDOM NUMBERS.  A file of 100000 real random numbers   (NOT pseudo-random) is used in conjunction with pseudo-random numbers   for extra insurance.  These are employed in the form of five tables   of 5000 32-bit integers.     The file must be located at the path given by RAND_FILE, which should   be defined on the "cc" command line. */#define Table_size 5000			/* Number of words in each table */static int rn[N_tables][Table_size];	/* Random number tables *//* STATE OF RANDOM NUMBER GENERATOR. */static int initialized = 0;		/* Has module been initialized? */static rand_state state0;		/* Default state structure */static rand_state *state;		/* Pointer to current state *//* INITIALIZE MODULE.  Sets things up using the default state structure,   set as if rand_seed had been called with a seed of one. */static void initialize (void){  int i, j, k, w;  char b;  FILE *f;  if (!initialized)  {    f = fopen(RAND_FILE,"rb");        if (f==NULL)    { fprintf(stderr,"Can't open file of random numbers (%s)\n",RAND_FILE);      exit(1);    }    for (i = 0; i<N_tables; i++)    { for (j = 0; j<Table_size; j++)      { w = 0;        for (k = 0; k<4; k++)        { if (fread(&b,1,1,f)!=1)          { fprintf(stderr,"Error reading file of random numbers (%s)\n",                            RAND_FILE);            exit(1);          }          w = (w<<8) | (b&0xff);        }        rn[i][j] = w;      }    }    state = &state0;    initialized = 1;    rand_seed(1);  }}/* SET CURRENT STATE ACCORDING TO SEED. */void rand_seed( int seed){   int j;  if (!initialized) initialize();  state->seed = seed;  state->state48[0] = seed>>16;  state->state48[1] = seed&0xffff;  state->state48[2] = rn[0][(seed&0x7fffffff)%Table_size];  for (j = 0; j<N_tables; j++)   { state->ptr[j] = seed%Table_size;    seed /= Table_size;  }}/* SET STATE STRUCTURE TO USE. */void rand_use_state( rand_state *st){   if (!initialized) initialize();  state = st;}/* RETURN POINTER TO CURRENT STATE. */rand_state *rand_get_state (void){   if (!initialized) initialize();  return state;}/* GENERATE RANDOM 31-BIT INTEGER.  Not really meant for use outside this   module. */int rand_word(void){  int v;  int j;  if (!initialized) initialize();  //v = nrand48(state->state48);
  v=1000;  for (j = 0; j<N_tables; j++)  { v ^= rn[j][state->ptr[j]];  }  for (j = 0; j<N_tables && state->ptr[j]==Table_size-1; j++)   { state->ptr[j] = 0;  }  if (j<N_tables)   { state->ptr[j] += 1;  }  return v & 0x7fffffff;}/* GENERATE UNIFORMLY FROM [0,1). */double rand_uniform (void){  return (double)rand_word() / (1.0+(double)0x7fffffff);}/* GENERATE UNIFORMLY FORM (0,1). */double rand_uniopen (void){  return (0.5+(double)rand_word()) / (1.0+(double)0x7fffffff);}/* GENERATE RANDOM INTEGER FROM 0, 1, ..., (n-1). */int rand_int( int n){   return (int) (n * rand_uniform());}/* GENERATE INTEGER FROM 0, 1, ..., (n-1), WITH GIVEN DISTRIBUTION. */int rand_pickd( double *p,  int n){   double t, r;  int i;  t = 0;  for (i = 0; i<n; i++)  { if (p[i]<0) abort();    t += p[i];  }  if (t<=0) abort();  r = t * rand_uniform();  for (i = 0; i<n; i++)  { r -= p[i];    if (r<0) return i;  }  /* Return value with non-zero probability if we get here due to roundoff. */  for (i = 0; i<n; i++)   { if (p[i]>0) return i;  }  abort(); }/* SAME PROCEDURE AS ABOVE, BUT WITH FLOAT ARGUMENT. */int rand_pickf( float *p,  int n){   double t, r;  int i;  t = 0;  for (i = 0; i<n; i++)  { if (p[i]<=0) abort();    t += p[i];  }  if (t<=0) abort();  r = t * rand_uniform();  for (i = 0; i<n; i++)  { r -= p[i];    if (r<0) return i;  }  /* Return value with non-zero probability if we get here due to roundoff. */  for (i = 0; i<n; i++)   { if (p[i]>0) return i;  }  abort(); }/* GAUSSIAN GENERATOR.  Done by using the Box-Muller method, but only one   of the variates is retained (using both would require saving more state).   See Devroye, p. 235.    As written, should never deliver exactly zero, which may sometimes be   helpful. */double rand_gaussian (void){  double a, b;  a = rand_uniform();  b = rand_uniopen();  return cos(2.0*M_PI*a) * sqrt(-2.0*log(b));}/* EXPONENTIAL GENERATOR.  See Devroye, p. 29.  Written so as to never   return exactly zero. */double rand_exp (void){  return -log(rand_uniopen());}/* LOGISTIC GENERATOR.  Just inverts the CDF. */double rand_logistic (void){ double u;  u = rand_uniopen();  return log(u/(1-u));}/* CAUCHY GENERATOR.  See Devroye, p. 29. */double rand_cauchy (void){  return tan (M_PI * (rand_uniopen()-0.5));}/* GAMMA GENERATOR.  Generates a positive real number, r, with density   proportional to r^(a-1) * exp(-r).  See Devroye, p. 410 and p. 420.    Things are fiddled to avoid ever returning a value that is very near    zero. */double rand_gamma( double a){  double b, c, X, Y, Z, U, V, W;  if (a<0.00001)  { X = a;  }  else if (a<=1)   {     U = rand_uniopen();    X = rand_gamma(1+a) * pow(U,1/a);  }  else if (a<1.00001)  { X = rand_exp();  }  else  {    b = a-1;    c = 3*a - 0.75;      for (;;)    {      U = rand_uniopen();      V = rand_uniopen();          W = U*(1-U);      Y = sqrt(c/W) * (U-0.5);      X = b+Y;        if (X>=0)      {         Z = 64*W*W*W*V*V;          if (Z <= 1 - 2*Y*Y/X || log(Z) <= 2 * (b*log(X/b) - Y)) break;      }    }  }  return X<1e-30 && X<a ? (a<1e-30 ? a : 1e-30) : X;}/* BETA GENERATOR. Generates a real number, r, in (0,1), with density   proportional to r^(a-1) * (1-r)^(b-1).  Things are fiddled to avoid   the end-points, and to make the procedure symmetric between a and b. */double rand_beta ( double a,   double b){  double x, y, r;  do  { x = rand_gamma(a);    y = rand_gamma(b);    r = 1.0 + x/(x+y);    r = r - 1.0;  } while (r<=0.0 || r>=1.0);  return r;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产你懂的| 日韩精品中文字幕在线不卡尤物| 亚洲男女一区二区三区| 在线免费观看不卡av| ●精品国产综合乱码久久久久| 欧美亚洲尤物久久| 久久精品72免费观看| 中文字幕乱码日本亚洲一区二区| 97se亚洲国产综合在线| 午夜伦欧美伦电影理论片| 欧美成人精品福利| 99久久精品情趣| 亚洲观看高清完整版在线观看| 日韩欧美一级精品久久| 99r国产精品| 美女一区二区视频| 国产日产精品一区| 欧美日韩国产在线观看| 成人在线视频一区二区| 午夜精品国产更新| 国产精品三级视频| 精品视频色一区| 韩国女主播成人在线观看| 午夜成人在线视频| 国产精品伦理一区二区| 欧美日韩aaaaaa| 一本到三区不卡视频| 亚洲成年人网站在线观看| 国产欧美日韩精品一区| 欧美疯狂做受xxxx富婆| 99这里只有精品| 久久精品99国产精品| 亚洲猫色日本管| 国产欧美一区二区精品忘忧草| 欧美日韩国产美| 色先锋资源久久综合| 欧美大白屁股肥臀xxxxxx| eeuss影院一区二区三区| 精品亚洲国内自在自线福利| 亚洲一区在线观看视频| 中文av一区二区| 久久久精品天堂| 欧美精品色一区二区三区| 99re成人在线| 成人黄色在线视频| 国产成人精品影视| 蜜桃91丨九色丨蝌蚪91桃色| 久久久激情视频| 国产日本亚洲高清| 国产丝袜在线精品| 91精品国产综合久久久久| 91久久国产综合久久| aaa欧美大片| 国产a区久久久| 国产一本一道久久香蕉| 美女精品自拍一二三四| 日本一不卡视频| 亚洲视频香蕉人妖| 亚洲色图.com| 亚洲男人的天堂在线观看| 欧美国产国产综合| 欧美一区二区视频观看视频| 欧美午夜免费电影| 色综合视频在线观看| 91一区二区在线| 91视视频在线直接观看在线看网页在线看| 国产一区二区不卡老阿姨| 精东粉嫩av免费一区二区三区| 免费看欧美女人艹b| 日本不卡视频一二三区| 石原莉奈在线亚洲三区| 免费成人在线视频观看| 蜜桃视频第一区免费观看| 日韩制服丝袜先锋影音| 精品亚洲aⅴ乱码一区二区三区| 久久er99精品| 国产二区国产一区在线观看| 国产伦精品一区二区三区免费迷| 国产一区在线视频| 国产福利一区二区三区视频| 国产成人精品免费| 91在线视频播放地址| 欧美在线观看视频在线| 欧美日韩成人综合在线一区二区| 欧美精品视频www在线观看 | 蜜桃在线一区二区三区| 欧美美女网站色| 欧美一区二区久久| 26uuu欧美| 久久久久久99精品| 亚洲啪啪综合av一区二区三区| 综合网在线视频| 午夜精品国产更新| 天堂久久一区二区三区| 国产在线精品不卡| 99re免费视频精品全部| 7777女厕盗摄久久久| 67194成人在线观看| 337p日本欧洲亚洲大胆色噜噜| 国产日产欧美一区| 亚洲美女免费视频| 国产精品资源在线观看| 欧美高清你懂得| 国产精品久久久久影视| 蜜乳av一区二区三区| 色天天综合色天天久久| 久久久久久一二三区| 亚洲成在人线在线播放| av亚洲精华国产精华精| 精品久久久久久久人人人人传媒 | 中文字幕中文字幕中文字幕亚洲无线 | 成人免费不卡视频| 日韩欧美专区在线| 亚洲国产欧美日韩另类综合| 处破女av一区二区| 日韩免费观看高清完整版| 一区二区欧美视频| 成人理论电影网| 蜜桃av一区二区| 欧美精品1区2区| 亚洲黄一区二区三区| 成人免费观看视频| 久久久精品免费观看| 精品一区二区在线看| 欧美区一区二区三区| 亚洲激情自拍视频| 99久久精品免费| 欧美国产精品中文字幕| 国产精一品亚洲二区在线视频| 欧美一区二区三级| 视频一区中文字幕| 6080yy午夜一二三区久久| 亚洲v日本v欧美v久久精品| 色猫猫国产区一区二在线视频| 国产精品私人影院| proumb性欧美在线观看| 国产精品免费免费| 成人手机在线视频| 欧美激情中文字幕| 成人午夜短视频| 国产精品初高中害羞小美女文| 成人黄色电影在线| 国产精品久久一级| yourporn久久国产精品| 1024国产精品| 欧洲生活片亚洲生活在线观看| 亚洲欧美激情插| 91成人免费在线| 午夜日韩在线电影| 日韩一区二区三区视频| 麻豆国产欧美日韩综合精品二区| 日韩午夜电影av| 国内精品久久久久影院薰衣草| 久久综合色8888| 成人美女视频在线观看18| 国产精品不卡一区二区三区| 色呦呦国产精品| 午夜欧美视频在线观看| 欧美www视频| 高清国产午夜精品久久久久久| 国产精品视频观看| 91蜜桃视频在线| 五月综合激情网| 精品久久久影院| 成+人+亚洲+综合天堂| 亚洲精品一二三四区| 欧美精品久久99久久在免费线| 蜜桃一区二区三区四区| 国产精品视频看| 欧美区一区二区三区| 国产在线视频不卡二| 日韩免费一区二区| 亚洲精选在线视频| 这里只有精品视频在线观看| 麻豆国产91在线播放| 国产精品亲子乱子伦xxxx裸| 91麻豆精品视频| 日本不卡的三区四区五区| 国产欧美一区二区精品性色| 91精彩视频在线观看| 六月丁香婷婷色狠狠久久| 国产精品萝li| 欧美一区二区三区在线视频| 国产99久久久久| 亚洲一区二区三区爽爽爽爽爽 | 性久久久久久久| 欧美精品一区二区不卡| 一本大道久久a久久综合婷婷| 日本伊人色综合网| 亚洲视频中文字幕| 日韩欧美你懂的| 色94色欧美sute亚洲线路二 | 日韩毛片高清在线播放| 日韩亚洲欧美在线| 91小视频免费看| 国产精品亚洲а∨天堂免在线| 亚洲国产综合在线| 国产精品三级av在线播放| 91精品久久久久久久91蜜桃| www.亚洲人|