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

#include <FunctionComposition.hh>

+ Inheritance diagram for Genfun::FunctionComposition:

Public Member Functions

 FunctionComposition (const AbsFunction *arg1, const AbsFunction *arg2)
 
 FunctionComposition (const FunctionComposition &right)
 
virtual ~FunctionComposition ()
 
virtual double operator() (double argument) const override
 
virtual double operator() (const Argument &a) const override
 
virtual unsigned int dimensionality () const override
 
Derivative partial (unsigned int) const override
 
virtual bool hasAnalyticDerivative () 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 20 of file FunctionComposition.hh.

Constructor & Destructor Documentation

◆ FunctionComposition() [1/2]

Genfun::FunctionComposition::FunctionComposition ( const AbsFunction arg1,
const AbsFunction arg2 
)

Definition at line 10 of file FunctionComposition.cc.

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

◆ FunctionComposition() [2/2]

Genfun::FunctionComposition::FunctionComposition ( const FunctionComposition right)

Definition at line 20 of file FunctionComposition.cc.

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

◆ ~FunctionComposition()

Genfun::FunctionComposition::~FunctionComposition ( )
virtual

Definition at line 26 of file FunctionComposition.cc.

27{
28 delete _arg1;
29 delete _arg2;
30}

Member Function Documentation

◆ dimensionality()

unsigned int Genfun::FunctionComposition::dimensionality ( ) const
overridevirtual

Reimplemented from Genfun::AbsFunction.

Definition at line 32 of file FunctionComposition.cc.

32 {
33 return _arg2->dimensionality();
34}
virtual unsigned int dimensionality() const
Definition: AbsFunction.cc:79

Referenced by operator()().

◆ hasAnalyticDerivative()

virtual bool Genfun::FunctionComposition::hasAnalyticDerivative ( ) const
inlineoverridevirtual

Reimplemented from Genfun::AbsFunction.

Definition at line 46 of file FunctionComposition.hh.

46{return true;}

◆ operator()() [1/2]

double Genfun::FunctionComposition::operator() ( const Argument a) const
overridevirtual

Implements Genfun::AbsFunction.

Definition at line 50 of file FunctionComposition.cc.

50 {
51 if (v.dimension()!=_arg2->dimensionality()) {
52 std::cerr
53 << "Warning: FunctionComposition function/argument dimension mismatch"
54 << std::endl;
55 assert(0);
56 return 0;
57 }
58 else {
59 return (*_arg1)((*_arg2)(v));
60 }
61}

◆ operator()() [2/2]

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

Implements Genfun::AbsFunction.

Definition at line 36 of file FunctionComposition.cc.

36 {
37 if (dimensionality()!=1) {
38 std::cerr
39 << "Warning: LifetimeResolutionConvolution function/argument "
40 << "dimension mismatch"
41 << std::endl;
42 assert(0);
43 return 0;
44 }
45 else {
46 return (*_arg1)((*_arg2)(argument));
47 }
48}
virtual unsigned int dimensionality() const override

◆ partial()

Derivative Genfun::FunctionComposition::partial ( unsigned int  index) const
overridevirtual

Reimplemented from Genfun::AbsFunction.

Definition at line 64 of file FunctionComposition.cc.

64 {
65 const AbsFunction & fPrime = (_arg1->partial(0))(*_arg2)*_arg2->partial(index);
66 return Derivative(&fPrime);
67}
virtual Derivative partial(unsigned int) const
Definition: AbsFunction.cc:40
FunctionNoop Derivative
Definition: AbsFunction.hh:42

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