13 #ifndef IMPCONTAINER_PREDICATE_PAIRS_RESTRAINT_H
14 #define IMPCONTAINER_PREDICATE_PAIRS_RESTRAINT_H
16 #include <IMP/container/container_config.h>
18 #include <IMP/internal/InternalDynamicListPairContainer.h>
19 #include <IMP/compatibility/map.h>
26 IMPCONTAINER_BEGIN_NAMESPACE
42 typedef IMP::kernel::internal::InternalDynamicListPairContainer List;
43 typedef compatibility::map<unsigned int, base::Pointer<List> >
48 mutable bool updated_;
49 bool error_on_unknown_;
50 void update_lists_if_necessary()
const;
51 bool assign_pair(
const ParticleIndexPair& index)
const;
54 PairContainerAdaptor input,
55 std::string name=
"PredicatePairsRestraint %1%");
62 template <
class Score>
65 "You must add this restraint to the model"
66 <<
" first, sorry, this can be fixed.");
68 score->get_name()+
" input"));
70 restraints_.back()->set_model(get_model());
71 restraints_.back()->set_was_used(
true);
72 containers_[predicate_value]=c;
77 template <
class Score>
82 "You must add this restraint to the model"
83 <<
" first, sorry, this can be fixed.");
85 score->get_name()+
" input"));
87 restraints_.back()->set_model(get_model());
91 void set_score(
int predicate_value,
PairScore *score) {
92 set_score<PairScore>(predicate_value, score);
94 void set_unknown_score(
PairScore *score) {
95 set_unknown_score<PairScore>(score);
102 error_on_unknown_=tf;
109 return containers_.find(predicate_value)->second
119 Restraints do_create_current_decomposition() const;
122 IMPCONTAINER_END_NAMESPACE