IMP  2.1.0
The Integrative Modeling Platform
HybridMonteCarlo.h
Go to the documentation of this file.
1 /**
2  * \file IMP/isd/HybridMonteCarlo.h
3  * \brief A hybrid monte carlo implementation
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPISD_HYBRID_MONTE_CARLO_H
10 #define IMPISD_HYBRID_MONTE_CARLO_H
11 
12 #include <IMP/isd/isd_config.h>
13 #include <IMP/core/MonteCarlo.h>
16 #include <IMP/macros.h>
17 
18 IMPISD_BEGIN_NAMESPACE
19 
20 //! Hybrid Monte Carlo optimizer
21 //moves all xyz particles having a fixed mass with an MD proposal
22 
23 class IMPISDEXPORT HybridMonteCarlo : public core::MonteCarlo
24 {
25 
26 public:
27  HybridMonteCarlo(kernel::Model *m, Float kT=1.0, unsigned steps=100,
28  Float timestep=1.0, unsigned persistence=1);
29 
30  Float get_kinetic_energy() const;
31 
32  Float get_potential_energy() const;
33 
34  Float get_total_energy() const;
35 
36  //set md timestep
37  void set_timestep(Float ts);
38  double get_timestep() const;
39 
40  //set number of md steps per mc step
41  void set_number_of_md_steps(unsigned nsteps);
42  unsigned get_number_of_md_steps() const;
43 
44  //set how many mc steps happen until you redraw the momenta
45  void set_persistence(unsigned persistence=1);
46  unsigned get_persistence() const;
47 
48  //return pointer to isd::MolecularDynamics instance
49  //useful if you want to set other stuff that is not exposed here
50  MolecularDynamics* get_md() const;
51 
52  //evaluate should return the total energy
53  double do_evaluate(const kernel::ParticleIndexes &) const;
54 
55  virtual void do_step();
57 private:
58  unsigned num_md_steps_,persistence_;
59  unsigned persistence_counter_;
62 
63 };
64 
65 IMPISD_END_NAMESPACE
66 
67 #endif /* IMPISD_HYBRID_MONTE_CARLO_H */
A Monte Carlo optimizer.
Definition: MonteCarlo.h:47
Simple Monte Carlo optimizer.
A smart pointer to a ref-counted Object that is a class memeber.
Definition: base/Pointer.h:146
A modifier which perturbs XYZs or Nuisances with a constant energy MD simulation. ...
A smart pointer to a reference counted object.
Definition: base/Pointer.h:87
Simple molecular dynamics optimizer.
Import IMP/kernel/macros.h in the namespace.
virtual void do_step()
a class that inherits from this should override this method
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
virtual double do_evaluate(const kernel::ParticleIndexes &moved) const
Get the current energy.
Definition: MonteCarlo.h:180
double Float
Basic floating-point value (could be float, double...)
Definition: base/types.h:20
Molecular dynamics optimizer on 1-D and 3-D particles.
Hybrid Monte Carlo optimizer.
Class for storing model, its restraints, constraints, and particles.