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"
22 IMPCORE_BEGIN_NAMESPACE
31 std::string name =
"ConstTripletPredicate%1%");
53 "UnorderedTypeTripletPredicate%1%");
56 return internal::get_type_hash(m, pi);
73 mutable int const* cached_particle_type_ids_table_;
74 mutable int cached_n_particle_types_;
77 "OrderedTypeTripletPredicate%1%");
83 return internal::get_ordered_type_hash(types);
88 return internal::get_ordered_type_hash(m, pi);
95 cached_particle_type_ids_table_=
96 m->IMP::internal::IntAttributeTable::access_attribute_data(Typed::get_type_key());
97 cached_n_particle_types_= ParticleType::get_number_unique();
106 return internal::get_ordered_type_hash( pi,
107 cached_particle_type_ids_table_,
108 cached_n_particle_types_);
127 return internal::get_all_same(m, pi);
140 mutable boost::uniform_real<double> rng_;
144 "CoinFlipTripletPredicate%1%");
160 IMPCORE_END_NAMESPACE
#define IMP_TRIPLET_PREDICATE_METHODS(Name)
Define extra the functions needed for a TripletPredicate.
virtual ModelObjectsTemp do_get_inputs(Model *, const ParticleIndexes &) const
Overload this method to specify the inputs.
virtual int get_value_index(Model *, const ParticleIndexTriplet &) const
Compute the predicate and the derivative if needed.
virtual ModelObjectsTemp do_get_inputs(Model *, const ParticleIndexes &) const
Overload this method to specify the inputs.
A class to store an fixed array of same-typed values.
Macros for various classes.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
virtual void setup_for_get_value_index_in_batch(Model *m) const
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const
Overload this method to specify the inputs.
ParticlesTemp get_particles(Model *m, const ParticleIndexes &ps)
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.
Abstract predicate function.
int get_value(const core::ParticleTypes &types)
Compute the predicate for specified types.
#define IMP_UNUSED(variable)
virtual int get_value_index(Model *, const ParticleIndexTriplet &) const
Compute the predicate and the derivative if needed.
virtual ModelObjectsTemp do_get_inputs(Model *m, const ParticleIndexes &pis) const
Overload this method to specify the inputs.
virtual int get_value_index(Model *m, const ParticleIndexTriplet &pi) const
Compute the predicate and the derivative if needed.
virtual int get_value_index(Model *m, const ParticleIndexTriplet &pi) const
Compute the predicate for types of specific pi.
virtual int get_value(const ParticleTriplet &vt) const
virtual int get_value_index(Model *m, const ParticleIndexTriplet &pi) const
Compute the predicate and the derivative if needed.
virtual int get_value_index_in_batch(Model *m, const ParticleIndexTriplet &pi) const
virtual ModelObjectsTemp do_get_inputs(Model *, const ParticleIndexes &) const
Overload this method to specify the inputs.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
RandomNumberGenerator random_number_generator
A shared non-GPU random number generator.