rndlcg.hpp

来自「anneal_SimulatedAnnealing.rar用C语言编写」· HPP 代码 · 共 37 行

HPP
37
字号
// rndlcg.hpp		The "minimal standard" linear congruential generator//                      (c) Copyright 1994, Everett F. Carter Jr.//                      Permission is granted by the author to use//			this software for any application provided this//			copyright notice is preserved.//			see Park & Miller, 1988; Comm. of the ACM, 31(10)//			pp. 1192 - 1201// rcsid: @(#)rndlcg.hpp	1.2 14:38:36 7/25/94   EFC#ifndef RND_LCG_HPP_#define RND_LCG_HPP_ 1.2#include <randgen.hpp>class RandLCG : public RandomGenerator{	protected:	   long int seed_val;           static int instances;	   static const long int quotient;	   static const long int remainder;	public:	   RandLCG();	   RandLCG(const long sd) : seed_val(sd) { instances++; }	   ~RandLCG() { --instances; }	   long seed(const long sd);	   unsigned long int rani( void );           Real         ranf( void ); 	   };#endif

⌨️ 快捷键说明

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