15 #include "gsl/gsl_errno.h" 16 #include "gsl/gsl_diff.h" 17 #include "gsl/gsl_math.h" 35 namespace GaudiMathImplementation
48 (
const AbsFunction&
function ,
52 , m_function (
function.clone() )
54 , m_DIM (
function.dimensionality() )
56 , m_argument (
function.dimensionality() )
57 , m_result ( GSL_NEGINF )
58 , m_error ( GSL_POSINF )
60 if( m_index >= m_DIM )
61 { Exception (
"::constructor invalid variable index " ) ; };
73 , m_DIM ( right.
m_DIM )
75 , m_argument ( right.
m_DIM )
76 , m_result ( GSL_NEGINF )
77 , m_error ( GSL_POSINF )
95 {
Exception (
"::partial(i): invalid variable index" ) ; }
96 const AbsFunction& aux =
98 return FunctionNoop( &aux ) ;
105 double NumericalDerivative::operator()
106 (
const Argument& argument )
const 113 if( argument.dimension() !=
m_DIM )
114 {
Exception (
"::operator():invalid argument size" ) ; };
138 Exception (
"::operator(): invalid diffrentiation type " ) ;
142 { gsl_error (
" NumericalDerivative:: the error from gsl_diff_XXXX" ,
143 __FILE__ , __LINE__ , ierrno ) ; }
159 if( 1 !=
m_DIM ) {
Exception (
"operator(): invalid argument size " ); }
163 return (*
this)( arg ) ;
175 "*GaudiMath*" , sc ) ;
Define general base for Gaudi exception.
const Type & type() const
type
Type
the type of numerical differentiation
std::unique_ptr< const AbsFunction > m_function
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
double operator()(double argument) const override
Function value.
Derivative partial(unsigned int index) const override
Derivatives.
const Type & setType(const Type &value)
change the type of the adaptive differentiation
This class is used for returning status codes from appropriate routines.
double GSL_Adaptor(double x, void *params)
Numerical derivative (using GSL adaptive numerical differentiation)
StatusCode Exception(const std::string &message, const StatusCode &sc=StatusCode::FAILURE) const
Exception.
the simple structure to be used for adaption interface Genfun::AbsFunction to gsl_function structure ...
double result() const
the result of the last call