| The Gaudi Framework v27r1

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

- File List
- File Members

NumericalDerivative.h
Go to the documentation of this file.
1 #ifndef GAUDIMATH_NUMERICALDERIVATIVE_H
2 #define GAUDIMATH_NUMERICALDERIVATIVE_H 1
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 // GaudiKernel
7 // ============================================================================
8 #include "GaudiKernel/StatusCode.h"
9 // ============================================================================
10 // CLHEP
11 // ============================================================================
12 #include "CLHEP/GenericFunctions/AbsFunction.hh"
13 // ============================================================================
14
15 namespace Genfun
16 {
17 namespace GaudiMathImplementation
18 {
34 class GAUDI_API NumericalDerivative : public AbsFunction
35 {
36 public:
38 enum Type
39 { Central ,
40 Forward ,
41 Backward } ;
42 public:
44 FUNCTION_OBJECT_DEF( NumericalDerivative )
45
46 public:
47
83 NumericalDerivative
84 ( const AbsFunction& function ,
85 const size_t index ,
86 const Type& type = Central ) ;
87
89 NumericalDerivative
90 ( const NumericalDerivative& right ) ;
91
93 virtual ~NumericalDerivative () = default;
94
96 virtual unsigned int dimensionality() const { return m_DIM ; }
97
99 virtual double operator() ( double argument ) const ;
101 virtual double operator() ( const Argument& argument ) const ;
102
104 virtual bool hasAnalyticDerivative() const { return true ;}
105
107 virtual Derivative partial ( unsigned int index ) const;
108
109 public:
110
112 const AbsFunction& function () const { return *m_function ; }
114 size_t index () const { return m_index ; }
116 const Type& type () const { return m_type ; }
117
119 const Type& setType ( const Type& value );
120
122 double result () const { return m_result ; }
124 double error () const { return m_error ; }
125
126 protected:
127
128 StatusCode Exception
129 ( const std::string& message ,
130 const StatusCode& sc = StatusCode::FAILURE ) const ;
131
132 private:
133
134 // default constructor is disabled
135 NumericalDerivative ();
136 // assignement operator is disabled
137 NumericalDerivative& operator=( const NumericalDerivative& ) ;
138
139 private:
140 std::unique_ptr<const AbsFunction> m_function ;
141 size_t m_index ;
142 size_t m_DIM ;
143 Type m_type ;
144 //
145 mutable Argument m_argument ;
146 mutable double m_result ;
147 mutable double m_error ;
148 };
149
150 } // end of namespace GaudiMathImplementation
151 } // end of namespace GenFun
152
153 // ============================================================================
154 // The END
155 // ============================================================================
156 #endif // GAUDIMATH_NUMERICALDERIVATIVE_H
157 // ============================================================================
Genfun::GaudiMathImplementation::NumericalDerivative::index
size_t index() const
index
Definition: NumericalDerivative.h:114
Genfun::GaudiMathImplementation::NumericalDerivative::error
double error() const
the absolute error estimate for the last call
Definition: NumericalDerivative.h:124
Genfun::GaudiMathImplementation::NumericalDerivative::type
const Type & type() const
type
Definition: NumericalDerivative.h:116
Genfun::GaudiMathImplementation::NumericalDerivative::Type
Type
the type of numerical differentiation
Definition: NumericalDerivative.h:38
Genfun::GaudiMathImplementation::NumericalDerivative::m_argument
Argument m_argument
Definition: NumericalDerivative.h:145
Genfun::GaudiMathImplementation::NumericalDerivative::m_function
std::unique_ptr< const AbsFunction > m_function
Definition: NumericalDerivative.h:140
GaudiMath::Derivative
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
Definition: GaudiMath.h:29
merge_files.sc
int sc
Definition: merge_files.py:167
std::string
STL class.
Genfun::GaudiMathImplementation::NumericalDerivative::m_error
double m_error
Definition: NumericalDerivative.h:147
gaudirun.type
string type
Definition: gaudirun.py:151
Genfun::GaudiMathImplementation::NumericalDerivative::Forward
Definition: NumericalDerivative.h:40
StatusCode::FAILURE
Definition: StatusCode.h:29
merge_files.default
list default
Definition: merge_files.py:105
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
dump_component_properties.value
list value
Definition: dump_component_properties.py:12
Genfun::GaudiMathImplementation::NumericalDerivative::m_index
size_t m_index
Definition: NumericalDerivative.h:141
Genfun::GaudiMathImplementation::NumericalDerivative::m_DIM
size_t m_DIM
Definition: NumericalDerivative.h:142
Genfun::GaudiMathImplementation::NumericalDerivative
Numerical derivative (using GSL adaptive numerical differentiation)
Definition: NumericalDerivative.h:34
Genfun::GaudiMathImplementation::NumericalDerivative::m_type
Type m_type
Definition: NumericalDerivative.h:143
Genfun::GaudiMathImplementation::NumericalDerivative::Central
Definition: NumericalDerivative.h:39
Genfun::GaudiMathImplementation::NumericalDerivative::m_result
double m_result
Definition: NumericalDerivative.h:146
std::unique_ptr< const AbsFunction >
Genfun
CLHEP.
Definition: IEqSolver.h:13
StatusCode.h
Genfun::GaudiMathImplementation::NumericalDerivative::hasAnalyticDerivative
virtual bool hasAnalyticDerivative() const
Does this function have an analytic derivative?
Definition: NumericalDerivative.h:104
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:107
Tuples::Type
Type
the list of available types for ntuples
Definition: TupleObj.h:79
Genfun::GaudiMathImplementation::NumericalDerivative::result
double result() const
the result of the last call
Definition: NumericalDerivative.h:122