hmmrand.c
来自「隐马尔科夫模型的C代码」· C语言 代码 · 共 41 行
C
41 行
/*** Author: Tapas Kanungo, kanungo@cfar.umd.edu** File: hmmrand.c** Date: 4 May 1999** Purpose: To separate out the random number generator** functions so that the rest of the code can be** platform independent.*/#include <stdlib.h>#include <sys/types.h>#include <unistd.h>/*** hmmgetseed() generates an arbitary seed for the random number generator.*/int hmmgetseed(void) { return ((int) getpid());}/* ** hmmsetseed() sets the seed of the random number generator to a** specific value.*/void hmmsetseed(int seed) { srand(seed);}/*** hmmgetrand() returns a (double) pseudo random number in the** interval [0,1).*/double hmmgetrand(void){ return (double) rand()/RAND_MAX;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?