CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
GenericFunctions
CLHEP
GenericFunctions
CLHEP/GenericFunctions/FunctionNumDeriv.hh
Go to the documentation of this file.
1
// -*- C++ -*-
2
// $Id: FunctionNumDeriv.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $
3
//--------------------------FunctionNumDeriv--------------------------------//
4
// //
5
// Class FunctionNumDeriv, providing numerical derivatives //
6
// Joe Boudreau, Mark Fischler, February 2001 //
7
// //
8
//--------------------------------------------------------------------------//
9
#ifndef FunctionNumDeriv_h
10
#define FunctionNumDeriv_h 1
11
#include "
CLHEP/GenericFunctions/AbsFunction.hh
"
12
13
namespace
Genfun {
14
19
class
FunctionNumDeriv
:
public
AbsFunction
{
20
21
FUNCTION_OBJECT_DEF
(
FunctionNumDeriv
)
22
23
public
:
24
25
// Constructor
26
FunctionNumDeriv
(
const
AbsFunction
*arg1,
unsigned
int
index=0);
27
28
// Copy constructor.
29
FunctionNumDeriv
(
const
FunctionNumDeriv
&right);
30
31
// Destructor
32
virtual
~FunctionNumDeriv
();
33
34
// Retreive function value
35
virtual
double
operator ()
(
double
argument)
const
;
36
virtual
double
operator ()
(
const
Argument
&
a
)
const
;
37
38
// Dimensionality
39
virtual
unsigned
int
dimensionality
()
const
;
40
41
private
:
42
43
// It is illegal to assign a FunctionNumDeriv
44
const
FunctionNumDeriv
& operator=(
const
FunctionNumDeriv
&right);
45
46
// The function we're differntiating.
47
const
AbsFunction
*_arg1;
48
const
unsigned
int
_wrtIndex;
49
50
// helper data and methods to let us code Argument and double similarly
51
double
numericalDerivative
52
(
double
(
FunctionNumDeriv
::*
f
)(
double
)
const
,
double
x )
const
;
53
double
f_x (
double
x)
const
;
54
double
f_Arg (
double
x)
const
;
55
mutable
Argument
_xArg;
56
57
};
58
}
// namespace Genfun
59
#endif
Generated on Sun Jun 17 2012 08:08:26 for CLHEP by
1.8.1.1