IMP  2.2.0
The Integrative Modeling Platform
NormalMover.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/NormalMover.h
3  * \brief A modifier which perturbs a point with a normal distribution.
4  *
5  * Copyright 2007-2014 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPCORE_NORMAL_MOVER_H
10 #define IMPCORE_NORMAL_MOVER_H
11 
12 #include <IMP/core/core_config.h>
13 #include "MonteCarloMover.h"
14 
15 IMPCORE_BEGIN_NAMESPACE
16 
17 //! Modify a set of continuous variables using a normal distribution.
18 /** \see MonteCarlo
19  */
20 class IMPCOREEXPORT NormalMover : public MonteCarloMover {
22  FloatKeys keys_;
23  Float stddev_;
24  algebra::VectorKDs originals_;
25 
26  void initialize(kernel::ParticleIndexes pis, FloatKeys keys, double radius);
27 
28  public:
30  double stddev);
31  //! Move the x,y,z coordinates
32  NormalMover(kernel::Model *m, kernel::ParticleIndex pi, double stddev);
33 #ifndef IMP_DOXYGEN
34  /** \param[in] sc The set of particles to perturb.
35  \param[in] vars The variables to use (normally the keys for x,y,z)
36  \param[in] sigma The standard deviation to use.
37  */
38  NormalMover(const kernel::ParticlesTemp &sc, const FloatKeys &vars,
39  Float sigma);
40 
41  NormalMover(const kernel::ParticlesTemp &sc, Float radius);
42 #endif
43 
44  void set_sigma(Float sigma) {
45  IMP_USAGE_CHECK(sigma > 0, "Sigma must be positive");
46  stddev_ = sigma;
47  }
48 
49  Float get_sigma() const { return stddev_; }
50 
51  protected:
52  virtual kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
53  virtual MonteCarloMoverResult do_propose() IMP_OVERRIDE;
54  virtual void do_reject() IMP_OVERRIDE;
56 };
57 
58 IMPCORE_END_NAMESPACE
59 
60 #endif /* IMPCORE_NORMAL_MOVER_H */
virtual void do_reject()=0
Implement reset_proposed_move()
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
A base class for classes which perturb particles.
The base class for movers for MC optimization.
virtual MonteCarloMoverResult do_propose()=0
Implement propose_move()
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Modify a set of continuous variables using a normal distribution.
Definition: NormalMover.h:20
virtual ModelObjectsTemp do_get_inputs() const =0
double Float
Basic floating-point value (could be float, double...)
Definition: base/types.h:20
Class for storing model, its restraints, constraints, and particles.
Definition: kernel/Model.h:72