9 #ifndef IMPKERNEL_SCORE_ACCUMULATOR_H
10 #define IMPKERNEL_SCORE_ACCUMULATOR_H
12 #include <IMP/kernel/kernel_config.h>
24 IMPKERNEL_BEGIN_NAMESPACE
32 EvaluationState(
double oscore,
bool ogood) : score(oscore), good(ogood) {}
56 double global_max,
double local_max,
bool abort_on_bad)
59 global_max_(global_max),
60 local_max_(local_max),
62 abort_on_bad_(abort_on_bad) {}
75 local_max_ = std::min(local_max, o.local_max_);
81 double wscore = weight_.get_weight() * score;
83 score_->score += wscore;
84 if (score > local_max_) {
96 if (global_max_ ==
NO_MAX && !abort_on_bad_)
return false;
105 double score = score_->score;
106 return score > global_max_;
124 double get_maximum()
const {
return std::min(global_max_, local_max_); }
139 IMPKERNEL_END_NAMESPACE
Declare an efficient stl-compatible map.
Class for adding derivatives from restraints to the model.
const double NO_MAX
Use this value when you want to turn off maximum for restraint evaluation.
bool get_is_evaluate_if_good() const
bool get_is_evaluate_if_below() const
Class for adding derivatives from restraints to the model.
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
IMP::kernel::DerivativeAccumulator DerivativeAccumulator
IMP::kernel::EvaluationState EvaluationState
double get_maximum() const
void add_score(double score)
Base for a simple primitive-like type.
#define IMP_LOG_VERBOSE(expr)
Various general useful macros for IMP.
Exception definitions and assertions.
Represents a scoring function on the model.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Provide a nullptr keyword analog.
IMP::kernel::ScoreAccumulator ScoreAccumulator
Logging and error reporting support.
Class for adding up scores during ScoringFunction evaluation.
A restraint is a term in an IMP ScoringFunction.
bool get_abort_evaluation() const
Return if the score already exceeds the maximum.
ScoreAccumulator(ScoreAccumulator o, double weight, double local_max)
Various general useful macros for IMP.
IMP::kernel::Restraint Restraint
Various useful constants.
#define IMP_OMP_PRAGMA(x)
const std::nullptr_t nullptr
Various general useful macros for IMP.