9 #ifndef IMPKERNEL_SCORE_ACCUMULATOR_H
10 #define IMPKERNEL_SCORE_ACCUMULATOR_H
12 #include <IMP/kernel_config.h>
23 IMPKERNEL_BEGIN_NAMESPACE
31 EvaluationState(
double oscore,
bool ogood) : score(oscore), good(ogood) {}
55 double global_max,
double local_max,
bool abort_on_bad)
58 global_max_(global_max),
59 local_max_(local_max),
61 abort_on_bad_(abort_on_bad) {}
74 local_max_ = std::min(local_max, o.local_max_);
80 double wscore = weight_.get_weight() * score;
82 score_->score += wscore;
83 if (score > local_max_) {
95 if (global_max_ ==
NO_MAX && !abort_on_bad_)
return false;
104 double score = score_->score;
105 return score > global_max_;
123 double get_maximum()
const {
return std::min(global_max_, local_max_); }
138 IMPKERNEL_END_NAMESPACE
Helper functions to check for NaN or infinity.
const double NO_MAX
Use this value when you want to turn off maximum for restraint evaluation.
bool get_is_evaluate_if_below() const
#define IMP_SHOWABLE_INLINE(Name, how_to_show)
Declare the methods needed by an object that can be printed.
bool get_is_evaluate_if_good() const
Various useful constants.
Class for adding derivatives from restraints to the model.
void add_score(double score)
ScoreAccumulator(ScoreAccumulator o, double weight, double local_max)
#define IMP_LOG_VERBOSE(expr)
Macros to help in defining tuple classes.
Exception definitions and assertions.
A more IMP-like version of the std::vector.
Base class for a simple primitive-like type.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Logging and error reporting support.
Class for adding up scores during ScoringFunction evaluation.
Represents a scoring function on the model.
double get_maximum() const
Macros to help in implementing Value objects.
#define IMP_OMP_PRAGMA(x)
bool get_abort_evaluation() const
Return if the score already exceeds the maximum.
Macros to help with objects that can be printed to a stream.
Class for adding derivatives from restraints to the model.
A restraint is a term in an IMP ScoringFunction.