15 #include "gsl/gsl_diff.h" 16 #include "gsl/gsl_errno.h" 17 #include "gsl/gsl_math.h" 34 namespace GaudiMathImplementation {
48 , m_function( function.clone() )
50 , m_DIM( function.dimensionality() )
52 , m_argument( function.dimensionality() )
53 , m_result( GSL_NEGINF )
54 , m_error( GSL_POSINF ) {
86 if ( idx >=
m_DIM ) {
Exception(
"::partial(i): invalid variable index" ); }
88 return FunctionNoop( &aux );
101 if ( argument.dimension() !=
m_DIM ) {
Exception(
"::operator():invalid argument size" ); };
129 Exception(
"::operator(): invalid diffrentiation type " );
132 if ( ierrno ) { gsl_error(
" NumericalDerivative:: the error from gsl_diff_XXXX", __FILE__, __LINE__, ierrno ); }
147 if ( 1 !=
m_DIM ) {
Exception(
"operator(): invalid argument size " ); }
151 return ( *
this )( arg );
159 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