13 #ifndef IMPCONTAINER_PREDICATE_PAIRS_RESTRAINT_H
14 #define IMPCONTAINER_PREDICATE_PAIRS_RESTRAINT_H
16 #include <IMP/container/container_config.h>
18 #include <IMP/kernel/internal/InternalDynamicListPairContainer.h>
26 IMPCONTAINER_BEGIN_NAMESPACE
40 typedef IMP::kernel::internal::InternalDynamicListPairContainer List;
45 mutable int input_version_;
46 bool error_on_unknown_;
47 void update_lists_if_necessary()
const;
48 bool assign_pair(
const ParticleIndexPair& index)
const;
52 PairContainerAdaptor input,
54 "PredicatePairsRestraint %1%");
61 template <
class Score>
void set_score(
int predicate_value, Score *score) {
63 "You must add this restraint to the model"
64 <<
" first, sorry, this can be fixed.");
65 IMP_NEW(List, c, (input_, score->get_name() +
" input"));
67 restraints_.back()->set_was_used(
true);
68 containers_[predicate_value] = c;
77 "You must add this restraint to the model"
78 <<
" first, sorry, this can be fixed.");
79 IMP_NEW(List, c, (input_, score->get_name() +
" input"));
81 unknown_container_ = c;
84 void set_score(
int predicate_value,
PairScore *score) {
85 set_score<PairScore>(predicate_value, score);
87 void set_unknown_score(
PairScore *score) {
88 set_unknown_score<PairScore>(score);
100 return containers_.find(predicate_value)->second->get_indexes();
111 Restraints do_create_current_decomposition() const;
114 IMPCONTAINER_END_NAMESPACE
void set_is_complete(bool tf)
Various important functionality for implementing decorators.
A smart pointer to a ref-counted Object that is a class memeber.
void set_score(int predicate_value, Score *score)
Applies a PairScore to each Pair in a list based on a predicate.
void set_unknown_score(Score *score)
IMP::base::Vector< IMP::base::Pointer< Restraint > > Restraints
virtual void do_add_score_and_derivatives(ScoreAccumulator sa) const
#define IMP_NEW(Typename, varname, args)
Declare a ref counted pointer to a new object.
Import IMP/kernel/restraint_macros.h in the namespace.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
#define IMP_IMPLEMENT(signature)
virtual double get_last_score() const
Import IMP/kernel/PairPredicate.h in the namespace.
Class for adding up scores during ScoringFunction evaluation.
A restraint is a term in an IMP ScoringFunction.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Abstract predicate function.
virtual ModelObjectsTemp do_get_inputs() const =0
ParticleIndexPairs get_indexes(int predicate_value) const
kernel::Restraint * create_restraint(Score *s, Container *c, std::string name=std::string())
Declare an efficient stl-compatible map.