random.h

来自「- XCS for Dynamic Environments + Conti」· C头文件 代码 · 共 35 行

H
35
字号
#ifndef _RANDOM_H
#define _RANDOM_H

#include <stdlib.h>
#include <math.h>

class Random {
public:
	Random();
	double nextDouble();
	double nextDouble(double max);
	double nextDouble(double min, double max);
	int nextInt(int max);
	double nextGaussian();
	double nextGaussian(double,double);
	int flip(double prob);
	void   setSeed(int);
	void   setSeed(long);
private:
        long  idum;   // this is the seed
        long    IA;
        long    IM;
        double  AM;
        long    IQ;
        long    IR;
        long    NTAB;
        double  NDIV;
        double  EPS;
        double  RNMX;
        long iy;
        long *iv;
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?