13 #ifndef IMPCONTAINER_PREDICATE_SINGLETONS_RESTRAINT_H
14 #define IMPCONTAINER_PREDICATE_SINGLETONS_RESTRAINT_H
16 #include <IMP/container/container_config.h>
18 #include <IMP/kernel/internal/InternalDynamicListSingletonContainer.h>
26 IMPCONTAINER_BEGIN_NAMESPACE
40 typedef IMP::kernel::internal::InternalDynamicListSingletonContainer List;
45 mutable int input_version_;
46 bool error_on_unknown_;
47 void update_lists_if_necessary()
const;
52 SingletonContainerAdaptor input,
54 "PredicateSingletonsRestraint %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;
85 set_score<SingletonScore>(predicate_value, score);
88 set_unknown_score<SingletonScore>(score);
100 return containers_.find(predicate_value)->second->get_indexes();
111 Restraints do_create_current_decomposition() const;
114 IMPCONTAINER_END_NAMESPACE
void set_score(int predicate_value, Score *score)
Various important functionality for implementing decorators.
void set_unknown_score(Score *score)
A smart pointer to a ref-counted Object that is a class memeber.
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)
Import IMP/kernel/SingletonPredicate.h in the namespace.
virtual double get_last_score() const
Class for adding up scores during ScoringFunction evaluation.
A restraint is a term in an IMP ScoringFunction.
void set_is_complete(bool tf)
Applies a SingletonScore to each Singleton in a list based on a predicate.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Abstract predicate function.
virtual ModelObjectsTemp do_get_inputs() const =0
ParticleIndexes 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.