Numerical derivative (using GSL adaptive numerical differentiation)
More...
#include <NumericalDerivative.h>
Numerical derivative (using GSL adaptive numerical differentiation)
- Author
- Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru
- Date
- 2003-08-27
Definition at line 36 of file NumericalDerivative.h.
| Genfun::GaudiMathImplementation::NumericalDerivative::NumericalDerivative |
( |
const AbsFunction & |
function, |
|
|
const size_t |
index, |
|
|
const Type & |
type = Central |
|
) |
| |
From CLHEP/GenericFunctions.
from CLHEP/GenericFunctions
The standard constructor from AbsFunction and the index of the variable
The function, created with this constructor compute the numerical derivatived by finite differencing,. An adaptive algorithm is used to find teh best choice of finite difference and to estimate the error in derivative
- The central difference algorithm
gsl_diff_central is used for type = Type::Central
- The forward difference algorithm
gsl_diff_forward is used for type = Type::Forward. The function is evaluated only at points greater than x_i and x_i itself. This function should be used if f(x) has a singularity or if it is undefined for values less than x_i
- The backward difference algorithm
gsl_diff_backward is used for type = Type::Backward. The function is evaluated only at points smaller than x_i and x_i itself. This function should be used if f(x) has a singularity or if it is undefined for values greater than x_i
The adaptime numerical differentiation is used
- Parameters
-
| function | the function |
| index | the variable index |
The standard constructor from AbsFunction and the index of the variable
- Parameters
-
| function | the function |
| index | the variable index |
Definition at line 53 of file NumericalDerivative.cpp.
: AbsFunction ()
{
{
Exception (
"::constructor invalid variable index " ) ; };
}
| Genfun::GaudiMathImplementation::NumericalDerivative::NumericalDerivative |
( |
const NumericalDerivative & |
right | ) |
|
| Genfun::GaudiMathImplementation::NumericalDerivative::~NumericalDerivative |
( |
| ) |
|
|
virtual |
| Genfun::GaudiMathImplementation::NumericalDerivative::NumericalDerivative |
( |
| ) |
|
|
private |
| virtual unsigned int Genfun::GaudiMathImplementation::NumericalDerivative::dimensionality |
( |
| ) |
const |
|
inlinevirtual |
| double Genfun::GaudiMathImplementation::NumericalDerivative::error |
( |
| ) |
const |
|
inline |
| const AbsFunction& Genfun::GaudiMathImplementation::NumericalDerivative::function |
( |
| ) |
const |
|
inline |
| virtual bool Genfun::GaudiMathImplementation::NumericalDerivative::hasAnalyticDerivative |
( |
| ) |
const |
|
inlinevirtual |
| size_t Genfun::GaudiMathImplementation::NumericalDerivative::index |
( |
| ) |
const |
|
inline |
| double Genfun::GaudiMathImplementation::NumericalDerivative::operator() |
( |
double |
argument | ) |
const |
|
virtual |
| double Genfun::GaudiMathImplementation::NumericalDerivative::operator() |
( |
const Argument & |
argument | ) |
const |
|
virtual |
Function value.
copy the argument
use GSL to evaluate the numerical derivative
Definition at line 118 of file NumericalDerivative.cpp.
{
if( argument.dimension() !=
m_DIM )
{
Exception (
"::operator():invalid argument size" ) ; };
gsl_function F ;
F.params = &helper ;
int ierrno = 0 ;
{
default:
Exception (
"::operator(): invalid diffrentiation type " ) ;
}
if( ierrno )
{ gsl_error ( " NumericalDerivative:: the error from gsl_diff_XXXX" ,
__FILE__ , __LINE__ , ierrno ) ; }
}
| Genfun::Derivative Genfun::GaudiMathImplementation::NumericalDerivative::partial |
( |
unsigned int |
index | ) |
const |
|
virtual |
Derivatives.
Definition at line 104 of file NumericalDerivative.cpp.
{
{
Exception (
"::partial(i): invalid variable index" ) ; }
const AbsFunction& aux =
return FunctionNoop( &aux ) ;
}
| double Genfun::GaudiMathImplementation::NumericalDerivative::result |
( |
| ) |
const |
|
inline |
| const Type& Genfun::GaudiMathImplementation::NumericalDerivative::type |
( |
| ) |
const |
|
inline |
| Argument Genfun::GaudiMathImplementation::NumericalDerivative::m_argument |
|
mutableprivate |
| size_t Genfun::GaudiMathImplementation::NumericalDerivative::m_DIM |
|
private |
| double Genfun::GaudiMathImplementation::NumericalDerivative::m_error |
|
mutableprivate |
| const AbsFunction* Genfun::GaudiMathImplementation::NumericalDerivative::m_function |
|
private |
| size_t Genfun::GaudiMathImplementation::NumericalDerivative::m_index |
|
private |
| double Genfun::GaudiMathImplementation::NumericalDerivative::m_result |
|
mutableprivate |
| Type Genfun::GaudiMathImplementation::NumericalDerivative::m_type |
|
private |
The documentation for this class was generated from the following files: