CLHEP 2.4.7.1
C++ Class Library for High Energy Physics
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
12
13namespace Genfun {
14
20
22
23 public:
24
25 // Constructor
26 FunctionNumDeriv(const AbsFunction *arg1, unsigned int index=0);
27
28 // Copy constructor.
30
31 // Destructor
33
34 // Retreive function value
35 virtual double operator ()(double argument) const override;
36 virtual double operator ()(const Argument & a) const override;
37
38 // Dimensionality
39 virtual unsigned int dimensionality() const override;
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
#define FUNCTION_OBJECT_DEF(classname)
virtual unsigned int dimensionality() const override
FunctionNumDeriv(const FunctionNumDeriv &right)
virtual double operator()(double argument) const override
FunctionNumDeriv(const AbsFunction *arg1, unsigned int index=0)
Definition Abs.hh:14