IMP logo
IMP Reference Guide  2.10.0
The Integrative Modeling Platform
ConfigurationSet.h
Go to the documentation of this file.
1 /**
2  * \file IMP/ConfigurationSet.h
3  * \brief Store a set of configurations of the model.
4  *
5  * Copyright 2007-2018 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPKERNEL_CONFIGURATION_SET_H
10 #define IMPKERNEL_CONFIGURATION_SET_H
11 
12 #include <IMP/kernel_config.h>
13 #include <IMP/Object.h>
14 #include <IMP/Pointer.h>
15 #include "Model.h"
16 #include "Configuration.h"
17 #include "OptimizerState.h"
18 #include "internal/utility.h"
19 #include <IMP/warning_macros.h>
20 
21 IMPKERNEL_BEGIN_NAMESPACE
22 
23 //! A class to store a set of configurations of a model
24 /** The class maintains a set of structures found by a Sampler
25  protocol and allows them to be queried and loaded and saved.
26  \include basic_optimization.py
27 */
28 class IMPKERNELEXPORT ConfigurationSet : public IMP::Object {
29  mutable Pointer<Model> model_;
31  Vector<Pointer<Configuration> > configurations_;
32 
33  public:
34  ConfigurationSet(Model *m, std::string name = "ConfigurationSet %1%");
35  //! Save the current configuration of the Model
36  void save_configuration();
37  unsigned int get_number_of_configurations() const;
38  //! Load the ith configuration into the Model
39  /** Passing -1 returns it to the base configuration. */
40  void load_configuration(int i) const;
41  void remove_configuration(unsigned int i);
42  Model *get_model() const { return model_; }
44 };
45 
47 
48 /** Save the model to a ConfigurationSet. */
50  : public OptimizerState {
52 
53  public:
55 
56  protected:
57  virtual void do_update(unsigned int update_number) IMP_OVERRIDE;
59 };
60 
61 IMPKERNEL_END_NAMESPACE
62 
63 #endif /* IMPKERNEL_CONFIGURATION_SET_H */
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Storage of a model, its restraints, constraints and particles.
virtual void do_update(unsigned int)
A more IMP-like version of the std::vector.
Definition: Vector.h:39
A smart pointer to a reference counted object.
Definition: Pointer.h:87
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:72
Common base class for heavy weight IMP objects.
Definition: Object.h:106
Various general useful macros for IMP.
A smart pointer to a ref-counted Object that is a class member.
Definition: Pointer.h:146
A class to store a set of configurations of a model.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
Definition: object_macros.h:44
A nullptr-initialized pointer to an IMP Object.
A shared base class to help in debugging and things.
Shared optimizer state that is invoked upon commitment of new coordinates.
Store a set of configurations of the model.
Shared optimizer state.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.