quasi.hpp
来自「伪随机数生成器」· HPP 代码 · 共 53 行
HPP
53 行
// quasi.hpp Quasi-Random Number generator// See Computers in Physics Nov/Dec 1989// returns an n-dimensional vector of values in 0.0..1.0// maximum n is currently hardwired to 52, the application// can query for this with the static method MaxDim()// (c) Copyright 1996, Everett F. Carter Jr.// Permission is granted by the author to use// this software for any application provided this// copyright notice is preserved.// rcsid: @(#)quasi.hpp 1.6 10:56:05 4/3/96 EFC#ifndef QUASI_RANDOM_HPP_#define QUASI_RANDOM_HPP_ 1.6#include <status.hpp>#include <barray.hpp>class QuasiRandom : public virtual ErrorStatus{ private: static const int maxdim; static const int maxbit; static unsigned long int *iv; static double factor; static int instances; void init(); int dim; unsigned long int index; unsigned long int *ix; public: QuasiRandom(const int dimension = 1); ~QuasiRandom(); // query what maximum dimension is for the current implementation static int MaxDim() { return maxdim; } void number(float* x); void number(BasicArray& x); // same as number but nicer syntax void operator()(float *x) { number(x); } void operator()(BasicArray& x) { number(x); }};#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?