15 #include "gsl/gsl_diff.h" 16 #include "gsl/gsl_errno.h" 17 #include "gsl/gsl_math.h" 35 namespace GaudiMathImplementation
50 , m_function( function.clone() )
52 , m_DIM( function.dimensionality() )
54 , m_argument( function.dimensionality() )
55 , m_result( GSL_NEGINF )
56 , m_error( GSL_POSINF )
59 Exception(
"::constructor invalid variable index " );
96 Exception(
"::partial(i): invalid variable index" );
99 return FunctionNoop( &aux );
113 if ( argument.dimension() !=
m_DIM ) {
114 Exception(
"::operator():invalid argument size" );
119 for (
size_t i = 0; i <
m_DIM; ++i ) {
145 Exception(
"::operator(): invalid diffrentiation type " );
149 gsl_error(
" NumericalDerivative:: the error from gsl_diff_XXXX", __FILE__, __LINE__, ierrno );
167 Exception(
"operator(): invalid argument size " );
172 return ( *
this )( arg );
181 throw GaudiException(
"NumericalDerivative" + message,
"*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