| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

FuncMinimum.h
Go to the documentation of this file.
1 #ifndef ALGTOOLS_FUNCMINIMUM_H
2 #define ALGTOOLS_FUNCMINIMUM_H 1
3 // Include files
4 // from CLHEP
5 #include "CLHEP/GenericFunctions/AbsFunction.hh"
6 #include "CLHEP/GenericFunctions/Argument.hh"
7 #include "CLHEP/GenericFunctions/GenericFunctions.hh"
8 #include "CLHEP/Matrix/SymMatrix.h"
9 // from Gaudi
10 #include "GaudiAlg/GaudiTool.h"
11 // from GSL
12 #include "gsl/gsl_multimin.h"
13
14 // local
15 #include "GaudiGSL/IFuncMinimum.h"
16
24 class FuncMinimum : public extends<GaudiTool, IFuncMinimum>
25 {
26 public:
27 typedef std::vector<const GenFunc*> Gradient;
28
29 public:
34 StatusCode minimum( const GenFunc& func, Arg& arg ) const override;
35
40 StatusCode minimum( const GenFunc& func, Arg& arg, Covariance& covar ) const override;
41
43 StatusCode initialize() override;
44 StatusCode finalize() override;
45
46 ~FuncMinimum() override = default;
47
48 class FuncMinimumMisc final
49 {
50 public:
54 FuncMinimumMisc( const GenFunc& func, Arg& arg );
55
56 public:
57 inline const Arg& argument() const { return m_argum; }
58 inline Arg& argument() { return m_argum; }
59 inline const GenFunc* equation() const { return m_eq; }
60 inline const Gradient& gradient() const { return m_grad; }
61 private:
62 // default constructor is disabled
63 FuncMinimumMisc() = delete;
64 // copy constructor is disabled
65 FuncMinimumMisc( const FuncMinimumMisc& ) = delete;
66 // assignment operator is disabled
67 FuncMinimumMisc& operator=( const FuncMinimumMisc& ) = delete;
68
69 private:
70 Arg m_argum;
71 const GenFunc* m_eq;
72 Gradient m_grad;
73 };
74
76 using extends::extends;
77
78 private:
80 FuncMinimum() = delete;
82 FuncMinimum( const FuncMinimum& ) = delete;
84 FuncMinimum& operator=( const FuncMinimum& ) = delete;
85
86 private:
87 Gaudi::Property<std::string> m_algType{this, "Algorithm", "conjugate_fr",
88 "type of the algorithm for multidimensional minimization"};
89 Gaudi::Property<double> m_max_iter{this, "Iteration", 200, "maximum of iteration"};
90 Gaudi::Property<double> m_norm_gradient{this, "Gradient", 1.0e-10,
91 "absolute tolerance for the Euclidean norm of the gradient"};
92 Gaudi::Property<double> m_step_size{this, "Step_size", 0.01, "size of the first trial step"};
93 Gaudi::Property<double> m_tol{this, "Tol", 1e-10, "accuracy of the line minimization"};
94
95 const gsl_multimin_fdfminimizer_type* m_type = nullptr;
96 };
97
98 // ============================================================================
99 // The END
100 // ============================================================================
101 #endif // ALGTOOLS_FUNCMINIMUM_H
102 // ============================================================================
FuncMinimum::FuncMinimumMisc::operator=
FuncMinimumMisc & operator=(const FuncMinimumMisc &)=delete
FuncMinimum::m_algType
Gaudi::Property< std::string > m_algType
Definition: FuncMinimum.h:87
FuncMinimum::m_norm_gradient
Gaudi::Property< double > m_norm_gradient
Definition: FuncMinimum.h:90
FuncMinimum::m_step_size
Gaudi::Property< double > m_step_size
Definition: FuncMinimum.h:92
GaudiTool.h
Header file for class GaudiAlgorithm.
FuncMinimum::FuncMinimumMisc
Definition: FuncMinimum.h:48
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:314
FuncMinimum::FuncMinimumMisc::m_argum
Arg m_argum
Definition: FuncMinimum.h:70
FuncMinimum::FuncMinimumMisc::argument
const Arg & argument() const
Definition: FuncMinimum.h:57
FuncMinimum::Gradient
std::vector< const GenFunc * > Gradient
Definition: FuncMinimum.h:27
FuncMinimum::FuncMinimumMisc::equation
const GenFunc * equation() const
Definition: FuncMinimum.h:59
FuncMinimum::m_type
const gsl_multimin_fdfminimizer_type * m_type
Definition: FuncMinimum.h:95
FuncMinimum::FuncMinimumMisc::m_grad
Gradient m_grad
Definition: FuncMinimum.h:72
FuncMinimum::m_max_iter
Gaudi::Property< double > m_max_iter
Definition: FuncMinimum.h:89
GaudiPluginService.cpluginsvc.func
func
Definition: cpluginsvc.py:218
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
FuncMinimum
The simplest concrete implementation of IFuncMinimum interface.
Definition: FuncMinimum.h:24
FuncMinimum::FuncMinimumMisc::argument
Arg & argument()
Definition: FuncMinimum.h:58
std::vector< const GenFunc * >
FuncMinimum::FuncMinimumMisc::gradient
const Gradient & gradient() const
Definition: FuncMinimum.h:60
FuncMinimum::~FuncMinimum
~FuncMinimum() override=default
Destructor.
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
FuncMinimum::minimum
StatusCode minimum(const GenFunc &func, Arg &arg) const override
Find minimum of the function "GenFunc".
FuncMinimum::FuncMinimumMisc::FuncMinimumMisc
FuncMinimumMisc()=delete
IFuncMinimum.h
FuncMinimum::finalize
StatusCode finalize() override
Definition: FuncMinimum.cpp:293
FuncMinimum::m_tol
Gaudi::Property< double > m_tol
Definition: FuncMinimum.h:93
FuncMinimum::FuncMinimum
FuncMinimum()=delete
default constructor is private
FuncMinimum::FuncMinimumMisc::m_eq
const GenFunc * m_eq
Definition: FuncMinimum.h:71
FuncMinimum::initialize
StatusCode initialize() override
Overriding initialize.
Definition: FuncMinimum.cpp:243