CLHEP/GenericFunctions/Variable.hh

00001 // -*- C++ -*-
00002 // $Id: Variable.hh,v 1.5 2002/04/12 15:02:40 evc Exp $
00003 //----------------------X------------ --------------------------------------//
00004 //                                                                          //
00005 //  Class Variable                                                          //
00006 //  Joe Boudreau, Petar Maksimovic, Nov. 1999                               //
00007 //                                                                          //
00008 //  Variable is a function that returns the variable itself.                //
00009 //--------------------------------------------------------------------------//
00010 #ifndef Variable_h
00011 #define Variable_h 1
00012 #include "CLHEP/GenericFunctions/AbsFunction.hh"
00013 namespace Genfun {
00014 
00019   class Variable : public AbsFunction  {
00020   
00021     FUNCTION_OBJECT_DEF(Variable)
00022 
00023       public:
00024 
00025     // Constructor
00026     Variable(unsigned int selectionIndex=0);
00027   
00028     // Copy constructor
00029     Variable(const Variable &right);
00030   
00031     // Destructor
00032     virtual ~Variable();
00033   
00034     // Retrieve function value
00035     virtual double operator ()(double argument) const; 
00036     virtual double operator ()(const Argument & a) const;
00037   
00038     // Get the selectionIndex:
00039     unsigned int index() const;
00040 
00041     // Derivative.  
00042     Derivative partial (unsigned int) const;
00043 
00044     // Does this function have an analytic derivative?
00045     virtual bool hasAnalyticDerivative() const {return true;}
00046 
00047   private:
00048 
00049     // It is illegal to assign a fixed constant
00050     const Variable & operator=(const Variable &right);
00051 
00052     // The selection index is used to select a particular element from
00053     // the argument.  By default it is zero.....
00054     unsigned int _selectionIndex;
00055 
00056   };
00057 } // namespace Genfun
00058 #endif

Class Library for High Energy Physics (version 1.8)