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

#include <FunctionQuotient.hh>

+ Inheritance diagram for Genfun::FunctionQuotient:

Public Member Functions

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

Constructor & Destructor Documentation

◆ FunctionQuotient() [1/2]

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

Definition at line 10 of file FunctionQuotient.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 quotient"
17 << std::endl;
18 assert(0);
19 }
20}

◆ FunctionQuotient() [2/2]

Genfun::FunctionQuotient::FunctionQuotient ( const FunctionQuotient right)

Definition at line 22 of file FunctionQuotient.cc.

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

◆ ~FunctionQuotient()

Genfun::FunctionQuotient::~FunctionQuotient ( )
virtual

Definition at line 27 of file FunctionQuotient.cc.

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

Member Function Documentation

◆ dimensionality()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 33 of file FunctionQuotient.cc.

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

◆ hasAnalyticDerivative()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 45 of file FunctionQuotient.hh.

45{return true;}

◆ operator()() [1/2]

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

Implements Genfun::AbsFunction.

Definition at line 43 of file FunctionQuotient.cc.

44{
45 return (*_arg1)(x)/(*_arg2)(x);
46}

◆ operator()() [2/2]

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

Implements Genfun::AbsFunction.

Definition at line 38 of file FunctionQuotient.cc.

39{
40 return (*_arg1)(x)/(*_arg2)(x);
41}

◆ partial()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 49 of file FunctionQuotient.cc.

49 {
50 const AbsFunction & fPrime =
51 ((_arg1->partial(index))*(*_arg2)-(*_arg1)*(_arg2->partial(index))) /
52 (*_arg2)/ (*_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: