IMP logo
IMP Reference Guide  develop.674b25dded,2025/06/16
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>
15 
16 IMPSPB_BEGIN_NAMESPACE
17 
18 //! Move a particle and keep it in a box
19 /** The transformation of a rigid body is moved in a ball of given
20  size. The probability distribution is uniform over the ball.
21  \see MonteCarlo
22  */
23 class IMPSPBEXPORT BoxedMover : public core::MonteCarloMover {
24  public:
25  /** The particle is moved within a (hexagonal or cubic) box
26  \param[in] p is the particle
27  \param[in] max_tr is the maximum translation during a step
28  */
29  BoxedMover(Particle *p, Float max_tr, algebra::Vector3Ds centers);
30 
31  protected:
32  virtual core::MonteCarloMoverResult do_propose() override;
33  virtual void do_reject() override;
34  virtual IMP::ModelObjectsTemp do_get_inputs() const override;
35 
36  // IMP_MOVER(BoxedMover);
37 
40 
41  private:
42  Float max_tr_;
43  algebra::Vector3Ds centers_;
44  algebra::Vector3D oldcoord_;
45  Particle *p_;
46 };
47 
48 IMPSPB_END_NAMESPACE
49 
50 #endif /* IMPSPB_BOXED_MOVER_H */
Move a particle and keep it in a box.
Definition: BoxedMover.h:23
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
#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