IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
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
15IMPGSL_BEGIN_NAMESPACE
16
17//! A conjugate gradients optimizer taken from GSL
18/** \see IMP::core::ConjugateGradients
19 */
20class IMPGSLEXPORT ConjugateGradients : public GSLOptimizer {
21 double initial_step_, line_step_, min_gradient_;
22
23 public:
24 //!
25 ConjugateGradients(Model *m);
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;
30 IMP_OBJECT_METHODS(ConjugateGradients);
31};
32
33IMPGSL_END_NAMESPACE
34
35#endif /* IMPGSL_CONJUGATE_GRADIENTS_H */
A base class for GSL-based optimizers.
Class for storing model, its restraints, constraints, and particles.
Definition Model.h:111
void set_threshold(double mg)
Set the gradient threshold.
virtual Float do_optimize(unsigned int max_steps) override
override this function to do actual optimization
double Float
Basic floating-point value (could be float, double...).
Definition types.h:19
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.