BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
GSLMultiMinimizer.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Fit/RootAdapter/GSLMultiMinimizer.h
6 //! @brief Declares class GSLMultiMinimizer.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************** //
14 
15 #ifndef BORNAGAIN_FIT_ROOTADAPTER_GSLMULTIMINIMIZER_H
16 #define BORNAGAIN_FIT_ROOTADAPTER_GSLMULTIMINIMIZER_H
17 
19 
20 namespace ROOT
21 {
22 namespace Math
23 {
24 class GSLMinimizer;
25 }
26 } // namespace ROOT
27 
28 //! Wrapper for the CERN ROOT facade of the GSL multi minimizer family (gradient descent based).
29 //! @ingroup fitting_internal
30 
32 {
33 public:
34  explicit GSLMultiMinimizer(const std::string& algorithmName = "ConjugateFR");
36 
37  //! Sets minimizer internal print level.
38  void setPrintLevel(int value);
39  int printLevel() const;
40 
41  //! Sets maximum number of iterations. This is an internal minimizer setting which has
42  //! no direct relation to the number of objective function calls (e.g. numberOfIteraction=5
43  //! might correspond to ~100 objective function calls).
44  void setMaxIterations(int value);
45  int maxIterations() const;
46 
47  std::string statusToString() const override;
48 
49 protected:
50  void propagateOptions() override;
51  const root_minimizer_t* rootMinimizer() const override;
52 
53 private:
54  std::unique_ptr<ROOT::Math::GSLMinimizer> m_gsl_minimizer;
55 };
56 
57 #endif // BORNAGAIN_FIT_ROOTADAPTER_GSLMULTIMINIMIZER_H
Declares class RootMinimizerAdapter.
Wrapper for the CERN ROOT facade of the GSL multi minimizer family (gradient descent based).
const root_minimizer_t * rootMinimizer() const override
void propagateOptions() override
std::unique_ptr< ROOT::Math::GSLMinimizer > m_gsl_minimizer
std::string statusToString() const override
Returns string representation of current minimizer status.
void setMaxIterations(int value)
Sets maximum number of iterations.
GSLMultiMinimizer(const std::string &algorithmName="ConjugateFR")
void setPrintLevel(int value)
Sets minimizer internal print level.
Pure virtual interface that adapts the CERN ROOT minimizer to our IMinimizer.
ROOT::Math::Minimizer root_minimizer_t
std::string algorithmName() const override final
Returns name of the minimization algorithm.