CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
Genfun::FunctionConvolution Class Reference

#include <FunctionConvolution.hh>

+ Inheritance diagram for Genfun::FunctionConvolution:

Public Member Functions

 FunctionConvolution (const AbsFunction *arg1, const AbsFunction *arg2, double x0, double x1)
 
 FunctionConvolution (const FunctionConvolution &right)
 
virtual ~FunctionConvolution ()
 
virtual double operator() (double argument) const override
 
virtual double operator() (const Argument &argument) const override
 
- Public Member Functions inherited from Genfun::AbsFunction
 AbsFunction ()
 
 AbsFunction (const AbsFunction &right)
 
virtual ~AbsFunction ()
 
virtual unsigned int dimensionality () const
 
virtual double operator() (double argument) const =0
 
virtual double operator() (const Argument &argument) const =0
 
virtual AbsFunctionclone () const =0
 
virtual FunctionComposition operator() (const AbsFunction &f) const
 
virtual ParameterComposition operator() (const AbsParameter &p) const
 
Derivative derivative (const Variable &v) const
 
Derivative prime () const
 
virtual bool hasAnalyticDerivative () const
 
virtual Derivative partial (unsigned int) const
 

Detailed Description

Author

Definition at line 25 of file FunctionConvolution.hh.

Constructor & Destructor Documentation

◆ FunctionConvolution() [1/2]

Genfun::FunctionConvolution::FunctionConvolution ( const AbsFunction arg1,
const AbsFunction arg2,
double  x0,
double  x1 
)

Definition at line 10 of file FunctionConvolution.cc.

10 :_arg1(arg1->clone()),_arg2(arg2->clone()),_x0(x0), _x1(x1)
11{
12 if ((arg1->dimensionality()!=1) || arg2->dimensionality()!=1) {
13 std::cout
14 << "Warning: dimension mismatch in function convolution"
15 << std::endl;
16 assert(0);
17 }
18}

◆ FunctionConvolution() [2/2]

Genfun::FunctionConvolution::FunctionConvolution ( const FunctionConvolution right)

Definition at line 20 of file FunctionConvolution.cc.

20 :
21AbsFunction(right),
22_arg1(right._arg1->clone()),
23_arg2(right._arg2->clone()),
24_x0(right._x0),
25_x1(right._x1)
26{}

◆ ~FunctionConvolution()

Genfun::FunctionConvolution::~FunctionConvolution ( )
virtual

Definition at line 28 of file FunctionConvolution.cc.

29{
30 delete _arg1;
31 delete _arg2;
32}

Member Function Documentation

◆ operator()() [1/2]

virtual double Genfun::FunctionConvolution::operator() ( const Argument argument) const
inlineoverridevirtual

Implements Genfun::AbsFunction.

Definition at line 42 of file FunctionConvolution.hh.

42{return operator() (argument[0]);}
virtual double operator()(double argument) const override

◆ operator()() [2/2]

double Genfun::FunctionConvolution::operator() ( double  argument) const
overridevirtual

Implements Genfun::AbsFunction.

Definition at line 36 of file FunctionConvolution.cc.

37{
38 const double NDIVISIONS=200.0;
39 double dx = (_x1-_x0)/NDIVISIONS;
40 double result=0.0;
41 for (double x=_x0; x<_x1; x+=dx) {
42 result += (*_arg1)(argument-x)*(*_arg2)(x);
43 }
44 result/=NDIVISIONS;
45 return result;
46}

Referenced by operator()().


The documentation for this class was generated from the following files: