IMP  2.1.0
The Integrative Modeling Platform
MoverBase.h
Go to the documentation of this file.
1 /**
2  * \file IMP/core/MoverBase.h \brief Backwards compatibility.
3  *
4  * Copyright 2007-2013 IMP Inventors. All rights reserved.
5  *
6  */
7 
8 #ifndef IMPCORE_MOVER_BASE_H
9 #define IMPCORE_MOVER_BASE_H
10 
11 #include <IMP/core/core_config.h>
12 #include "Mover.h"
13 
14 #include <IMP/kernel/internal/container_helpers.h>
15 #include <IMP/macros.h>
16 
17 #include <vector>
18 
19 IMPCORE_DEPRECATED_HEADER(2.1, "Use MonteCarloMover");
20 
21 IMPCORE_BEGIN_NAMESPACE
22 
23 /** \deprecated_at{2.1} Use IMP::core::MonteCarloMover instead
24  */
25 class IMPCOREEXPORT MoverBase : public Mover {
26  base::Vector<Floats> values_;
28  kernel::ParticleIndexes particles_;
29  void do_propose_value(unsigned int i, unsigned int j, Float t);
30 
31  public:
32  virtual void reset_move();
33 
34  /** This sets everything up and then calls the generate_move method.
35  */
36  virtual kernel::ParticlesTemp propose_move(Float f);
37 
39 
40  protected:
41  unsigned int get_number_of_particles() const { return particles_.size(); }
42  unsigned int get_number_of_keys() const { return keys_.size(); }
43  std::string get_particle_name(unsigned int i) const;
44 
45  //! implement this method to propose a move
46  /** See NormalMover for a simple example.
47  */
48  virtual void do_move(Float f) = 0;
49 
50  //! Get the value of a controlled attribute
51  /** \param [in] i The index of the particle.
52  \param [in] j The index of the attribute.
53  */
54  Float get_value(unsigned int i, unsigned int j) const;
55 
56  //! Propose a value
57  /** \param[in] i The index of the particle.
58  \param[in] j The index of the key
59  \param[in] t The value to propose
60  */
61  void propose_value(unsigned int i, unsigned int j, Float t);
62 
63  IMPCORE_DEPRECATED_OBJECT_DECL(2.1)
64  MoverBase(const kernel::ParticlesTemp &ps, const FloatKeys &keys,
65  std::string name);
66 };
67 
69 
70 IMPCORE_END_NAMESPACE
71 
72 #endif /* IMPCORE_MOVER_BASE_H */
Backwards compatibility.
Import IMP/kernel/macros.h in the namespace.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
virtual kernel::ParticlesTemp get_output_particles() const =0
Return the set of particles over which moves can be proposed.
virtual void reset_move()=0
Roll back any changes made to the kernel::Particles.
double Float
Basic floating-point value (could be float, double...)
Definition: base/types.h:20