8 #ifndef IMPKERNEL_OPTIMIZER_H
9 #define IMPKERNEL_OPTIMIZER_H
11 #include <IMP/kernel_config.h>
12 #include "base_types.h"
24 IMPKERNEL_BEGIN_NAMESPACE
49 bool stop_on_good_score_;
57 void set_is_optimizing_states(
bool tf)
const;
61 return get_optimizer_state_inputs();
79 double optimize(
unsigned int max_steps);
84 bool get_stop_on_good_score()
const {
return stop_on_good_score_; }
90 if (scoring_function_) {
91 return scoring_function_;
97 IMP_HELPER_MACRO_PUSH_WARNINGS
98 #if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)
99 IMP_GCC_PRAGMA(diagnostic ignored
"-Wdeprecated-declarations")
101 return cache_ = get_model()->create_model_scoring_function();
102 IMP_HELPER_MACRO_POP_WARNINGS
115 set_optimizer_state_optimizer(obj,
this);
117 { Optimizer::set_optimizer_state_optimizer(obj,
nullptr); });
123 virtual void set_scoring_function(ScoringFunctionAdaptor sf);
130 virtual double do_optimize(
unsigned int ns) = 0;
134 void update_states()
const;
139 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.
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.
#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.