-
Notifications
You must be signed in to change notification settings - Fork 30
/
BoxedMover.h
51 lines (41 loc) · 1.27 KB
/
BoxedMover.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* \file IMP/spb/BoxedMover.h
* \brief A mover that keeps a particle in a box
*
* Copyright 2007-2022 IMP Inventors. All rights reserved.
*
*/
#ifndef IMPSPB_BOXED_MOVER_H
#define IMPSPB_BOXED_MOVER_H
#include <IMP/spb/spb_config.h>
#include <IMP/algebra/Vector3D.h>
#include <IMP/core.h>
#include <IMP/core/MonteCarloMover.h>
IMPSPB_BEGIN_NAMESPACE
//! Move a particle and keep it in a box
/** The transformation of a rigid body is moved in a ball of given
size. The probability distribution is uniform over the ball.
\see MonteCarlo
*/
class IMPSPBEXPORT BoxedMover : public core::MonteCarloMover {
public:
/** The particle is moved within a (hexagonal or cubic) box
\param[in] p is the particle
\param[in] max_tr is the maximum translation during a step
*/
BoxedMover(Particle *p, Float max_tr, algebra::Vector3Ds centers);
protected:
virtual core::MonteCarloMoverResult do_propose() override;
virtual void do_reject() override;
virtual IMP::ModelObjectsTemp do_get_inputs() const override;
// IMP_MOVER(BoxedMover);
IMP_OBJECT_METHODS(BoxedMover);
IMP_SHOWABLE(BoxedMover);
private:
Float max_tr_;
algebra::Vector3Ds centers_;
algebra::Vector3D oldcoord_;
Particle *p_;
};
IMPSPB_END_NAMESPACE
#endif /* IMPSPB_BOXED_MOVER_H */