All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GSLFunAdapters.h
Go to the documentation of this file.
1 // $Id: GSLFunAdapters.h,v 1.2 2005/11/25 10:27:03 mato Exp $
2 // ============================================================================
3 #ifndef GAUDIMATH_GSLFUNADAPTERS_H
4 #define GAUDIMATH_GSLFUNADAPTERS_H 1
5 // ============================================================================
6 // Include files
7 // ============================================================================
8 // from CLHEP
9 // ============================================================================
10 #include "CLHEP/GenericFunctions/GenericFunctions.hh"
11 #include "CLHEP/GenericFunctions/Argument.hh"
12 #include "CLHEP/GenericFunctions/AbsFunction.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 namespace Genfun
26 {
27  namespace GaudiMathImplementation
28  {
31 
32  class GAUDI_API GSLFunctionWithError : public AbsFunction
33  {
34  public:
36  typedef int (*Function)( double , gsl_sf_result* ) ;
37  public:
39  FUNCTION_OBJECT_DEF( GSLFunctionWithError )
40  public:
42  GSLFunctionWithError ( Function function ) ;
46  virtual ~GSLFunctionWithError () ;
48  virtual double operator() ( double x ) const ;
49  virtual double operator() ( const Argument& x ) const ;
50  virtual bool hasAnalyticDerivative () const { return true ; }
51  virtual unsigned int dimensionality () const { return 1 ; }
52  Genfun::Derivative partial ( unsigned int i ) const ;
53 
55  Function function () const ;
57  const gsl_sf_result& result () const ;
59  double error () const ;
60  private:
61  // default constructor is disabled
63  // assignement operator is disabled
64  GSLFunctionWithError& operator=( const GSLFunctionWithError & ) ;
65  private:
67  gsl_sf_result* m_result ;
68  };
69 
70  class GAUDI_API GSLFunctionWithMode : public AbsFunction
71  {
72  public:
74  typedef double (*Function)( double , gsl_mode_t ) ;
75  public:
77  FUNCTION_OBJECT_DEF( GSLFunctionWithMode )
78  public:
81  const gsl_mode_t& mode ) ;
85  virtual ~GSLFunctionWithMode () ;
87  virtual double operator() ( double x ) const ;
88  virtual double operator() ( const Argument& x ) const ;
89  virtual bool hasAnalyticDerivative () const { return true ; }
90  virtual unsigned int dimensionality () const { return 1 ; }
91  Genfun::Derivative partial ( unsigned int i ) const ;
93  Function function () const ;
95  const gsl_mode_t& mode () const ;
96  private:
97  // default constructor is disabled
99  // assignement operator is disabled
100  GSLFunctionWithMode& operator=( const GSLFunctionWithError & ) ;
101  private:
103  gsl_mode_t* m_mode ;
104  };
105 
106  class GAUDI_API GSLFunctionWithModeAndError : public AbsFunction
107  {
108  public:
110  typedef int (*Function)( double ,
111  gsl_mode_t ,
112  gsl_sf_result* ) ;
113  public:
115  FUNCTION_OBJECT_DEF( GSLFunctionWithModeAndError )
116  public:
119  const gsl_mode_t& mode ) ;
123  virtual ~GSLFunctionWithModeAndError () ;
125  virtual double operator() ( double x ) const ;
126  virtual double operator() ( const Argument& x ) const ;
127  virtual bool hasAnalyticDerivative () const { return true ; }
128  virtual unsigned int dimensionality () const { return 1 ; }
129  Genfun::Derivative partial ( unsigned int i ) const ;
131  Function function () const ;
133  const gsl_mode_t& mode () const ;
135  const gsl_sf_result& result () const ;
137  double error () const ;
138  private:
139  // default constructor is disabled
141  // assignement operator is disabled
142  GSLFunctionWithModeAndError& operator=
143  ( const GSLFunctionWithModeAndError & ) ;
144  private:
146  gsl_mode_t* m_mode ;
147  gsl_sf_result* m_result ;
148  };
149 
150  } // end of namespace GaudiMath Implemnentation
151 } // end of namespace Genfun
152 
153 #endif // GAUDIMATH_GSLFUNADAPTERS_H
154 // ============================================================================
Genfun::GaudiMathImplementation::GSLFunctionWithMode GSLFunctionWithMode
Definition: Adapters.h:27
Genfun::GaudiMathImplementation::GSLFunctionWithError GSLFunctionWithError
Definition: Adapters.h:29
Genfun::AbsFunction Function
Definition: GaudiMath.h:26
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
Definition: GaudiMath.h:31
Genfun::GaudiMathImplementation::SimpleFunction GSLFunction
the actual type for primitive adaptor
Genfun::GaudiMathImplementation::GSLFunctionWithModeAndError GSLFunctionWithModeAndError
Definition: Adapters.h:31
double fun(const std::vector< double > &x)
Definition: PFuncTest.cpp:27
#define GAUDI_API
Definition: Kernel.h:108
list i
Definition: ana.py:128