add numerical recipes library
This commit is contained in:
11
lib/nr/k_and_r/recipes/metrop.c
Normal file
11
lib/nr/k_and_r/recipes/metrop.c
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
#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);
|
||||
}
|
||||
Reference in New Issue
Block a user