| The Gaudi Framework v27r1

- 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/GenericFunctions.hh"
6 #include "CLHEP/GenericFunctions/Argument.hh"
7 #include "CLHEP/GenericFunctions/AbsFunction.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,
25 IFuncMinimum> {
26 public:
27 typedef std::vector<const GenFunc*> Gradient;
28 public:
29
34 StatusCode minimum( const GenFunc& func ,
35 Arg& arg ) const override;
36
41 StatusCode minimum( const GenFunc& func ,
42 Arg& arg ,
43 Covariance& covar ) const override;
44
46 StatusCode initialize () override;
47 StatusCode finalize () override;
48
49 ~FuncMinimum( ) override = default;
50
51 class FuncMinimumMisc final
52 {
53 public:
57 FuncMinimumMisc (const GenFunc& func ,
58 Arg& arg );
59
60 public:
61 inline const Arg& argument () const { return m_argum ;}
62 inline Arg& argument () { return m_argum ;}
63 inline const GenFunc* equation () const { return m_eq ;}
64 inline const Gradient& gradient () const { return m_grad ;}
65 private:
66 // default constructor is disabled
67 FuncMinimumMisc () = delete;
68 // copy constructor is disabled
69 FuncMinimumMisc ( const FuncMinimumMisc& ) = delete;
70 // assignment operator is disabled
71 FuncMinimumMisc& operator=( const FuncMinimumMisc& ) = delete;
72 private:
73 Arg m_argum ;
74 const GenFunc* m_eq ;
75 Gradient m_grad ;
76 };
77
78
85 FuncMinimum( const std::string& type,
86 const std::string& name,
87 const IInterface* parent);
88
89 private:
90
92 FuncMinimum() = delete;
94 FuncMinimum ( const FuncMinimum& ) = delete;
96 FuncMinimum& operator=( const FuncMinimum& ) = delete;
97
98 private:
99
100 std::string m_algType = "conjugate_fr";
101 double m_max_iter = 200;
102 double m_norm_gradient = 1.0e-10;
103 double m_step_size = 0.01;
104 double m_tol = 1e-10;
105 const gsl_multimin_fdfminimizer_type* m_type = nullptr;
106 };
107
108 // ============================================================================
109 // The END
110 // ============================================================================
111 #endif // ALGTOOLS_FUNCMINIMUM_H
112 // ============================================================================
FuncMinimum::FuncMinimumMisc::operator=
FuncMinimumMisc & operator=(const FuncMinimumMisc &)=delete
FuncMinimum::m_norm_gradient
double m_norm_gradient
Definition: FuncMinimum.h:102
GaudiTool.h
Header file for class GaudiAlgorithm.
FuncMinimum::FuncMinimumMisc
Definition: FuncMinimum.h:51
FuncMinimum::FuncMinimumMisc::m_argum
Arg m_argum
Definition: FuncMinimum.h:73
FuncMinimum::FuncMinimumMisc::argument
const Arg & argument() const
Definition: FuncMinimum.h:61
FuncMinimum::Gradient
std::vector< const GenFunc * > Gradient
Definition: FuncMinimum.h:27
FuncMinimum::m_tol
double m_tol
Definition: FuncMinimum.h:104
FuncMinimum::FuncMinimumMisc::equation
const GenFunc * equation() const
Definition: FuncMinimum.h:63
FuncMinimum::m_type
const gsl_multimin_fdfminimizer_type * m_type
Definition: FuncMinimum.h:105
FuncMinimum::FuncMinimumMisc::m_grad
Gradient m_grad
Definition: FuncMinimum.h:75
FuncMinimum::minimum
StatusCode minimum(const GenFunc &func, Arg &arg) const override
Find minimum of the function "GenFunc".
std::string
STL class.
FuncMinimum::m_step_size
double m_step_size
Definition: FuncMinimum.h:103
FuncMinimum::m_algType
std::string m_algType
Definition: FuncMinimum.h:100
GaudiPluginService.cpluginsvc.func
tuple func
Definition: cpluginsvc.py:218
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
IInterface
Definition of the basic interface.
Definition: IInterface.h:234
FuncMinimum
The simplest concrete implementation of IFuncMinimum interface.
Definition: FuncMinimum.h:24
FuncMinimum::operator=
FuncMinimum & operator=(const FuncMinimum &)=delete
assignment operator is
FuncMinimum::FuncMinimumMisc::argument
Arg & argument()
Definition: FuncMinimum.h:62
std::vector< const GenFunc * >
FuncMinimum::FuncMinimumMisc::gradient
const Gradient & gradient() const
Definition: FuncMinimum.h:64
FuncMinimum::~FuncMinimum
~FuncMinimum() override=default
Destructor.
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
FuncMinimum::FuncMinimumMisc::FuncMinimumMisc
FuncMinimumMisc()=delete
IFuncMinimum.h
AlgTool::type
const std::string & type() const override
Retrieve type (concrete class) of the sub-algtool.
Definition: AlgTool.cpp:72
FuncMinimum::finalize
StatusCode finalize() override
Definition: FuncMinimum.cpp:314
FuncMinimum::FuncMinimum
FuncMinimum()=delete
default constructor is private
FuncMinimum::FuncMinimumMisc::m_eq
const GenFunc * m_eq
Definition: FuncMinimum.h:74
FuncMinimum::m_max_iter
double m_max_iter
Definition: FuncMinimum.h:101
AlgTool::name
const std::string & name() const override
Retrieve full identifying name of the concrete tool object.
Definition: AlgTool.cpp:65
FuncMinimum::initialize
StatusCode initialize() override
Overriding initialize.
Definition: FuncMinimum.cpp:264
AlgTool::parent
const IInterface * parent() const override
Retrieve parent of the sub-algtool.
Definition: AlgTool.cpp:79