13 #ifndef IMPCONTAINER_PREDICATE_PAIRS_RESTRAINT_H
14 #define IMPCONTAINER_PREDICATE_PAIRS_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, ParticleIndexPairs> t_lists_map;
52 typedef tsl::robin_map<int, PointerMember<PairScore> > t_score_map;
53 #elif IMP_CONTAINER_HAS_GOOGLE_DENSE_HASH_MAP==1
54 typedef google::dense_hash_map<int, ParticleIndexPairs> t_lists_map;
55 typedef google::dense_hash_map<int, PointerMember<PairScore> > t_score_map;
57 typedef IMP_KERNEL_LARGE_UNORDERED_MAP<int, ParticleIndexPairs> t_lists_map;
58 typedef IMP_KERNEL_LARGE_UNORDERED_MAP<int, PointerMember<PairScore> > 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 "PredicatePairsRestraint %1%");
79 void set_score(
int predicate_value,
PairScore *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 PredicatePairsRestraint::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
Abstract class for scoring object(s) of type ParticleIndexPair.
void set_is_complete(bool tf)
Various important functionality for implementing decorators.
void set_is_get_inputs_ignores_individual_scores(bool is_ignore)
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Applies a PairScore to each Pair in a list based on a predicate.
Macros to choose the best set or map for different purposes.
virtual Restraints do_create_current_decomposition() const
A smart pointer to a ref-counted Object that is a class member.
Class for adding up scores during ScoringFunction evaluation.
Abstract predicate function.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
ParticleIndexPairs get_indexes(int predicate_value) const
virtual ModelObjectsTemp do_get_inputs() const =0
A restraint is a term in an IMP ScoringFunction.