CHROMA
lib
update
molecdyn
hmc
global_metropolis_accrej.cc
Go to the documentation of this file.
1
/*! \file
2
* \brief Simple metropolis accept/reject
3
*
4
* Simple metropolis accept/reject
5
*/
6
7
#include "
chromabase.h
"
8
#include "
update/molecdyn/hmc/global_metropolis_accrej.h
"
9
10
namespace
Chroma
{
11
12
// Metropolis accept/reject
13
/*! @ingroup hmc */
14
bool
globalMetropolisAcceptReject
(
const
Double
& DeltaH)
15
{
16
START_CODE
();
17
18
// If deltaH is negative then always accept
19
bool
ret_val;
20
21
22
if
( toBool( DeltaH <=
Double
(0)) ) {
23
ret_val =
true
;
24
}
25
else
{
26
Double
AccProb = exp(-DeltaH);
27
Double
uni_dev;
28
random(uni_dev);
29
30
31
if
( toBool( uni_dev <= AccProb ) ) {
32
33
ret_val =
true
;
34
35
}
36
else
{
37
38
ret_val =
false
;
39
}
40
}
41
42
END_CODE
();
43
44
return
ret_val;
45
}
46
47
}
// End namespace
chromabase.h
Primary include file for CHROMA library code.
global_metropolis_accrej.h
Global metropolis.
Chroma::globalMetropolisAcceptReject
bool globalMetropolisAcceptReject(const Double &DeltaH)
Definition:
global_metropolis_accrej.cc:14
Chroma
Asqtad Staggered-Dirac operator.
Definition:
klein_gord.cc:10
Chroma::START_CODE
START_CODE()
Chroma::END_CODE
END_CODE()
testing::internal::Double
FloatingPoint< double > Double
Definition:
gtest.h:7351
Generated by
1.9.1