home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.22.0
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
include
IMP
core
version 2.22.0
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-2023 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
>
15
#include <
IMP/core/MonteCarloMover.h
>
16
#include <
IMP/Particle.h
>
17
#include <
IMP/Object.h
>
18
#include <
IMP/Model.h
>
19
#include <cereal/access.hpp>
20
#include <cereal/types/base_class.hpp>
21
#include <cereal/types/polymorphic.hpp>
22
23
24
IMPCORE_BEGIN_NAMESPACE
25
26
//! Modify a direction.
27
/** The Direction is transformed via rotation and/or reflection
28
29
\see Direction
30
\see MonteCarlo
31
*/
32
class
IMPCOREEXPORT
DirectionMover
:
public
MonteCarloMover
{
33
private
:
34
algebra::Vector3D
last_direction_;
35
Float
max_angle_;
36
Float
reflect_prob_;
37
ParticleIndex
pi_;
38
39
void
initialize(
ParticleIndex
pi,
double
max_rotation,
40
double
reflect_probability);
41
42
friend
class
cereal::access;
43
44
template
<
class
Archive>
void
serialize(Archive &ar) {
45
ar(cereal::base_class<MonteCarloMover>(
this
), last_direction_,
46
max_angle_, reflect_prob_, pi_);
47
}
48
IMP_OBJECT_SERIALIZE_DECL
(
DirectionMover
);
49
50
public
:
51
DirectionMover
(
Model
*m,
ParticleIndex
pi,
Float
max_rotation,
52
Float
reflect_probability);
53
54
DirectionMover
(
Direction
d,
Float
max_rotation,
55
Float
reflect_probability);
56
57
DirectionMover
() {}
58
59
//! Set the maximum rotation in radians.
60
void
set_maximum_rotation(
Float
mr);
61
62
//! Set the frequency of reflection moves.
63
void
set_reflect_probability(
Float
rp);
64
65
//! Get the maximum rotation.
66
Float
get_maximum_rotation
()
const
{
return
max_angle_; }
67
68
//! Get the frequency of reflection moves.
69
Float
get_reflect_probability
()
const
{
return
reflect_prob_; }
70
71
//! Get the surface being moved.
72
Direction
get_direction
()
const
{
return
Direction
(get_model(), pi_); }
73
74
protected
:
75
virtual
ModelObjectsTemp
do_get_inputs
()
const override
;
76
virtual
MonteCarloMoverResult
do_propose
()
override
;
77
virtual
void
do_reject
()
override
;
78
IMP_OBJECT_METHODS
(
DirectionMover
);
79
};
80
81
IMPCORE_END_NAMESPACE
82
83
#endif
/* IMPCORE_DIRECTION_MOVER_H */
IMP::core::DirectionMover::get_direction
Direction get_direction() const
Get the surface being moved.
Definition:
DirectionMover.h:72
MonteCarlo.h
Simple Monte Carlo optimizer.
IMP_OBJECT_METHODS
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition:
object_macros.h:25
IMP::core::Direction
A decorator for a particle that represents a direction in 3D.
Definition:
direction.h:23
Model.h
Storage of a model, its restraints, constraints and particles.
IMP::Index< ParticleIndexTag >
IMP::core::MonteCarloMover::do_reject
virtual void do_reject()=0
Implement reset_proposed_move()
IMP::core::MonteCarloMoverResult
Return value of the MonteCarloMover::propose() function.
Definition:
MonteCarloMover.h:31
IMP::Vector
A more IMP-like version of the std::vector.
Definition:
Vector.h:50
IMP::core::DirectionMover
Modify a direction.
Definition:
DirectionMover.h:32
IMP::Model
Class for storing model, its restraints, constraints, and particles.
Definition:
Model.h:86
IMP::core::MonteCarloMover
A base class for classes which perturb particles.
Definition:
MonteCarloMover.h:44
MonteCarloMover.h
The base class for movers for Monte Carlo optimization.
IMP_OBJECT_SERIALIZE_DECL
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
Definition:
object_macros.h:95
IMP::core::MonteCarloMover::do_propose
virtual MonteCarloMoverResult do_propose()=0
Implement propose_move()
direction.h
Decorators for directions and the angle between them.
IMP::core::DirectionMover::get_maximum_rotation
Float get_maximum_rotation() const
Get the maximum rotation.
Definition:
DirectionMover.h:66
Particle.h
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
Object.h
A shared base class to help in debugging and things.
IMP::core::DirectionMover::get_reflect_probability
Float get_reflect_probability() const
Get the frequency of reflection moves.
Definition:
DirectionMover.h:69
IMP::algebra::Vector3D
VectorD< 3 > Vector3D
Definition:
VectorD.h:408
IMP::Float
double Float
Basic floating-point value (could be float, double...)
Definition:
types.h:19
IMP::ModelObject::do_get_inputs
virtual ModelObjectsTemp do_get_inputs() const =0