CLHEP 2.4.7.1
C++ Class Library for High Energy Physics
Square.hh
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: Square.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $
3//----------------------Square------- --------------------------------------//
4// //
5// Class Square //
6// Joe Boudreau, Petar Maksimovic, Nov. 1999 //
7// //
8// Square(x) returns x*x. //
9//--------------------------------------------------------------------------//
10#ifndef Square_h
11#define Square_h 1
13namespace Genfun {
14
19 class Square : public AbsFunction {
20
22
23 public:
24
25 // Constructor
27
28 // Copy constructor
29 Square(const Square &right);
30
31 // Destructor
32 virtual ~Square();
33
34 // Retrieve function value
35 virtual double operator ()(double argument) const override;
36 virtual double operator ()(const Argument & a) const override {return operator() (a[0]);}
37
38 // Derivative.
39 Derivative partial (unsigned int) const override;
40
41 // Does this function have an analytic derivative?
42 virtual bool hasAnalyticDerivative() const override {return true;}
43
44 private:
45
46 // It is illegal to assign a fixed constant
47 const Square & operator=(const Square &right);
48
49 };
50} // namespace Genfun
51#endif
#define FUNCTION_OBJECT_DEF(classname)
virtual ~Square()
virtual double operator()(double argument) const override
Square(const Square &right)
virtual bool hasAnalyticDerivative() const override
Definition Square.hh:42
Derivative partial(unsigned int) const override
Definition Abs.hh:14
FunctionNoop Derivative