12 #ifndef IMPCORE_TRIPLET_PREDICATES_H
13 #define IMPCORE_TRIPLET_PREDICATES_H
15 #include <IMP/core/core_config.h>
19 #include <boost/random.hpp>
20 #include "internal/container_helpers.h"
21 #include <cereal/access.hpp>
22 #include <cereal/types/base_class.hpp>
24 IMPCORE_BEGIN_NAMESPACE
31 friend class cereal::access;
32 template<
class Archive>
void serialize(Archive &ar) {
33 ar(cereal::base_class<TripletPredicate>(
this), v_);
39 std::string name =
"ConstTripletPredicate%1%");
62 friend class cereal::access;
63 template<
class Archive>
void serialize(Archive &ar) {
64 ar(cereal::base_class<TripletPredicate>(
this));
70 "UnorderedTypeTripletPredicate%1%");
73 return internal::get_type_hash(m, pi);
90 mutable int const* cached_particle_type_ids_table_;
91 mutable int cached_n_particle_types_;
94 "OrderedTypeTripletPredicate%1%");
97 return internal::get_ordered_type_hash(types);
102 return internal::get_ordered_type_hash(m, pi);
109 cached_particle_type_ids_table_=
110 m->IMP::internal::IntAttributeTable::access_attribute_data(Typed::get_type_key());
111 cached_n_particle_types_= ParticleType::get_number_unique();
120 return internal::get_ordered_type_hash( pi,
121 cached_particle_type_ids_table_,
122 cached_n_particle_types_);
137 friend class cereal::access;
138 template<
class Archive>
void serialize(Archive &ar) {
139 ar(cereal::base_class<TripletPredicate>(
this));
147 return internal::get_all_same(m, pi);
160 mutable boost::uniform_real<double> rng_;
164 "CoinFlipTripletPredicate%1%");
180 IMPCORE_END_NAMESPACE
#define IMP_TRIPLET_PREDICATE_METHODS(Name)
Define extra the functions needed for a TripletPredicate.
virtual void setup_for_get_value_index_in_batch(Model *m) const override
virtual ModelObjectsTemp do_get_inputs(Model *, const ParticleIndexes &) const override
Overload this method to specify the inputs.
A class to store a fixed array of same-typed values.
Macros for various classes.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
virtual int get_value_index(Model *m, const ParticleIndexTriplet &pi) const override
Compute the predicate and the derivative if needed.
ParticlesTemp get_particles(Model *m, const ParticleIndexes &ps)
Get the particles from a list of indexes.
virtual int get_value_index(Model *m, const ParticleIndexTriplet &pi) const override
Compute the predicate for types of specific pi.
A more IMP-like version of the std::vector.
A particle with a user-defined type.
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Class for storing model, its restraints, constraints, and particles.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the inputs.
virtual int get_value_index_in_batch(Model *m, const ParticleIndexTriplet &pi) const override
Abstract predicate function.
int get_value(const core::ParticleTypes &types)
Compute the predicate for specified types.
virtual int get_value_index(Model *m, const ParticleIndexTriplet &pi) const override
Compute the predicate and the derivative if needed.
#define IMP_UNUSED(variable)
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const override
Overload this method to specify the inputs.
#define IMP_OBJECT_SERIALIZE_DECL(Name)
Declare methods needed for serialization of Object pointers.
virtual int get_value_index(Model *, const ParticleIndexTriplet &) const override
Compute the predicate and the derivative if needed.
virtual ModelObjectsTemp do_get_inputs(Model *, const ParticleIndexes &) const override
Overload this method to specify the inputs.
virtual ModelObjectsTemp do_get_inputs(Model *, const ParticleIndexes &) const override
Overload this method to specify the inputs.
virtual int get_value_index(Model *, const ParticleIndexTriplet &) const override
Compute the predicate and the derivative if needed.
RandomNumberGenerator random_number_generator
A shared non-GPU random number generator.