BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SimAnMinimizer.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Fit/Adapter/SimAnMinimizer.h
6 //! @brief Declares class SimAnMinimizer.
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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_FIT_ADAPTER_SIMANMINIMIZER_H
21 #define BORNAGAIN_FIT_ADAPTER_SIMANMINIMIZER_H
22 
24 
25 namespace ROOT::Math {
26 class GSLSimAnMinimizer;
27 }
28 
29 //! Wrapper for the CERN ROOT facade of the GSL simmulated annealing minimizer.
30 //! @ingroup fitting_internal
31 
33 public:
35  ~SimAnMinimizer() override;
36 
37  //! Sets minimizer internal print level.
38  //! Default value is 0 (silent).
39  void setPrintLevel(int value);
40  int printLevel() const;
41 
42  //! Sets maximum number of iterations to try at each step.
43  void setMaxIterations(int value);
44  int maxIterations() const;
45 
46  //! Sets number of iterations at each temperature.
47  void setIterationsAtEachTemp(int value);
48  int iterationsAtEachTemp() const;
49 
50  //! Sets max step size used in random walk.
51  void setStepSize(double value);
52  double stepSize() const;
53 
54  //! Sets Boltzmann distribution parameter: k.
55  void setBoltzmannK(double value);
56  double boltzmannK() const;
57 
58  //! Sets Boltzmann distribution parameter: initial temperature.
59  void setBoltzmannInitialTemp(double value);
60  double boltzmannInitialTemp() const;
61 
62  //! Sets Boltzmann distribution parameter: mu.
63  void setBoltzmannMu(double value);
64  double boltzmannMu() const;
65 
66  //! Sets Boltzmann distribution parameter: minimal temperature.
67  void setBoltzmannMinTemp(double value);
68  double boltzmannMinTemp() const;
69 
70  std::map<std::string, std::string> statusMap() const override;
71 
72 protected:
73  void propagateOptions() override;
74  const root_minimizer_t* rootMinimizer() const override;
75 
76 private:
77  std::unique_ptr<ROOT::Math::GSLSimAnMinimizer> m_siman_minimizer;
78 };
79 
80 #endif // BORNAGAIN_FIT_ADAPTER_SIMANMINIMIZER_H
81 #endif // USER_API
Declares class MinimizerAdapter.
Abstract base class that adapts the CERN ROOT minimizer to our IMinimizer.
ROOT::Math::Minimizer root_minimizer_t
Wrapper for the CERN ROOT facade of the GSL simmulated annealing minimizer.
std::map< std::string, std::string > statusMap() const override
Returns map of string representing different minimizer statuses.
void setIterationsAtEachTemp(int value)
Sets number of iterations at each temperature.
void setPrintLevel(int value)
Sets minimizer internal print level.
int iterationsAtEachTemp() const
double boltzmannMinTemp() const
int maxIterations() const
void setBoltzmannMu(double value)
Sets Boltzmann distribution parameter: mu.
double stepSize() const
void setBoltzmannK(double value)
Sets Boltzmann distribution parameter: k.
void propagateOptions() override
int printLevel() const
~SimAnMinimizer() override
std::unique_ptr< ROOT::Math::GSLSimAnMinimizer > m_siman_minimizer
void setStepSize(double value)
Sets max step size used in random walk.
void setBoltzmannMinTemp(double value)
Sets Boltzmann distribution parameter: minimal temperature.
double boltzmannK() const
void setMaxIterations(int value)
Sets maximum number of iterations to try at each step.
const root_minimizer_t * rootMinimizer() const override
double boltzmannInitialTemp() const
void setBoltzmannInitialTemp(double value)
Sets Boltzmann distribution parameter: initial temperature.
double boltzmannMu() const