IMP logo
IMP Reference Guide  develop.d4e9f3251e,2024/04/26
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 <cereal/access.hpp>
20 #include <cereal/types/vector.hpp>
21 #include <cereal/types/base_class.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 cereal::access;
39 
40  template<class Archive> void serialize(Archive &ar) {
41  ar(cereal::base_class<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:27