8 #ifndef IMPKERNEL_OPTIMIZER_H
9 #define IMPKERNEL_OPTIMIZER_H
11 #include <IMP/kernel/kernel_config.h>
24 IMPKERNEL_BEGIN_NAMESPACE
48 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_;
95 return cache_ = get_model()->create_model_scoring_function();
107 set_optimizer_state_optimizer(obj,
this);
109 { Optimizer::set_optimizer_state_optimizer(obj,
nullptr); });
115 virtual void set_scoring_function(ScoringFunctionAdaptor sf);
123 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
126 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
127 void set_value(
FloatIndex fi,
double v) const;
129 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
132 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
136 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
140 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
143 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
146 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
149 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
150 double get_scaled_derivative(
FloatIndex fi) const;
152 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
153 void clear_range_cache();
156 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
159 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
162 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
163 void set_score_threshold(
double s);
165 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
166 double get_score_threshold() const;
168 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
174 virtual
double do_optimize(
unsigned int ns) = 0;
178 void update_states() const;
183 IMPKERNEL_END_NAMESPACE
void set_stop_on_good_score(bool tf)
virtual ModelObjectsTemp do_get_outputs() const
don't return anything here to avoid pointless dependencies
IMP::base::Vector< IMP::base::WeakPointer< kernel::ModelObject > > ModelObjectsTemp
A nullptr-initialized pointer to an IMP Object.
Shared optimizer state that is invoked upon commitment of new coordinates.
IMP::base::Vector< IMP::base::WeakPointer< Restraint > > RestraintsTemp
IMP::base::Vector< IMP::base::Pointer< Restraint > > Restraints
A smart pointer to a reference counted object.
IMP::kernel::Optimizer Optimizer
kernel::RestraintsTemp get_restraints(const Subset &s, const ParticleStatesTable *pst, const DependencyGraph &dg, kernel::RestraintSet *rs)
Single variable function.
virtual ModelObjectsTemp do_get_inputs() const
A class for storing lists of IMP items.
#define IMP_REF_COUNTED_NONTRIVIAL_DESTRUCTOR(Name)
Storage of a model, its restraints, constraints and particles.
Base class for all optimizers.
Classes to handle individual model particles.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
virtual void do_set_model(kernel::Model *)
For backwards compatibility.
double Float
Basic floating-point value (could be float, double...)
ScoringFunction * get_scoring_function() const
Return the scoring function that is being used.
A shared base class to help in debugging and things.
double get_last_score() const
Return the score found in the last evaluate.
IMP::kernel::FloatIndex FloatIndex
Key< 0, true > FloatKey
The type used to identify float attributes in the Particles.
Class for storing model, its restraints, constraints, and particles.
IMP::kernel::FloatIndexes FloatIndexes