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

#include <FunctionProduct.hh>

+ Inheritance diagram for Genfun::FunctionProduct:

Public Member Functions

 FunctionProduct (const AbsFunction *arg1, const AbsFunction *arg2)
 
 FunctionProduct (const FunctionProduct &right)
 
virtual ~FunctionProduct ()
 
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 19 of file FunctionProduct.hh.

Constructor & Destructor Documentation

◆ FunctionProduct() [1/2]

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

Definition at line 10 of file FunctionProduct.cc.

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

◆ FunctionProduct() [2/2]

Genfun::FunctionProduct::FunctionProduct ( const FunctionProduct right)

Definition at line 22 of file FunctionProduct.cc.

22 :
23 AbsFunction(right),
24 _arg1(right._arg1->clone()),
25 _arg2(right._arg2->clone())
26{
27}

◆ ~FunctionProduct()

Genfun::FunctionProduct::~FunctionProduct ( )
virtual

Definition at line 29 of file FunctionProduct.cc.

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

Member Function Documentation

◆ dimensionality()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 36 of file FunctionProduct.cc.

36 {
37 return _arg1->dimensionality();
38}
virtual unsigned int dimensionality() const
Definition: AbsFunction.cc:79

◆ hasAnalyticDerivative()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 45 of file FunctionProduct.hh.

45{return true;}

◆ operator()() [1/2]

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

Implements Genfun::AbsFunction.

Definition at line 45 of file FunctionProduct.cc.

46{
47 return (*_arg1)(x)*(*_arg2)(x);
48}

◆ operator()() [2/2]

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

Implements Genfun::AbsFunction.

Definition at line 40 of file FunctionProduct.cc.

41{
42 return (*_arg1)(x)*(*_arg2)(x);
43}

◆ partial()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 50 of file FunctionProduct.cc.

50 {
51 const AbsFunction & fPrime =
52 (*_arg1)*(_arg2->partial(index)) + (_arg1->partial(index))*(*_arg2);
53 return Derivative(&fPrime);
54}
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: