CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
GenericFunctions
GenericFunctions
GenericFunctions/F1D.hh
Go to the documentation of this file.
1
// -*- C++ -*------------------------------------------------------
2
//
3
// This class is an adaptor from any function (double *f)(double x)
4
// of one real variable, to generic functions. This allows one
5
// to plot, differentiate, sum, compose, etc, any standard C or
6
// C++ math function by converting it to a Generic Function.
7
//
8
// Joe Boudreau October 2012
9
//-----------------------------------------------------
10
#ifndef F1D_h
11
#define F1D_h 1
12
#include "
CLHEP/GenericFunctions/AbsFunction.hh
"
13
namespace
Genfun {
14
19
class
F1D :
public
AbsFunction {
20
21
typedef
double
(*FcnPtr)(
double
);
22
23
FUNCTION_OBJECT_DEF
(
F1D
)
24
25
public:
26
27
// Constructor
28
F1D
(FcnPtr fcn):p(fcn){};
29
30
// Destructor
31
virtual
~F1D
(){};
32
33
// Copy constructor
34
F1D
(
const
F1D
&right):
AbsFunction
(),p(right.p){};
35
36
// Retreive function value
37
virtual
double
operator ()
(
double
x)
const
{
38
return
(*p)(x);
39
}
40
41
virtual
double
operator ()
(
const
Argument
&
a
)
const
{
return
operator()
(a[0]);}
42
43
private
:
44
45
// It is illegal to assign a F1D
46
const
F1D
& operator=(
const
F1D
&right);
47
48
// Data:
49
FcnPtr p;
50
51
};
52
FUNCTION_OBJECT_IMP
(F1D)
53
}
// namespace Genfun
54
#endif
double
#define double(obj)
Definition:
excDblThrow.cc:32
Genfun::AbsFunction
Definition:
CLHEP/GenericFunctions/AbsFunction.hh:48
Genfun::F1D::F1D
F1D(FcnPtr fcn)
Definition:
CLHEP/GenericFunctions/F1D.hh:28
FUNCTION_OBJECT_DEF
#define FUNCTION_OBJECT_DEF(classname)
Definition:
CLHEP/GenericFunctions/AbsFunction.hh:144
a
Definition:
testCategories.cc:125
Genfun::F1D::operator()
virtual double operator()(double x) const
Definition:
CLHEP/GenericFunctions/F1D.hh:37
AbsFunction.hh
Genfun::F1D
Definition:
CLHEP/GenericFunctions/F1D.hh:19
Genfun::F1D::F1D
F1D(const F1D &right)
Definition:
GenericFunctions/F1D.hh:34
Genfun::Argument
Definition:
CLHEP/GenericFunctions/Argument.hh:17
Genfun::F1D::~F1D
virtual ~F1D()
Definition:
GenericFunctions/F1D.hh:31
FUNCTION_OBJECT_IMP
#define FUNCTION_OBJECT_IMP(classname)
Definition:
CLHEP/GenericFunctions/AbsFunction.hh:156
Generated on Sat Apr 26 2014 20:36:36 for CLHEP by
1.8.6