IMP  2.1.0
The Integrative Modeling Platform
kernel/ConfigurationSet.h
Go to the documentation of this file.
1 /**
2  * \file IMP/kernel/ConfigurationSet.h
3  * \brief Store a set of configurations of the model.
4  *
5  * Copyright 2007-2013 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/kernel_config.h>
13 #include <IMP/base/Object.h>
14 #include <IMP/base/Pointer.h>
15 #include "Model.h"
16 #include "Configuration.h"
17 #include "OptimizerState.h"
18 #include "internal/utility.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::base::Object {
29  mutable base::Pointer<Model> model_;
32 
33  public:
34  ConfigurationSet(kernel::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 */
A class to store a set of configurations of a model.
virtual void do_update(unsigned int)
A nullptr-initialized pointer to an IMP Object.
A smart pointer to a ref-counted Object that is a class memeber.
Definition: base/Pointer.h:146
Shared optimizer state that is invoked upon commitment of new coordinates.
A smart pointer to a reference counted object.
Definition: base/Pointer.h:87
IMP::kernel::SaveToConfigurationSetOptimizerState SaveToConfigurationSetOptimizerState
Various general useful macros for IMP.
Shared optimizer state.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Storage of a model, its restraints, constraints and particles.
Common base class for heavy weight IMP objects.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
IMP::kernel::ConfigurationSet ConfigurationSet
A shared base class to help in debugging and things.
Store a set of configurations of the model.
Class for storing model, its restraints, constraints, and particles.