IMP logo
IMP Reference Guide  2.14.0
The Integrative Modeling Platform
SurfaceMover.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/SurfaceMover.h
3  * \brief A mover that transforms a Surface.
4  *
5  * Copyright 2007-2020 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPCORE_SURFACE_MOVER_H
10 #define IMPCORE_SURFACE_MOVER_H
11 
12 #include <IMP/core/core_config.h>
13 #include <IMP/core/Surface.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 surface orientation.
24 /** The Surface is transformed via translation, rotation, and/or
25  reflection.
26 
27  If combined with a `LateralSurfaceConstraint`, then only
28  the normal component of the translation is kept.
29 
30  \see Surface
31  \see LateralSurfaceConstraint
32  \see MonteCarlo
33 */
34 class IMPCOREEXPORT SurfaceMover : public MonteCarloMover {
35  private:
36  algebra::Transformation3D last_transform_;
37  Float max_translation_;
38  Float max_angle_;
39  Float reflect_prob_;
40  ParticleIndex pi_;
41 
42  void initialize(ParticleIndex pi, double max_translation,
43  double max_rotation, double reflect_probability);
44 
45  public:
46  SurfaceMover(Model *m, ParticleIndex pi, Float max_translation,
47  Float max_rotation, Float reflect_probability);
48 
49  SurfaceMover(Surface s, Float max_translation, Float max_rotation,
50  Float reflect_probability);
51 
52  //! Set the maximum translation in angstroms.
53  void set_maximum_translation(Float mt);
54 
55  //! Set the maximum rotation in radians.
56  void set_maximum_rotation(Float mr);
57 
58  //! Set the frequency of reflection moves.
59  void set_reflect_probability(Float rp);
60 
61  //! Get the maximum translation.
62  Float get_maximum_translation() const { return max_translation_; }
63 
64  //! Get the maximum rotation.
65  Float get_maximum_rotation() const { return max_angle_; }
66 
67  //! Get the frequency of reflection moves.
68  Float get_reflect_probability() const { return reflect_prob_; }
69 
70  //! Get the surface being moved.
71  Surface get_surface() const { return Surface(get_model(), pi_); }
72 
73  protected:
75  virtual MonteCarloMoverResult do_propose() IMP_OVERRIDE;
76  virtual void do_reject() IMP_OVERRIDE;
78 };
79 
80 IMPCORE_END_NAMESPACE
81 
82 #endif /* IMPCORE_SURFACE_MOVER_H */
Simple 3D transformation class.
Simple Monte Carlo optimizer.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Storage of a model, its restraints, constraints and particles.
Return value of the MonteCarloMover::propose() function.
Float get_maximum_rotation() const
Get the maximum rotation.
Definition: SurfaceMover.h:65
Modify a surface orientation.
Definition: SurfaceMover.h:34
Surface get_surface() const
Get the surface being moved.
Definition: SurfaceMover.h:71
A more IMP-like version of the std::vector.
Definition: Vector.h:39
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
Simple surface decorator.
A base class for classes which perturb particles.
The base class for movers for Monte Carlo optimization.
A decorator for a particle that represents a surface, its coordinates, and orientation.
Definition: Surface.h:35
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
Float get_reflect_probability() const
Get the frequency of reflection moves.
Definition: SurfaceMover.h:68
Float get_maximum_translation() const
Get the maximum translation.
Definition: SurfaceMover.h:62
A shared base class to help in debugging and things.
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.