CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
FixedConstant.hh
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: FixedConstant.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $
3//----------------------FixedConstant --------------------------------------//
4// //
5// Class FixedConstant //
6// Joe Boudreau, Petar Maksimovic, Nov. 1999 //
7// //
8// FixedConstant allows use to treat "promote" fixed contants to 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 FixedConstant_h
14#define FixedConstant_h 1
15#include "CLHEP/GenericFunctions/AbsFunction.hh"
16
17namespace Genfun {
18
19 /**
20 * @author
21 * @ingroup genfun
22 */
23 class FixedConstant : public AbsFunction {
24
26
27 public:
28
29 // Constructor
30 FixedConstant(double value);
31
32 // Copy constructor
33 FixedConstant(const FixedConstant &right);
34
35 // Destructor
36 virtual ~FixedConstant();
37
38 // Retrieve function value
39 virtual double operator ()(double argument) const override;
40 virtual double operator ()(const Argument & a) const override {return operator() (a[0]);}
41
42 // Derivative.
43 Derivative partial (unsigned int) const override;
44
45 // Does this function have an analytic derivative?
46 virtual bool hasAnalyticDerivative() const override {return true;}
47
48 private:
49
50 // It is illegal to assign a fixed constant
51 const FixedConstant & operator=(const FixedConstant &right);
52
53 // The value of the constant:
54 double _value;
55 };
56} // namespace Genfun
57#endif
#define FUNCTION_OBJECT_DEF(classname)
Definition: AbsFunction.hh:143
virtual bool hasAnalyticDerivative() const override
virtual double operator()(double argument) const override
Derivative partial(unsigned int) const override
Definition: Abs.hh:14