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

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
a
@ a
Definition: testCategories.cc:125
Parameter.hh
Genfun::FloatingConstant::hasAnalyticDerivative
virtual bool hasAnalyticDerivative() const
Definition: GenericFunctions/FloatingConstant.hh:50
Genfun::FloatingConstant::FloatingConstant
FloatingConstant(const AbsParameter &p)
Definition: FloatingConstant.cc:9
Genfun::FloatingConstant::partial
Derivative partial(unsigned int) const
Definition: FloatingConstant.cc:32
Genfun::FloatingConstant::value
AbsParameter & value()
Definition: FloatingConstant.cc:23
AbsFunction.hh
Genfun::FloatingConstant
Definition: CLHEP/GenericFunctions/FloatingConstant.hh:24
Genfun::FloatingConstant::~FloatingConstant
virtual ~FloatingConstant()
Definition: FloatingConstant.cc:19
Genfun::AbsParameter
Definition: CLHEP/GenericFunctions/AbsParameter.hh:22
Genfun::Argument
Definition: CLHEP/GenericFunctions/Argument.hh:17
Genfun::FunctionNoop
Definition: CLHEP/GenericFunctions/FunctionNoop.hh:19
Genfun::FloatingConstant::operator()
virtual double operator()(double argument) const
Definition: FloatingConstant.cc:27
FUNCTION_OBJECT_DEF
#define FUNCTION_OBJECT_DEF(classname)
Definition: CLHEP/GenericFunctions/AbsFunction.hh:144
Genfun
Definition: CLHEP/GenericFunctions/Abs.hh:14