9#ifndef IMPCORE_CONJUGATE_GRADIENTS_H
10#define IMPCORE_CONJUGATE_GRADIENTS_H
12#include <IMP/core/core_config.h>
15#include <cereal/access.hpp>
16#include <cereal/types/base_class.hpp>
18IMPCORE_BEGIN_NAMESPACE
33class IMPCOREEXPORT ConjugateGradients :
public AttributeOptimizer {
35 ConjugateGradients(Model *m,
36 std::string name =
"ConjugateGradients%1%");
37 ConjugateGradients() {}
64 NT &f, NT &dg, NT &dg1,
int max_steps,
70 friend class cereal::access;
72 template<
class Archive>
void serialize(Archive &ar) {
73 ar(cereal::base_class<AttributeOptimizer>(
this), threshold_, max_change_);
Base class for optimizers that act on individual attributes.
A more IMP-like version of the std::vector.
virtual Float do_optimize(unsigned int max_steps) override
override this function to do actual optimization
void set_gradient_threshold(Float t)
Set the threshold for the minimum gradient.
void set_max_change(Float t)
Limit how far anything can change each time step.
Float get_gradient_threshold() const
Get the threshold for the minimum gradient.
Float get_max_change() const
Get the limit on how far anything can change each time step.
double Float
Basic floating-point value (could be float, double...).
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.