IMP logo
IMP Reference Guide  2.18.0
The Integrative Modeling Platform
Assignment.h
Go to the documentation of this file.
1 /**
2  * \file IMP/domino/Assignment.h
3  * \brief A Bayesian inference-based sampler.
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPDOMINO_ASSIGNMENT_H
10 #define IMPDOMINO_ASSIGNMENT_H
11 
12 #include <IMP/domino/domino_config.h>
13 #include "domino_macros.h"
14 #include "Subset.h"
16 #include <IMP/Value.h>
17 #include <IMP/ConstVector.h>
18 #include <IMP/macros.h>
19 #include <boost/serialization/access.hpp>
20 #include <boost/serialization/vector.hpp>
21 #include <boost/serialization/base_object.hpp>
22 
23 IMPDOMINO_BEGIN_NAMESPACE
24 
25 //! Store a configuration of a subset.
26 /** This class stores a configuration of a Subset object. The
27  indices of the corresponding Subset/Assignment objects
28  correspond. That is, the state of the ith particle in
29  a Subset is the ith value in the Assignment.
30 
31  Like Subset objects, Assignment objects cannot be
32  modified and provide a vector/Python list like
33  interface.
34 */
35 class IMPDOMINOEXPORT Assignment : public ConstVector<int> {
36  typedef ConstVector<int> P;
37 
38  friend class boost::serialization::access;
39 
40  template<class Archive> void serialize(Archive &ar, const unsigned int) {
41  ar & boost::serialization::base_object<P>(*this);
42  }
43 
44  public:
45  Assignment() {}
46  Assignment(unsigned int sz) : P(sz, -1) {}
47  template <class It>
48  Assignment(It b, It e)
49  : P(b, e) {}
50  explicit Assignment(const Ints &i) : P(i.begin(), i.end()) {}
51 };
52 
54 IMP_SWAP(Assignment);
55 
56 IMPDOMINO_END_NAMESPACE
57 
58 #endif /* IMPDOMINO_ASSIGNMENT_H */
Store a list of ParticleIndexes.
Store an array of values of the same type.
Various general useful macros for IMP.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Definition: value_macros.h:23
Various important macros for implementing decorators.
A Bayesian inference-based sampler.
Store a configuration of a subset.
Definition: Assignment.h:35
Base class for a simple primitive-like type.
Store an array of values of the same type.
Definition: ConstVector.h:28