metrop.c

来自「Numerical Recipes Software 提供的算法子程序集」· C语言 代码 · 共 12 行

C
12
字号
#include <math.h>

int metrop(de,t)
float de,t;
{
	float ran3();
	static long gljdum=1;

	return de < 0.0 || ran3(&gljdum) < exp(-de/t);
}
/* (C) Copr. 1986-92 Numerical Recipes Software . */

⌨️ 快捷键说明

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