BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
TestMinimizer.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Fit/Minimizer/TestMinimizer.h
6 //! @brief Defines class TestMinimizer.
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_MINIMIZER_TESTMINIMIZER_H
21 #define BORNAGAIN_FIT_MINIMIZER_TESTMINIMIZER_H
22 
24 
25 //! A trivial minimizer that calls the objective function once. Used to test the whole chain.
26 
27 class TestMinimizer : public IMinimizer {
28 public:
30  ~TestMinimizer() override;
31 
32  std::string minimizerName() const final;
33  std::string algorithmName() const final { return ""; }
34 
36  mumufit::Parameters parameters) override;
37 
38 private:
39  std::vector<double> m_parameter_values;
41 };
42 
43 #endif // BORNAGAIN_FIT_MINIMIZER_TESTMINIMIZER_H
44 #endif // USER_API
Defines interface IMinimizer.
std::function< double(const std::vector< double > &)> scalar_function_t
Definition: Types.h:30
std::function< double(const mumufit::Parameters &)> fcn_scalar_t
Definition: Types.h:39
Abstract base class for all kind minimizers.
Definition: IMinimizer.h:30
A trivial minimizer that calls the objective function once. Used to test the whole chain.
Definition: TestMinimizer.h:27
std::vector< double > m_parameter_values
Definition: TestMinimizer.h:39
scalar_function_t m_fcn
Definition: TestMinimizer.h:40
std::string minimizerName() const final
return name of the minimizer
~TestMinimizer() override
mumufit::MinimizerResult minimize_scalar(fcn_scalar_t fcn, mumufit::Parameters parameters) override
run minimization
std::string algorithmName() const final
return name of the minimization algorithm
Definition: TestMinimizer.h:33
Result of minimization round.
A collection of fit parameters.
Definition: Parameters.h:26
Definition: filesystem.h:81