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

#include <ConstOverFunction.hh>

+ Inheritance diagram for Genfun::ConstOverFunction:

Public Member Functions

 ConstOverFunction (double constant, const AbsFunction *arg)
 
 ConstOverFunction (const ConstOverFunction &right)
 
virtual ~ConstOverFunction ()
 
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 ConstOverFunction.hh.

Constructor & Destructor Documentation

◆ ConstOverFunction() [1/2]

Genfun::ConstOverFunction::ConstOverFunction ( double  constant,
const AbsFunction arg 
)

Definition at line 8 of file ConstOverFunction.cc.

8 :
9 _constant(constant),
10 _arg(arg->clone())
11{
12}

◆ ConstOverFunction() [2/2]

Genfun::ConstOverFunction::ConstOverFunction ( const ConstOverFunction right)

Definition at line 14 of file ConstOverFunction.cc.

14 :
15AbsFunction(right),
16_constant(right._constant),
17_arg(right._arg->clone())
18{}

◆ ~ConstOverFunction()

Genfun::ConstOverFunction::~ConstOverFunction ( )
virtual

Definition at line 24 of file ConstOverFunction.cc.

25{
26 delete _arg;
27}

Member Function Documentation

◆ dimensionality()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 20 of file ConstOverFunction.cc.

20 {
21 return _arg->dimensionality();
22}
virtual unsigned int dimensionality() const
Definition: AbsFunction.cc:79

◆ hasAnalyticDerivative()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 46 of file ConstOverFunction.hh.

46{return true;}

◆ operator()() [1/2]

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

Implements Genfun::AbsFunction.

Definition at line 37 of file ConstOverFunction.cc.

38{
39 return _constant / (*_arg)(x);
40}

◆ operator()() [2/2]

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

Implements Genfun::AbsFunction.

Definition at line 31 of file ConstOverFunction.cc.

32{
33 return _constant / (*_arg)(x);
34}

◆ partial()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 43 of file ConstOverFunction.cc.

43 {
44 // d/dx (k/f) = -(k/f^2)(df/dx)
45 const AbsFunction & fPrime = -_constant/(*_arg)/(*_arg)*(_arg->partial(index));
46 return Derivative(& fPrime);
47}
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: