8 #ifndef IMPKERNEL_OPTIMIZER_H
9 #define IMPKERNEL_OPTIMIZER_H
11 #include <IMP/kernel_config.h>
24 IMPKERNEL_BEGIN_NAMESPACE
49 bool stop_on_good_score_;
56 void set_is_optimizing_states(
bool tf)
const;
60 return get_optimizer_state_inputs();
78 double optimize(
unsigned int max_steps);
83 bool get_stop_on_good_score()
const {
return stop_on_good_score_; }
85 double get_last_score()
const {
return scoring_function_->get_last_score(); }
91 if (scoring_function_) {
92 return scoring_function_;
95 "Use Optimizer::set_scoring_function() to set one.",
109 set_optimizer_state_optimizer(obj,
this);
111 { Optimizer::set_optimizer_state_optimizer(obj,
nullptr); });
115 virtual void set_scoring_function(ScoringFunctionAdaptor sf);
122 virtual double do_optimize(
unsigned int ns) = 0;
126 void update_states()
const;
131 IMPKERNEL_END_NAMESPACE
virtual ModelObjectsTemp do_get_outputs() const
don't return anything here to avoid pointless dependencies
Storage of a model, its restraints, constraints and particles.
virtual ModelObjectsTemp do_get_inputs() const
A smart pointer to a reference counted object.
IMP::Vector< IMP::WeakPointer< ModelObject > > ModelObjectsTemp
Class for storing model, its restraints, constraints, and particles.
Base class for all optimizers.
A class for storing lists of IMP items.
For backwards compatibility.
Single variable function.
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
#define IMP_THROW(message, exception_name)
Throw an exception with a message.
A nullptr-initialized pointer to an IMP Object.
Represents a scoring function on the model.
A shared base class to help in debugging and things.
Shared optimizer state that is invoked upon commitment of new coordinates.
#define IMP_REF_COUNTED_NONTRIVIAL_DESTRUCTOR(Name)
void set_stop_on_good_score(bool tf)
double get_last_score() const
Return the score found in the last evaluate.
An exception for an invalid value being passed to IMP.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
ScoringFunction * get_scoring_function() const
Return the scoring function that is being used.