mcpele  1.0.0
The Monte Carlo Python Energy Landscape Explorer
 All Classes Namespaces Functions Variables Typedefs
Public Member Functions | Protected Attributes
mcpele::MetropolisTest Class Reference

Metropolis acceptance test. More...

#include <metropolis_test.h>

Inheritance diagram for mcpele::MetropolisTest:
mcpele::AcceptTest

List of all members.

Public Member Functions

 MetropolisTest (const size_t rseed)
virtual ~MetropolisTest ()
virtual bool test (pele::Array< double > &trial_coords, double trial_energy, pele::Array< double > &old_coords, double old_energy, double temperature, MC *mc)
size_t get_seed () const
void set_generator_seed (const size_t inp)

Protected Attributes

size_t m_seed
std::mt19937_64 m_generator
std::uniform_real_distribution
< double > 
m_distribution

Detailed Description

Metropolis acceptance test.

The Metropolis acceptance criterion accepts each move with probability

\[ P( x_{old} \Rightarrow x_{new}) = min \{ 1, \exp [- \beta (E_{new} - E_{old})] \} \]

where \(\beta\) is the reciprocal of the temperature

Definition at line 21 of file metropolis_test.h.


Constructor & Destructor Documentation

mcpele::MetropolisTest::MetropolisTest ( const size_t  rseed)

Constructor.

Parameters:
rseeda random positive integer

Definition at line 10 of file metropolis_test.cpp.

virtual mcpele::MetropolisTest::~MetropolisTest ( ) [inline, virtual]

Destructor.

Definition at line 33 of file metropolis_test.h.


Member Function Documentation

size_t mcpele::MetropolisTest::get_seed ( ) const [inline]
Returns:
seed used for rng

Definition at line 49 of file metropolis_test.h.

void mcpele::MetropolisTest::set_generator_seed ( const size_t  inp) [inline]

Definition at line 50 of file metropolis_test.h.

bool mcpele::MetropolisTest::test ( pele::Array< double > &  trial_coords,
double  trial_energy,
pele::Array< double > &  old_coords,
double  old_energy,
double  temperature,
MC mc 
) [virtual]
Parameters:
trial_coordsarray of trial coordinates
trial_energyenergy associated with trial_coords
old_coordsarray of coordinates before TakeStep
old_energyenergy associeted with old_coords
temperaturesystem temperature
mcpointer to the MC runner
Returns:
bool for outcome of the test

Implements mcpele::AcceptTest.

Definition at line 21 of file metropolis_test.cpp.


Member Data Documentation

std::uniform_real_distribution<double> mcpele::MetropolisTest::m_distribution [protected]

Distribution for random number generator

Definition at line 25 of file metropolis_test.h.

std::mt19937_64 mcpele::MetropolisTest::m_generator [protected]

Mersenne twister random number generator

Definition at line 24 of file metropolis_test.h.

size_t mcpele::MetropolisTest::m_seed [protected]

Seed for random number generator

Definition at line 23 of file metropolis_test.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs