IMP  2.1.0
The Integrative Modeling Platform
Mover.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/Mover.h
3  * \brief Backwards compatibility.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPCORE_MOVER_H
10 #define IMPCORE_MOVER_H
11 
12 #include <IMP/core/core_config.h>
13 #include "MonteCarloMover.h"
14 #include <IMP/kernel/Model.h>
15 #include <IMP/kernel/Particle.h>
16 
17 IMPCORE_DEPRECATED_HEADER(2.1, "Use MonteCarloMover");
18 
19 IMPCORE_BEGIN_NAMESPACE
20 
21 /** \deprecated_at{2.1} Use MonteCarloMover instead
22  */
23 class IMPCOREEXPORT Mover : public MonteCarloMover {
24  public:
25  IMPCORE_DEPRECATED_OBJECT_DECL(2.1)
26  Mover(kernel::Model *m, std::string name) : MonteCarloMover(m, name) {
27  IMPCORE_DEPRECATED_OBJECT_DEF(2.1, "Use MonteCarloMover");
28  }
29 
30  virtual kernel::ParticlesTemp propose_move(Float size) = 0;
31 
32  //! Roll back any changes made to the kernel::Particles
33  virtual void reset_move() = 0;
34 
35  //! Return the set of particles over which moves can be proposed
36  virtual kernel::ParticlesTemp get_output_particles() const = 0;
37 
38  protected:
39  virtual kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE {
40  return get_as<ModelObjectsTemp>(get_output_particles());
41  }
42  virtual MonteCarloMoverResult do_propose() IMP_OVERRIDE {
43  return MonteCarloMoverResult(get_indexes(propose_move(1.0)), 1.0);
44  }
45  virtual void do_reject() IMP_OVERRIDE { reset_move(); }
46 };
47 
48 typedef MonteCarloMovers Movers;
49 typedef MonteCarloMoversTemp MoversTemp;
50 
51 IMPCORE_END_NAMESPACE
52 
53 #endif /* IMPCORE_MOVER_H */
virtual void do_reject()
Implement reset_proposed_move()
Definition: Mover.h:45
ParticleIndexes get_indexes(const ParticlesTemp &ps)
ParticlesTemp get_output_particles(const ModelObjectsTemp &mos)
IMP::base::Vector< IMP::base::WeakPointer< MonteCarloMover > > MonteCarloMoversTemp
IMP::base::Vector< IMP::base::Pointer< MonteCarloMover > > MonteCarloMovers
A base class for classes which perturb particles.
The base class for movers for MC optimization.
Storage of a model, its restraints, constraints and particles.
Classes to handle individual model particles.
virtual kernel::ModelObjectsTemp do_get_inputs() const
Definition: Mover.h:39
double Float
Basic floating-point value (could be float, double...)
Definition: base/types.h:20
Class for storing model, its restraints, constraints, and particles.
virtual MonteCarloMoverResult do_propose()
Implement propose_move()
Definition: Mover.h:42