6 #include "GaudiMath/GSLFunAdapters.h"
7 #include "GaudiMath/GaudiMath.h"
11 #include "gsl/gsl_mode.h"
12 #include "gsl/gsl_sf_result.h"
24 namespace GaudiMathImplementation
32 , m_function ( function )
33 , m_result ( new gsl_sf_result() )
35 m_result -> val = -1.e+10 ;
36 m_result -> err = -1.e+10 ;
43 , m_result (
new gsl_sf_result() )
45 m_result -> val = func.
m_result -> val ;
46 m_result -> err = func.
m_result -> err ;
50 double GSLFunctionWithError::operator()
53 (*m_function)( x , m_result.get() ) ;
54 return m_result -> val ;
57 double GSLFunctionWithError::operator()
58 (
const Genfun::Argument& x )
const
60 (*m_function)( x[0] , m_result.get() ) ;
61 return m_result -> val ;
65 (
unsigned int i )
const
70 return Genfun::FunctionNoop( &aux ) ;
73 return Genfun::FunctionNoop( &aux ) ;
90 const gsl_mode_t&
mod )
92 , m_function ( function )
93 , m_mode ( new gsl_mode_t() )
102 , m_mode (
new gsl_mode_t () )
104 *m_mode = *(func.
m_mode) ;
107 double GSLFunctionWithMode::operator()
109 {
return (*m_function)( x , *m_mode ) ; }
111 double GSLFunctionWithMode::operator()
112 (
const Genfun::Argument& x )
const
113 {
return (*m_function)( x[0] , *m_mode ) ; }
116 (
unsigned int i )
const
121 return Genfun::FunctionNoop( &aux ) ;
124 return Genfun::FunctionNoop( &aux ) ;
138 const gsl_mode_t&
mod )
140 , m_function ( function )
141 , m_mode ( new gsl_mode_t() )
142 , m_result ( new gsl_sf_result() )
145 m_result -> val = -1.e+10 ;
146 m_result -> err = -1.e+10 ;
153 , m_mode (
new gsl_mode_t () )
154 , m_result (
new gsl_sf_result() )
156 *m_mode = *(func.
m_mode) ;
157 m_result -> val = func.
m_result -> val ;
158 m_result -> err = func.
m_result -> err ;
162 double GSLFunctionWithModeAndError::operator()
165 (*m_function)( x , *m_mode , m_result.get() ) ;
166 return m_result -> val ;
169 double GSLFunctionWithModeAndError::operator()
170 (
const Genfun::Argument& x )
const
172 (*m_function)( x[0] , *m_mode , m_result.get() ) ;
173 return m_result -> val ;
177 (
unsigned int i )
const
182 return Genfun::FunctionNoop( &aux ) ;
185 return Genfun::FunctionNoop( &aux ) ;
Function function() const
get the function itself
Genfun::GaudiMathImplementation::GSLFunctionWithError GSLFunctionWithError
Function function() const
get the function itself
const gsl_sf_result & result() const
get the last evaluated result
double(* Function)(double, gsl_mode_t)
the actual type of the function
const gsl_sf_result & result() const
get the last evaluated result
std::unique_ptr< gsl_sf_result > m_result
Genfun::AbsFunction Function
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
std::unique_ptr< gsl_mode_t > m_mode
Genfun::Derivative partial(unsigned int i) const
int(* Function)(double, gsl_sf_result *)
the actual type of the function
Genfun::Derivative partial(unsigned int i) const
std::unique_ptr< gsl_sf_result > m_result
const gsl_mode_t & mode() const
get the current mode
Function function() const
get the function itself
Genfun::Derivative partial(unsigned int i) const
GSLFunctionWithModeAndError()
const gsl_mode_t & mode() const
get the current mode
double error() const
get the error in the last estimate of the result
Genfun::GaudiMathImplementation::Constant Constant
double error() const
get the error in the last estimate of the result
int(* Function)(double, gsl_mode_t, gsl_sf_result *)
the actual type of the function