CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

CLHEP/GenericFunctions/FloatingConstant.hh
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id: FloatingConstant.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $
3 //----------------------FloatingConstant -----------------------------------//
4 // //
5 // Class FloatingConstant //
6 // Joe Boudreau, Petar Maksimovic, Nov. 1999 //
7 // //
8 // FloatingConstant allows use to treat constants as floating-constant //
9 // functions so that they automatically will inherit all the algebraic //
10 // operations we have so painstakingly defined for functions. //
11 // //
12 //--------------------------------------------------------------------------//
13 #ifndef FloatingConstant_h
14 #define FloatingConstant_h 1
17 
18 namespace Genfun {
19 
24  class FloatingConstant : public AbsFunction {
25 
27 
28  public:
29 
30  // Constructor
31  FloatingConstant(const AbsParameter & p);
32 
33  // Copy constructor
34  FloatingConstant(const FloatingConstant &right);
35 
36  // Destructor
37  virtual ~FloatingConstant();
38 
39  // Retrieve the parameter:
40  AbsParameter & value();
41 
42  // Retrieve function value
43  virtual double operator ()(double argument) const;
44  virtual double operator ()(const Argument & a) const {return operator() (a[0]);}
45 
46  // Derivative.
47  Derivative partial (unsigned int) const;
48 
49  // Does this function have an analytic derivative?
50  virtual bool hasAnalyticDerivative() const {return true;}
51 
52  private:
53 
54  // It is illegal to assign a fixed constant
55  const FloatingConstant & operator=(const FloatingConstant &right);
56 
57  // The value of the constant:
58  AbsParameter *_value;
59  };
60 } // namespace Genfun
61 #endif
#define FUNCTION_OBJECT_DEF(classname)
Derivative partial(unsigned int) const
FloatingConstant(const AbsParameter &p)
virtual double operator()(double argument) const
@ a