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

#include <ConstTimesFunction.hh>

+ Inheritance diagram for Genfun::ConstTimesFunction:

Public Member Functions

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

Constructor & Destructor Documentation

◆ ConstTimesFunction() [1/2]

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

Definition at line 8 of file ConstTimesFunction.cc.

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

◆ ConstTimesFunction() [2/2]

Genfun::ConstTimesFunction::ConstTimesFunction ( const ConstTimesFunction right)

Definition at line 14 of file ConstTimesFunction.cc.

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

◆ ~ConstTimesFunction()

Genfun::ConstTimesFunction::~ConstTimesFunction ( )
virtual

Definition at line 24 of file ConstTimesFunction.cc.

25{
26 delete _arg;
27}

Member Function Documentation

◆ dimensionality()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 20 of file ConstTimesFunction.cc.

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

◆ hasAnalyticDerivative()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 45 of file ConstTimesFunction.hh.

45{return true;}

◆ operator()() [1/2]

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

Implements Genfun::AbsFunction.

Definition at line 37 of file ConstTimesFunction.cc.

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

◆ operator()() [2/2]

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

Implements Genfun::AbsFunction.

Definition at line 31 of file ConstTimesFunction.cc.

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

◆ partial()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 42 of file ConstTimesFunction.cc.

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