9 #ifndef IMPKERNEL_ATTRIBUTE_OPTIMIZER_H
10 #define IMPKERNEL_ATTRIBUTE_OPTIMIZER_H
12 #include <IMP/kernel/kernel_config.h>
15 IMPKERNEL_BEGIN_NAMESPACE
27 IMPKERNEL_DEPRECATED_METHOD_DECL(2.1)
42 return get_model()->get_optimized_attributes();
45 get_model()->set_attribute(fi.get_key(), fi.get_particle(), v);
49 return get_model()->get_attribute(fi.get_key(), fi.get_particle());
53 return get_model()->get_derivative(fi.get_key(), fi.get_particle());
59 if (widths_.size() <= k.get_index() || widths_[k.get_index()] == 0) {
61 double wid =
static_cast<double>(w.second) - w.first;
62 widths_.resize(std::max(widths_.size(), size_t(k.get_index() + 1)), 0.0);
65 widths_[k.get_index()] = wid;
67 widths_[k.get_index()] = 1.0;
70 return widths_[k.get_index()];
107 IMPKERNEL_END_NAMESPACE
double get_scaled_value(FloatIndex fi) const
Float get_value(FloatIndex fi) const
FloatIndexes get_optimized_attributes() const
void set_scaled_value(FloatIndex fi, Float v) const
std::pair< Float, Float > FloatRange
A pair representing the allowed range for a Float attribute.
void set_value(FloatIndex fi, double v) const
Float get_derivative(FloatIndex fi) const
Base class for all optimizers.
void clear_range_cache()
Clear the cache of range information. Do this at the start of.
Base class for all optimizers.
Base class for optimizers that act on individual attributes.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing sets of objects.
double get_scaled_derivative(FloatIndex fi) const
double get_width(FloatKey k) const
double Float
Basic floating-point value (could be float, double...)
Class for storing model, its restraints, constraints, and particles.