9 #ifndef IMPKERNEL_RESTRAINT_H
10 #define IMPKERNEL_RESTRAINT_H
12 #include <IMP/kernel_config.h>
23 IMPKERNEL_BEGIN_NAMESPACE
24 class DerivativeAccumulator;
62 double get_score()
const;
68 double evaluate(
bool calc_derivs)
const;
87 double evaluate_moved(
bool calc_derivs,
91 double evaluate_moved_if_below(
bool calc_derivatives,
95 double evaluate_moved_if_good(
bool calc_derivatives,
99 double evaluate_if_good(
bool calc_derivatives)
const;
102 double evaluate_if_below(
bool calc_derivatives,
double max)
const;
124 virtual double unprotected_evaluate_moved(
129 return unprotected_evaluate(da);
137 return unprotected_evaluate(da);
144 return unprotected_evaluate(da);
147 virtual double unprotected_evaluate_moved_if_below(
151 return unprotected_evaluate_moved(da, moved_pis, reset_pis);
154 virtual double unprotected_evaluate_moved_if_good(
158 return unprotected_evaluate_moved(da, moved_pis, reset_pis);
198 void add_score_and_derivatives_moved(
225 Restraint *create_current_decomposition()
const;
235 void set_weight(
Float weight);
236 Float get_weight()
const {
return weight_; }
250 double get_maximum_score()
const {
return max_; }
251 void set_maximum_score(
double s);
264 double max =
NO_MAX)
const;
265 #if !defined(IMP_DOXYGEN)
266 void set_last_score(
double s)
const {
267 last_last_score_ = last_score_;
270 void set_last_last_score(
double s)
const { last_last_score_ = s; }
298 return Restraints(1, const_cast<Restraint *>(
this));
308 return do_create_decomposition();
313 virtual void do_add_score_and_derivatives_moved(
327 mutable double last_score_;
328 mutable double last_last_score_;
339 #if !defined(SWIG) && !defined(IMP_DOXYGEN)
363 IMPKERNEL_END_NAMESPACE
Control display of deprecation information.
const double NO_MAX
Use this value when you want to turn off maximum for restraint evaluation.
IMP::Vector< IMP::Pointer< Restraint > > Restraints
Class for adding scores from restraints to the model.
virtual RestraintInfo * get_static_info() const
Various useful constants.
virtual RestraintInfo * get_dynamic_info() const
Class for adding derivatives from restraints to the model.
virtual Restraints do_create_decomposition() const
ModelObjectsTemp do_get_outputs() const
#define IMP_REF_COUNTED_DESTRUCTOR(Name)
Ref counted objects should have private destructors.
A smart pointer to a reference counted object.
ScoringFunction * create_scoring_function(RestraintType *rs, double weight=1.0, double max=NO_MAX, std::string name=std::string())
Create a ScoringFunction on a single restraint.
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Class for storing model, its restraints, constraints, and particles.
Base class for objects in a Model that depend on other objects.
virtual Restraints do_create_current_decomposition() const
Provide a nullptr keyword analog.
#define IMP_UNUSED(variable)
Provide a consistent interface for things that take Restraints as arguments.
Class for adding up scores during ScoringFunction evaluation.
Restraints create_decomposition(const RestraintsTemp &rs)
Return the decomposition of a list of restraints.
Report key:value information on restraints.
Base class for objects in a Model that depend on other objects.
virtual double get_last_score() const
bool get_was_good() const
Represents a scoring function on the model.
Report key:value information on restraints.
double Float
Basic floating-point value (could be float, double...)
virtual double get_last_last_score() const
Get the unweighted score from the last-but-one time it was evaluated.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for adding derivatives from restraints to the model.
A restraint is a term in an IMP ScoringFunction.