CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
Variable.hh
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: Variable.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $
3//----------------------X------------ --------------------------------------//
4// //
5// Class Variable //
6// Joe Boudreau, Petar Maksimovic, Nov. 1999 //
7// //
8// Variable is a function that returns the variable itself. //
9//--------------------------------------------------------------------------//
10#ifndef Variable_h
11#define Variable_h 1
12#include "CLHEP/GenericFunctions/AbsFunction.hh"
13namespace Genfun {
14
15 /**
16 * @author
17 * @ingroup genfun
18 */
19 class Variable : public AbsFunction {
20
22
23 public:
24
25 // Constructor
26 Variable(unsigned int selectionIndex=0,
27 unsigned int dimensionality=1);
28
29 // Copy constructor
30 Variable(const Variable &right);
31
32 // Destructor
33 virtual ~Variable();
34
35 // Retrieve function value
36 virtual double operator ()(double argument) const override;
37 virtual double operator ()(const Argument & a) const override;
38
39 // Get the dimensionality, as specified in the constructor:
40 virtual unsigned int dimensionality() const override ;
41
42 // Get the selectionIndex:
43 unsigned int index() const;
44
45 // Derivative.
46 Derivative partial (unsigned int) const override;
47
48 // Does this function have an analytic derivative?
49 virtual bool hasAnalyticDerivative() const override {return true;}
50
51 private:
52
53 // It is illegal to assign a fixed constant
54 const Variable & operator=(const Variable &right);
55
56 // The selection index is used to select a particular element from
57 // the argument. By default it is zero.....
58 unsigned int _selectionIndex;
59
60 // The dimensionality, length of the argument list:
61 unsigned int _dimensionality;
62
63 };
64
65} // namespace Genfun
66#endif
#define FUNCTION_OBJECT_DEF(classname)
Definition: AbsFunction.hh:143
Derivative partial(unsigned int) const override
Definition: Variable.cc:39
unsigned int index() const
Definition: Variable.cc:34
virtual double operator()(double argument) const override
Definition: Variable.cc:24
virtual ~Variable()
Definition: Variable.cc:21
virtual unsigned int dimensionality() const override
Definition: Variable.cc:53
virtual bool hasAnalyticDerivative() const override
Definition: Variable.hh:49
Definition: Abs.hh:14