From e5d30fe5e29b7bd5a076c39bedd3bff0b2f9c766 Mon Sep 17 00:00:00 2001 From: Azusa Yamaguchi Date: Wed, 10 Jun 2015 11:30:27 +0100 Subject: [PATCH] Fix compile --- tests/Test_GaugeAction.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/Test_GaugeAction.cc b/tests/Test_GaugeAction.cc index bbfd8717..fc49cf2e 100644 --- a/tests/Test_GaugeAction.cc +++ b/tests/Test_GaugeAction.cc @@ -7,6 +7,26 @@ using namespace std; using namespace Grid; using namespace Grid::QCD; + +/* For Metropolis */ +class Metropolis { +public: + GridSerialRNG & sRNG; + Metropolis(GridSerialRNG & _sRNG) : sRNG(_sRNG) {}; + bool AcceptReject(const RealD Delta) + { + RealD rand; + + if(Delta <=0.0) return true; + + random(sRNG,rand); + if(rand <= exp(-Delta)) + return true; + else + return false; + } +}; + int main (int argc, char ** argv) { Grid_init(&argc,&argv);