IMP logo
IMP Reference Guide  2.20.0
The Integrative Modeling Platform
gsl/ConjugateGradients.h
Go to the documentation of this file.
1 /**
2  * \file IMP/gsl/ConjugateGradients.h
3  * \brief A conjugate gradients optimizer from GSL
4  *
5  * Copyright 2007-2022 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPGSL_CONJUGATE_GRADIENTS_H
9 #define IMPGSL_CONJUGATE_GRADIENTS_H
10 
11 #include <IMP/gsl/gsl_config.h>
12 
13 #include "GSLOptimizer.h"
14 
15 IMPGSL_BEGIN_NAMESPACE
16 
17 //! A conjugate gradients optimizer taken from GSL
18 /** \see IMP::core::ConjugateGradients
19  */
20 class IMPGSLEXPORT ConjugateGradients : public GSLOptimizer {
21  double initial_step_, line_step_, min_gradient_;
22 
23  public:
24  //!
26 
27  //! Set the gradient threshold
28  void set_threshold(double mg) { min_gradient_ = mg; }
29  virtual Float do_optimize(unsigned int max_steps) override;
31 };
32 
33 IMPGSL_END_NAMESPACE
34 
35 #endif /* IMPGSL_CONJUGATE_GRADIENTS_H */
A base class for GSL-based optimizers.
Definition: GSLOptimizer.h:22
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
A conjugate gradients optimizer taken from GSL.
Class for storing model, its restraints, constraints, and particles.
Definition: Model.h:86
virtual double do_optimize(unsigned int ns)=0
override this function to do actual optimization
void set_threshold(double mg)
Set the gradient threshold.
double Float
Basic floating-point value (could be float, double...)
Definition: types.h:19
A base class for GSL-based optimizers.