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

#include <LogisticFunction.hh>

+ Inheritance diagram for Genfun::LogisticFunction:

Public Member Functions

 LogisticFunction ()
 
 LogisticFunction (const LogisticFunction &right)
 
virtual ~LogisticFunction ()
 
virtual double operator() (double argument) const override
 
virtual double operator() (const Argument &arg) const override
 
Parameterx0 ()
 
const Parameterx0 () const
 
Parametera ()
 
const Parametera () const
 
- 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 LogisticFunction.hh.

Constructor & Destructor Documentation

◆ LogisticFunction() [1/2]

Genfun::LogisticFunction::LogisticFunction ( )

Definition at line 14 of file LogisticFunction.cc.

14 :
15 _x0("X0", 0.0,0.0,1.0),
16 _a("A",2.0,1.0, 4.0)
17{}

◆ LogisticFunction() [2/2]

Genfun::LogisticFunction::LogisticFunction ( const LogisticFunction right)

Definition at line 22 of file LogisticFunction.cc.

22 :
23AbsFunction(right),
24_x0(right._x0),
25_a(right._a)
26{
27}

◆ ~LogisticFunction()

Genfun::LogisticFunction::~LogisticFunction ( )
virtual

Definition at line 19 of file LogisticFunction.cc.

19 {
20}

Member Function Documentation

◆ a() [1/2]

Parameter & Genfun::LogisticFunction::a ( )

Definition at line 66 of file LogisticFunction.cc.

66 {
67 return _a;
68}

◆ a() [2/2]

const Parameter & Genfun::LogisticFunction::a ( ) const

Definition at line 74 of file LogisticFunction.cc.

74 {
75 return _a;
76}

◆ operator()() [1/2]

virtual double Genfun::LogisticFunction::operator() ( const Argument arg) const
inlineoverridevirtual

Implements Genfun::AbsFunction.

Definition at line 37 of file LogisticFunction.hh.

37{return operator() (arg[0]); }
virtual double operator()(double argument) const override

◆ operator()() [2/2]

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

Implements Genfun::AbsFunction.

Definition at line 29 of file LogisticFunction.cc.

29 {
30 int i = (int) (x+0.5), &back = i, end=back+1;
31
32 if (i<0 || i>MAXRANGE) {
33 return 0;
34 }
35 else {
36 // Is the vector of values stale?
37 if (__a!=_a.getValue() || __x0!=_x0.getValue()) {
38
39 // Empty the vector
40 fx.erase(fx.begin(),fx.end());
41
42 // And update the cache.
43 __a = _a.getValue();
44 __x0 = _x0.getValue();
45
46 }
47
48
49 if (fx.empty()) fx.push_back(__x0);
50
51 while (fx.size()<size_t(end)) {
52 double v = fx.back();
53 fx.push_back(__a*v*(1.0-v));
54 }
55
56 return fx[i];
57 }
58
59
60}
#define MAXRANGE
virtual double getValue() const
Definition: Parameter.cc:29

Referenced by operator()().

◆ x0() [1/2]

Parameter & Genfun::LogisticFunction::x0 ( )

Definition at line 62 of file LogisticFunction.cc.

62 {
63 return _x0;
64}

◆ x0() [2/2]

const Parameter & Genfun::LogisticFunction::x0 ( ) const

Definition at line 70 of file LogisticFunction.cc.

70 {
71 return _x0;
72}

The documentation for this class was generated from the following files: