9 #ifndef IMPKERNEL_SCORING_FUNCTION_H
10 #define IMPKERNEL_SCORING_FUNCTION_H
12 #include <IMP/kernel_config.h>
17 #include "internal/moved_particles_cache.h"
23 IMPKERNEL_BEGIN_NAMESPACE
45 internal::MovedParticlesScoreStateCache moved_particles_cache_;
47 unsigned moved_particles_cache_age_;
55 typedef std::pair<double, bool> ScoreIsGoodPair;
73 do_add_score_and_derivatives(sa, ss);
79 ScoreAccumulator get_score_accumulator_if_good(
bool deriv) {
80 return ScoreAccumulator(&es_, 1.0, deriv,
NO_MAX,
NO_MAX,
true);
82 ScoreAccumulator get_score_accumulator(
bool deriv) {
83 return ScoreAccumulator(&es_, 1.0, deriv,
NO_MAX,
NO_MAX,
false);
87 ScoringFunction(Model *m, std::string name);
93 double evaluate_if_good(
bool derivatives);
101 double evaluate(
bool derivatives);
115 double evaluate_moved(
bool derivatives,
const ParticleIndexes &moved_pis,
118 double evaluate_moved_if_below(
122 double evaluate_moved_if_good(
126 double evaluate_if_below(
bool derivatives,
double max);
150 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
176 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
191 std::ostream &out = std::cout);
193 IMPKERNEL_END_NAMESPACE
IMP::Vector< IMP::Pointer< ScoringFunction > > ScoringFunctions
const double NO_MAX
Use this value when you want to turn off maximum for restraint evaluation.
virtual ModelObjectsTemp do_get_outputs() const
virtual void do_add_score_and_derivatives_moved(ScoreAccumulator sa, const ParticleIndexes &moved_pis, const ParticleIndexes &reset_pis, const ScoreStatesTemp &ss)
Score when only some particles have moved.
A more IMP-like version of the std::vector.
ScoringFunctions create_decomposition(ScoringFunction *sf)
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Base class for objects in a Model that depend on other objects.
#define IMP_UNUSED(variable)
A smart pointer to a ref-counted Object that is a class member.
Class for adding up scores during ScoringFunction evaluation.
double get_last_score() const
returns the score that was calculated in the last evaluate call
Base class for objects in a Model that depend on other objects.
A nullptr-initialized pointer to an IMP Object.
Represents a scoring function on the model.
void show_restraint_hierarchy(ScoringFunctionAdaptor rs, std::ostream &out=std::cout)
Print the hierarchy of restraints.
Restraints create_restraints(RMF::FileConstHandle fh, Model *m)
Abstract base class for all restraints.
Build dependency graphs on models.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
bool get_had_good_score() const
A restraint is a term in an IMP ScoringFunction.