IMP logo
IMP Reference Guide  2.14.0
The Integrative Modeling Platform
DirectionMover.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/DirectionMover.h
3  * \brief A mover that transforms a Direction.
4  *
5  * Copyright 2007-2020 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPCORE_DIRECTION_MOVER_H
10 #define IMPCORE_DIRECTION_MOVER_H
11 
12 #include <IMP/core/core_config.h>
13 #include <IMP/core/direction.h>
14 #include <IMP/core/MonteCarlo.h>
16 #include <IMP/Particle.h>
17 #include <IMP/Object.h>
18 #include <IMP/Model.h>
19 
20 
21 IMPCORE_BEGIN_NAMESPACE
22 
23 //! Modify a direction.
24 /** The Direction is transformed via rotation and/or reflection
25 
26  \see Direction
27  \see MonteCarlo
28 */
29 class IMPCOREEXPORT DirectionMover : public MonteCarloMover {
30  private:
31  algebra::Vector3D last_direction_;
32  Float max_angle_;
33  Float reflect_prob_;
34  ParticleIndex pi_;
35 
36  void initialize(ParticleIndex pi, double max_rotation,
37  double reflect_probability);
38 
39  public:
40  DirectionMover(Model *m, ParticleIndex pi, Float max_rotation,
41  Float reflect_probability);
42 
43  DirectionMover(Direction d, Float max_rotation,
44  Float reflect_probability);
45 
46  //! Set the maximum rotation in radians.
47  void set_maximum_rotation(Float mr);
48 
49  //! Set the frequency of reflection moves.
50  void set_reflect_probability(Float rp);
51 
52  //! Get the maximum rotation.
53  Float get_maximum_rotation() const { return max_angle_; }
54 
55  //! Get the frequency of reflection moves.
56  Float get_reflect_probability() const { return reflect_prob_; }
57 
58  //! Get the surface being moved.
59  Direction get_direction() const { return Direction(get_model(), pi_); }
60 
61  protected:
63  virtual MonteCarloMoverResult do_propose() IMP_OVERRIDE;
64  virtual void do_reject() IMP_OVERRIDE;
66 };
67 
68 IMPCORE_END_NAMESPACE
69 
70 #endif /* IMPCORE_DIRECTION_MOVER_H */
Direction get_direction() const
Get the surface being moved.
Simple Monte Carlo optimizer.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
A decorator for a particle that represents a direction in 3D.
Definition: direction.h:23
Storage of a model, its restraints, constraints and particles.
Return value of the MonteCarloMover::propose() function.
A more IMP-like version of the std::vector.
Definition: Vector.h:39
Modify a direction.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
A base class for classes which perturb particles.
The base class for movers for Monte Carlo optimization.
Decorators for directions and the angle between them.
Float get_maximum_rotation() const
Get the maximum rotation.
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
A shared base class to help in debugging and things.
Float get_reflect_probability() const
Get the frequency of reflection moves.
VectorD< 3 > Vector3D
Definition: VectorD.h:421
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:20
virtual ModelObjectsTemp do_get_inputs() const =0
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.