randomgen250.h

来自「计算IsingModel的磁化强度」· C头文件 代码 · 共 24 行

H
24
字号
// 32bit Random Generator using Kirkpatrick-Stoll(R250)
// 
// Call SetRandomSeed() before you use GetRandom() to get random numbers
// Use time counts as the parameter to SetRandomSeed() on win32 platform usually like this:
//	LARGE_INTEGER liCounter;
//	QueryPerformanceCounter( &liCounter );
//	CRandom.SetRandomSeed( (int)liCounter.LowPart );

#pragma once

class CRandomGen250
{
public:
	CRandomGen250( void );
	~CRandomGen250( void );
	void SetRandomSeed( int iSeed );
	double GetRandom( void );
private:
	int m_ir[256];
	int m_k;
	int m_iran_ks;
};

typedef CRandomGen250 CRandom;

⌨️ 快捷键说明

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