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

#include <FunctionDifference.hh>

+ Inheritance diagram for Genfun::FunctionDifference:

Public Member Functions

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

Constructor & Destructor Documentation

◆ FunctionDifference() [1/2]

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

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

◆ FunctionDifference() [2/2]

Genfun::FunctionDifference::FunctionDifference ( const FunctionDifference right)

Definition at line 23 of file FunctionDifference.cc.

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

◆ ~FunctionDifference()

Genfun::FunctionDifference::~FunctionDifference ( )
virtual

Definition at line 35 of file FunctionDifference.cc.

36{
37 delete _arg1;
38 delete _arg2;
39}

Member Function Documentation

◆ dimensionality()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 31 of file FunctionDifference.cc.

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

◆ hasAnalyticDerivative()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 46 of file FunctionDifference.hh.

46{return true;}

◆ operator()() [1/2]

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

Implements Genfun::AbsFunction.

Definition at line 48 of file FunctionDifference.cc.

49{
50 return (*_arg1)(x)-(*_arg2)(x);
51}

◆ operator()() [2/2]

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

Implements Genfun::AbsFunction.

Definition at line 43 of file FunctionDifference.cc.

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

◆ partial()

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

Reimplemented from Genfun::AbsFunction.

Definition at line 54 of file FunctionDifference.cc.

54 {
55 const AbsFunction & fPrime = _arg1->partial(index) - _arg2->partial(index);
56 return Derivative(&fPrime);
57}
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: