IMP logo
IMP Reference Guide  develop.d97d4ead1f,2024/11/21
The Integrative Modeling Platform
BoxedMover.h
Go to the documentation of this file.
1 /**
2  * \file IMP/spb/BoxedMover.h
3  * \brief A mover that keeps a particle in a box
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPSPB_BOXED_MOVER_H
10 #define IMPSPB_BOXED_MOVER_H
11 
12 #include <IMP/spb/spb_config.h>
13 #include <IMP/algebra/Vector3D.h>
14 #include <IMP/core.h>
16 
17 IMPSPB_BEGIN_NAMESPACE
18 
19 //! Move a particle and keep it in a box
20 /** The transformation of a rigid body is moved in a ball of given
21  size. The probability distribution is uniform over the ball.
22  \see MonteCarlo
23  */
24 class IMPSPBEXPORT BoxedMover : public core::MonteCarloMover {
25  public:
26  /** The particle is moved within a (hexagonal or cubic) box
27  \param[in] p is the particle
28  \param[in] max_tr is the maximum translation during a step
29  */
30  BoxedMover(Particle *p, Float max_tr, algebra::Vector3Ds centers);
31 
32  protected:
33  virtual core::MonteCarloMoverResult do_propose() override;
34  virtual void do_reject() override;
35  virtual IMP::ModelObjectsTemp do_get_inputs() const override;
36 
37  // IMP_MOVER(BoxedMover);
38 
41 
42  private:
43  Float max_tr_;
44  algebra::Vector3Ds centers_;
45  algebra::Vector3D oldcoord_;
46  Particle *p_;
47 };
48 
49 IMPSPB_END_NAMESPACE
50 
51 #endif /* IMPSPB_BOXED_MOVER_H */
Move a particle and keep it in a box.
Definition: BoxedMover.h:24
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Include all non-deprecated headers in IMP.core.
#define IMP_SHOWABLE(Name)
virtual void do_reject()=0
Implement reset_proposed_move()
Return value of the MonteCarloMover::propose() function.
A base class for classes which perturb particles.
The base class for movers for Monte Carlo optimization.
virtual MonteCarloMoverResult do_propose()=0
Implement propose_move()
VectorD< 3 > Vector3D
Definition: VectorD.h:408
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:19
Simple 3D vector class.
Class to handle individual particles of a Model object.
Definition: Particle.h:43
virtual ModelObjectsTemp do_get_inputs() const =0