add numerical recipes library
This commit is contained in:
10
lib/nr/cpp/recipes/metrop.cpp
Normal file
10
lib/nr/cpp/recipes/metrop.cpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#include <cmath>
|
||||
#include "nr.h"
|
||||
using namespace std;
|
||||
|
||||
bool NR::metrop(const DP de, const DP t)
|
||||
{
|
||||
static int gljdum=1;
|
||||
|
||||
return de < 0.0 || ran3(gljdum) < exp(-de/t);
|
||||
}
|
||||
Reference in New Issue
Block a user