13 #ifndef IMPCONTAINER_PREDICATE_TRIPLETS_RESTRAINT_H
14 #define IMPCONTAINER_PREDICATE_TRIPLETS_RESTRAINT_H
16 #include <IMP/container/container_config.h>
21 #if IMP_CONTAINER_HAS_ROBIN_MAP==1
22 #define IMP_CONTAINER_PREDICATE_USE_ROBIN_MAP
23 #include <tsl/robin_map.h>
24 #elif IMP_CONTAINER_HAS_GOOGLE_DENSE_HASH_MAP==1
25 #define IMP_CONTAINER_PREDICATE_USE_GOOGLE_DENSE_HASH_MAP
26 #include <google/dense_hash_map>
28 #define IMP_CONTAINER_PREDICATE_USE_KERNEL_MAP
36 IMPCONTAINER_BEGIN_NAMESPACE
50 #if IMP_CONTAINER_HAS_ROBIN_MAP==1
51 typedef tsl::robin_map<int, ParticleIndexTriplets> t_lists_map;
52 typedef tsl::robin_map<int, PointerMember<TripletScore> > t_score_map;
53 #elif IMP_CONTAINER_HAS_GOOGLE_DENSE_HASH_MAP==1
54 typedef google::dense_hash_map<int, ParticleIndexTriplets> t_lists_map;
55 typedef google::dense_hash_map<int, PointerMember<TripletScore> > t_score_map;
57 typedef IMP_KERNEL_LARGE_UNORDERED_MAP<int, ParticleIndexTriplets> t_lists_map;
58 typedef IMP_KERNEL_LARGE_UNORDERED_MAP<int, PointerMember<TripletScore> > t_score_map;
60 mutable t_lists_map lists_;
63 bool is_get_inputs_ignores_individual_scores_;
64 mutable std::size_t input_version_;
66 bool error_on_unknown_;
69 void update_lists_if_necessary()
const;
75 "PredicateTripletsRestraint %1%");
79 void set_score(
int predicate_value,
TripletScore *score);
93 return lists_.find(predicate_value)->second;
106 is_get_inputs_ignores_individual_scores_= is_ignore;
122 get_score_for_predicate(
int predicate)
const;
131 PredicateTripletsRestraint::get_score_for_predicate
132 (
int predicate)
const
135 t_score_map::const_iterator it= scores_.find(predicate);
136 if(it!=scores_.end()){
140 "unknown interaction type cannot be scored when error_on_unknown is true");
141 score = unknown_score_;
148 IMPCONTAINER_END_NAMESPACE
void set_is_get_inputs_ignores_individual_scores(bool is_ignore)
Applies a TripletScore to each Triplet in a list based on a predicate.
Various important functionality for implementing decorators.
void set_is_complete(bool tf)
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Macros to choose the best set or map for different purposes.
Abstract predicate function.
virtual Restraints do_create_current_decomposition() const
ParticleIndexTriplets get_indexes(int predicate_value) const
A smart pointer to a ref-counted Object that is a class member.
Class for adding up scores during ScoringFunction evaluation.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Abstract class for scoring object(s) of type ParticleIndexTriplet.
virtual ModelObjectsTemp do_get_inputs() const =0
A restraint is a term in an IMP ScoringFunction.