| The Gaudi Framework v29r0 (ff2e7097)

- 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
45 class FuncMinimumMisc final
46 {
47 public:
51 FuncMinimumMisc( const GenFunc& func, Arg& arg );
52
53 public:
54 inline const Arg& argument() const { return m_argum; }
55 inline Arg& argument() { return m_argum; }
56 inline const GenFunc* equation() const { return m_eq; }
57 inline const Gradient& gradient() const { return m_grad; }
58
59 private:
60 // default constructor is disabled
61 FuncMinimumMisc() = delete;
62 // copy constructor is disabled
63 FuncMinimumMisc( const FuncMinimumMisc& ) = delete;
64 // assignment operator is disabled
65 FuncMinimumMisc& operator=( const FuncMinimumMisc& ) = delete;
66
67 private:
68 Arg m_argum;
69 const GenFunc* m_eq;
70 Gradient m_grad;
71 };
72
74 using extends::extends;
75
76 private:
78 FuncMinimum() = delete;
80 FuncMinimum( const FuncMinimum& ) = delete;
82 FuncMinimum& operator=( const FuncMinimum& ) = delete;
83
84 private:
85 Gaudi::Property<std::string> m_algType{this, "Algorithm", "conjugate_fr",
86 "type of the algorithm for multidimensional minimization"};
87 Gaudi::Property<double> m_max_iter{this, "Iteration", 200, "maximum of iteration"};
88 Gaudi::Property<double> m_norm_gradient{this, "Gradient", 1.0e-10,
89 "absolute tolerance for the Euclidean norm of the gradient"};
90 Gaudi::Property<double> m_step_size{this, "Step_size", 0.01, "size of the first trial step"};
91 Gaudi::Property<double> m_tol{this, "Tol", 1e-10, "accuracy of the line minimization"};
92
93 const gsl_multimin_fdfminimizer_type* m_type = nullptr;
94 };
95
96 // ============================================================================
97 // The END
98 // ============================================================================
99 #endif // ALGTOOLS_FUNCMINIMUM_H
100 // ============================================================================
FuncMinimum::FuncMinimumMisc::operator=
FuncMinimumMisc & operator=(const FuncMinimumMisc &)=delete
FuncMinimum::m_algType
Gaudi::Property< std::string > m_algType
Definition: FuncMinimum.h:85
FuncMinimum::m_norm_gradient
Gaudi::Property< double > m_norm_gradient
Definition: FuncMinimum.h:88
FuncMinimum::m_step_size
Gaudi::Property< double > m_step_size
Definition: FuncMinimum.h:90
GaudiTool.h
Header file for class GaudiAlgorithm.
FuncMinimum::FuncMinimumMisc
Definition: FuncMinimum.h:45
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:319
FuncMinimum::FuncMinimumMisc::m_argum
Arg m_argum
Definition: FuncMinimum.h:68
FuncMinimum::FuncMinimumMisc::argument
const Arg & argument() const
Definition: FuncMinimum.h:54
FuncMinimum::Gradient
std::vector< const GenFunc * > Gradient
Definition: FuncMinimum.h:27
FuncMinimum::FuncMinimumMisc::equation
const GenFunc * equation() const
Definition: FuncMinimum.h:56
FuncMinimum::m_type
const gsl_multimin_fdfminimizer_type * m_type
Definition: FuncMinimum.h:93
FuncMinimum::FuncMinimumMisc::m_grad
Gradient m_grad
Definition: FuncMinimum.h:70
FuncMinimum::m_max_iter
Gaudi::Property< double > m_max_iter
Definition: FuncMinimum.h:87
GaudiPluginService.cpluginsvc.func
func
Definition: cpluginsvc.py:229
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
FuncMinimum
The simplest concrete implementation of IFuncMinimum interface.
Definition: FuncMinimum.h:24
FuncMinimum::FuncMinimumMisc::argument
Arg & argument()
Definition: FuncMinimum.h:55
std::vector< const GenFunc * >
FuncMinimum::FuncMinimumMisc::gradient
const Gradient & gradient() const
Definition: FuncMinimum.h:57
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::m_tol
Gaudi::Property< double > m_tol
Definition: FuncMinimum.h:91
FuncMinimum::FuncMinimum
FuncMinimum()=delete
default constructor is private
FuncMinimum::FuncMinimumMisc::m_eq
const GenFunc * m_eq
Definition: FuncMinimum.h:69
FuncMinimum::initialize
StatusCode initialize() override
Overriding initialize.
Definition: FuncMinimum.cpp:188