Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:03:27

0001 // -*- C++ -*-
0002 // $Id: Variable.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $
0003 //----------------------X------------ --------------------------------------//
0004 //                                                                          //
0005 //  Class Variable                                                          //
0006 //  Joe Boudreau, Petar Maksimovic, Nov. 1999                               //
0007 //                                                                          //
0008 //  Variable is a function that returns the variable itself.                //
0009 //--------------------------------------------------------------------------//
0010 #ifndef Variable_h
0011 #define Variable_h 1
0012 #include "CLHEP/GenericFunctions/AbsFunction.hh"
0013 namespace Genfun {
0014 
0015   /**
0016    * @author
0017    * @ingroup genfun
0018    */
0019   class Variable : public AbsFunction  {
0020   
0021     FUNCTION_OBJECT_DEF(Variable)
0022 
0023       public:
0024 
0025     // Constructor
0026     Variable(unsigned int selectionIndex=0,
0027              unsigned int dimensionality=1);
0028   
0029     // Copy constructor
0030     Variable(const Variable &right);
0031   
0032     // Destructor
0033     virtual ~Variable();
0034   
0035     // Retrieve function value
0036     virtual double operator ()(double argument) const override; 
0037     virtual double operator ()(const Argument & a) const override;
0038 
0039     // Get the dimensionality, as specified in the constructor:
0040     virtual unsigned int dimensionality() const override ;  
0041   
0042     // Get the selectionIndex:
0043     unsigned int index() const;
0044 
0045     // Derivative.  
0046     Derivative partial (unsigned int) const override;
0047 
0048     // Does this function have an analytic derivative?
0049     virtual bool hasAnalyticDerivative() const override {return true;}
0050 
0051   private:
0052 
0053     // It is illegal to assign a fixed constant
0054     const Variable & operator=(const Variable &right);
0055 
0056     // The selection index is used to select a particular element from
0057     // the argument.  By default it is zero.....
0058     unsigned int _selectionIndex;
0059 
0060     // The dimensionality, length of the argument list:
0061     unsigned int _dimensionality;
0062 
0063   };
0064 
0065 } // namespace Genfun
0066 #endif