Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GSLFunAdapters.h
Go to the documentation of this file.
1 #ifndef GAUDIMATH_GSLFUNADAPTERS_H
2 #define GAUDIMATH_GSLFUNADAPTERS_H 1
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 #include <memory>
7 // ============================================================================
8 // from CLHEP
9 // ============================================================================
10 #include "CLHEP/GenericFunctions/AbsFunction.hh"
11 #include "CLHEP/GenericFunctions/Argument.hh"
12 #include "CLHEP/GenericFunctions/GenericFunctions.hh"
13 // ============================================================================
14 // GaudiGSL/GaudiMath
15 // ============================================================================
16 #include "GaudiMath/FunAdapters.h"
17 // ============================================================================
18 // GSL
19 // ============================================================================
20 #include "gsl/gsl_mode.h"
21 #include "gsl/gsl_sf_result.h"
22 // ============================================================================
23 #include "GaudiKernel/Kernel.h"
24 
25 #if defined( __clang__ ) || defined( __CLING__ )
26 # pragma clang diagnostic push
27 # pragma clang diagnostic ignored "-Winconsistent-missing-override"
28 #elif defined( __GNUC__ ) && __GNUC__ >= 5
29 # pragma GCC diagnostic push
30 # pragma GCC diagnostic ignored "-Wsuggest-override"
31 #endif
32 
33 namespace Genfun {
34  namespace GaudiMathImplementation {
37 
38  class GAUDI_API GSLFunctionWithError : public AbsFunction {
39  public:
41  typedef int ( *Function )( double, gsl_sf_result* );
42 
43  public:
45  FUNCTION_OBJECT_DEF( GSLFunctionWithError )
46  public:
48  GSLFunctionWithError( Function function );
52  double operator()( double x ) const override;
53  double operator()( const Argument& x ) const override;
54  bool hasAnalyticDerivative() const override { return true; }
55  unsigned int dimensionality() const override { return 1; }
56  Genfun::Derivative partial( unsigned int i ) const override;
57 
59  Function function() const;
61  const gsl_sf_result& result() const;
63  double error() const;
64 
65  private:
66  // default constructor is disabled
68  // assignement operator is disabled
70 
71  private:
74  };
76  FUNCTION_OBJECT_IMP( GSLFunctionWithError )
77 
78  class GAUDI_API GSLFunctionWithMode : public AbsFunction {
79  public:
81  typedef double ( *Function )( double, gsl_mode_t );
82 
83  public:
85  FUNCTION_OBJECT_DEF( GSLFunctionWithMode )
86  public:
88  GSLFunctionWithMode( Function fun, const gsl_mode_t& mode );
92  double operator()( double x ) const override;
93  double operator()( const Argument& x ) const override;
94  bool hasAnalyticDerivative() const override { return true; }
95  unsigned int dimensionality() const override { return 1; }
96  Genfun::Derivative partial( unsigned int i ) const override;
98  Function function() const;
100  const gsl_mode_t& mode() const;
101 
102  private:
103  // default constructor is disabled
105  // assignement operator is disabled
107 
108  private:
111  };
113  FUNCTION_OBJECT_IMP( GSLFunctionWithMode )
114 
116  public:
118  typedef int ( *Function )( double, gsl_mode_t, gsl_sf_result* );
119 
120  public:
122  FUNCTION_OBJECT_DEF( GSLFunctionWithModeAndError )
123  public:
125  GSLFunctionWithModeAndError( Function fun, const gsl_mode_t& mode );
129  double operator()( double x ) const override;
130  double operator()( const Argument& x ) const override;
131  bool hasAnalyticDerivative() const override { return true; }
132  unsigned int dimensionality() const override { return 1; }
133  Genfun::Derivative partial( unsigned int i ) const override;
135  Function function() const;
137  const gsl_mode_t& mode() const;
139  const gsl_sf_result& result() const;
141  double error() const;
142 
143  private:
144  // default constructor is disabled
146  // assignement operator is disabled
148 
149  private:
153  };
155  FUNCTION_OBJECT_IMP( GSLFunctionWithModeAndError )
156 
157  } // namespace GaudiMathImplementation
158 } // end of namespace Genfun
159 
160 #if defined( __clang__ ) || defined( __CLING__ )
161 # pragma clang diagnostic pop
162 #elif defined( __GNUC__ ) && __GNUC__ >= 5
163 # pragma GCC diagnostic pop
164 #endif
165 
166 #endif // GAUDIMATH_GSLFUNADAPTERS_H
Genfun::GaudiMathImplementation::GSLFunctionWithMode GSLFunctionWithMode
Definition: Adapters.h:19
Genfun::GaudiMathImplementation::GSLFunctionWithError GSLFunctionWithError
Definition: Adapters.h:20
mandatory macro from CLHEP/GenericFunctions
Definition: FunAdapters.h:213
Genfun::AbsFunction Function
Definition: GaudiMath.h:23
#define class
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
Definition: GaudiMath.h:26
PropertyMgr & operator=(const PropertyMgr &)=delete
Genfun::GaudiMathImplementation::SimpleFunction GSLFunction
the actual type for primitive adaptor
mandatory macro from CLHEP/GenericFunctions
Genfun::GaudiMathImplementation::GSLFunctionWithModeAndError GSLFunctionWithModeAndError
Definition: Adapters.h:21
double fun(const std::vector< double > &x)
Definition: PFuncTest.cpp:26
CLHEP.
Definition: IEqSolver.h:13
#define GAUDI_API
Definition: Kernel.h:71
mandatory macro from CLHEP/GenericFunctions