| # Gaudi Framework, version v21r6 |

Home |  | Generated: 11 Nov 2009

# GSLFunAdapters.h

Go to the documentation of this file.

    00001 // $Id: GSLFunAdapters.h,v 1.2 2005/11/25 10:27:03 mato Exp $
    00002 // ============================================================================
    00003 #ifndef GAUDIMATH_GSLFUNADAPTERS_H
    00004 #define GAUDIMATH_GSLFUNADAPTERS_H 1
    00005 // ============================================================================
    00006 // Include files
    00007 // ============================================================================
    00008 // from CLHEP
    00009 // ============================================================================
    00010 #include "CLHEP/GenericFunctions/GenericFunctions.hh"
    00011 #include "CLHEP/GenericFunctions/Argument.hh"
    00012 #include "CLHEP/GenericFunctions/AbsFunction.hh"
    00013 // ============================================================================
    00014 // GaudiGSL/GaudiMath
    00015 // ============================================================================
    00016 #include "GaudiMath/FunAdapters.h"
    00017 // ============================================================================
    00018 // GSL
    00019 // ============================================================================
    00020 #include "gsl/gsl_mode.h"
    00021 #include "gsl/gsl_sf_result.h"
    00022 // ============================================================================
    00023 #include "GaudiKernel/Kernel.h"
    00024
    00025 namespace Genfun
    00026 {
    00027   namespace GaudiMathImplementation
    00028   {
    00030     typedef Genfun::GaudiMathImplementation::SimpleFunction GSLFunction ;
    00031
    00032     class GAUDI_API GSLFunctionWithError : public AbsFunction
    00033     {
    00034     public:
    00036       typedef int (*Function)( double , gsl_sf_result* ) ;
    00037     public:
    00039       FUNCTION_OBJECT_DEF( GSLFunctionWithError ) ;
    00040     public:
    00042       GSLFunctionWithError ( Function function ) ;
    00044       GSLFunctionWithError ( const GSLFunctionWithError& ) ;
    00046       virtual ~GSLFunctionWithError () ;
    00048       virtual double operator() (       double    x ) const ;
    00049       virtual double operator() ( const Argument& x ) const ;
    00050       virtual bool         hasAnalyticDerivative () const { return true ; }
    00051       virtual unsigned int dimensionality        () const { return    1 ; }
    00052       Genfun::Derivative partial ( unsigned int i ) const ;
    00053
    00055       Function             function () const ;
    00057       const gsl_sf_result& result   () const ;
    00059       double               error    () const ;
    00060     private:
    00061       // default constructor is disabled
    00062       GSLFunctionWithError () ;
    00063       // assignement operator is disabled
    00064       GSLFunctionWithError& operator=( const GSLFunctionWithError & ) ;
    00065     private:
    00066       Function        m_function ;
    00067       gsl_sf_result*  m_result   ;
    00068     };
    00069
    00070     class GAUDI_API GSLFunctionWithMode : public AbsFunction
    00071     {
    00072     public:
    00074       typedef double (*Function)( double , gsl_mode_t ) ;
    00075     public:
    00077       FUNCTION_OBJECT_DEF( GSLFunctionWithMode ) ;
    00078     public:
    00080       GSLFunctionWithMode ( Function          fun  ,
    00081                             const gsl_mode_t& mode ) ;
    00083       GSLFunctionWithMode ( const GSLFunctionWithMode& ) ;
    00085       virtual ~GSLFunctionWithMode () ;
    00087       virtual double operator() (       double    x ) const ;
    00088       virtual double operator() ( const Argument& x ) const ;
    00089       virtual bool         hasAnalyticDerivative () const { return true ; }
    00090       virtual unsigned int dimensionality        () const { return    1 ; }
    00091       Genfun::Derivative partial ( unsigned int i ) const ;
    00093       Function             function () const ;
    00095       const gsl_mode_t&    mode     () const ;
    00096     private:
    00097       // default constructor is disabled
    00098       GSLFunctionWithMode () ;
    00099       // assignement operator is disabled
    00100       GSLFunctionWithMode& operator=( const GSLFunctionWithError & ) ;
    00101     private:
    00102       Function        m_function ;
    00103       gsl_mode_t*     m_mode     ;
    00104     };
    00105
    00106     class GAUDI_API GSLFunctionWithModeAndError : public AbsFunction
    00107     {
    00108     public:
    00110       typedef int (*Function)( double          ,
    00111                                gsl_mode_t      ,
    00112                                gsl_sf_result*  ) ;
    00113     public:
    00115       FUNCTION_OBJECT_DEF( GSLFunctionWithModeAndError ) ;
    00116     public:
    00118       GSLFunctionWithModeAndError ( Function          fun  ,
    00119                                     const gsl_mode_t& mode ) ;
    00121       GSLFunctionWithModeAndError ( const GSLFunctionWithModeAndError& ) ;
    00123       virtual ~GSLFunctionWithModeAndError () ;
    00125       virtual double operator() (       double    x ) const ;
    00126       virtual double operator() ( const Argument& x ) const ;
    00127       virtual bool         hasAnalyticDerivative () const { return true ; }
    00128       virtual unsigned int dimensionality        () const { return    1 ; }
    00129       Genfun::Derivative partial ( unsigned int i ) const ;
    00131       Function             function () const ;
    00133       const gsl_mode_t&    mode     () const ;
    00135       const gsl_sf_result& result   () const ;
    00137       double               error    () const ;
    00138     private:
    00139       // default constructor is disabled
    00140       GSLFunctionWithModeAndError () ;
    00141       // assignement operator is disabled
    00142       GSLFunctionWithModeAndError& operator=
    00143       ( const GSLFunctionWithModeAndError & ) ;
    00144     private:
    00145       Function        m_function ;
    00146       gsl_mode_t*     m_mode     ;
    00147       gsl_sf_result*  m_result   ;
    00148     };
    00149
    00150   } ; // end of namespace GaudiMath Implemnentation
    00151 }; // end of namespace Genfun
    00152
    00153 #endif // GAUDIMATH_GSLFUNADAPTERS_H
    00154 // ============================================================================