CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
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
13namespace Genfun {
14
15 /**
16 * @author
17 * @ingroup genfun
18 */
20
22
23 public:
24
25 // Constructor
26 FunctionNumDeriv(const AbsFunction *arg1, unsigned int index=0);
27
28 // Copy constructor.
30
31 // Destructor
32 virtual ~FunctionNumDeriv();
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)
Definition: AbsFunction.hh:143
virtual unsigned int dimensionality() const override
virtual double operator()(double argument) const override
void f(void g())
Definition: excDblThrow.cc:38
Definition: Abs.hh:14