9 #ifndef IMPDOMINO_ORDER_H
10 #define IMPDOMINO_ORDER_H
12 #include <IMP/domino/domino_config.h>
20 #include <cereal/access.hpp>
21 #include <cereal/types/vector.hpp>
22 #include <cereal/types/base_class.hpp>
24 IMPDOMINO_BEGIN_NAMESPACE
35 friend class cereal::access;
37 template<
class Archive>
void serialize(Archive &ar) {
38 ar(cereal::base_class<P>(
this));
45 Ints get_list_ordered(It b, It e)
const {
46 IMP_USAGE_CHECK(static_cast<unsigned int>(std::distance(b, e)) == size(),
47 "Sizes don't match in permutation");
48 Ints ret(std::distance(b, e));
49 for (
unsigned int i = 0; i < ret.size(); ++i) {
50 ret[operator[](i)] = b[i];
53 "In and out don't match: " <<
Assignment(b, e) <<
" vs "
54 << get_subset_ordered(ret));
58 Assignment get_subset_ordered(It b, It e)
const {
59 IMP_CHECK_VARIABLE(e);
60 IMP_USAGE_CHECK(static_cast<unsigned int>(std::distance(b, e)) == size(),
61 "Sizes don't match in permutation");
63 for (
unsigned int i = 0; i < size(); ++i) {
64 ret.set_item(i, b[
operator[](i)]);
69 return get_list_ordered(a.begin(), a.end());
72 return get_subset_ordered(a.begin(), a.end());
79 IMPDOMINO_END_NAMESPACE
Store a list of ParticleIndexes.
Store an array of values of the same type.
A Bayesian inference-based sampler.
Store a persistent ordering for a subset based on the list.
Represent a subset of the particles being optimized.
Various general useful macros for IMP.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Various important macros for implementing decorators.
A Bayesian inference-based sampler.
Store a configuration of a subset.
Base class for a simple primitive-like type.
Store an array of values of the same type.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.