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>
18 IMPCORE_BEGIN_NAMESPACE
39 std::string name =
"ConjugateGradients%1%");
46 IMPCORE_DEPRECATED_METHOD_DECL(2.19)
47 void set_threshold(
Float t) {
48 IMPCORE_DEPRECATED_METHOD_DEF(2.19,
"Use set_gradient_threshold().");
49 set_gradient_threshold(t);
69 NT &f, NT &dg, NT &dg1,
int max_steps,
75 friend class cereal::access;
77 template<
class Archive>
void serialize(Archive &ar) {
78 ar(cereal::base_class<AttributeOptimizer>(
this), threshold_, max_change_);
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Simple conjugate gradients optimizer.
Class for storing model, its restraints, constraints, and particles.
virtual double do_optimize(unsigned int ns)=0
override this function to do actual optimization
Base class for optimizers that act on individual attributes.
double Float
Basic floating-point value (could be float, double...)
Base class for optimizers that act on individual attributes.
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.