GeoModel - GeoModelCore
Square.h
1 //==========================================================================//
2 // Imported from the QAT library (qat.pitt.edu) by the copyright holder //
3 // Joe Boudreau. Software licensed under the terms and conditions of the //
4 // GNU Lesser Public License v3. //
5 //==========================================================================//
6 //--------------------------------------------------------------------------//
7 // Class Square //
8 // Square(x) returns x*x. //
9 //--------------------------------------------------------------------------//
10 #ifndef Square_h
11 #define Square_h 1
12 #include "GeoGenericFunctions/AbsFunction.h"
13 namespace GeoGenfun {
14 
15  class Square : public AbsFunction {
16 
17  FUNCTION_OBJECT_DEF(Square)
18 
19  public:
20 
21  // Constructor
22  Square();
23 
24  // Copy constructor
25  Square(const Square &right);
26 
27  // Destructor
28  virtual ~Square();
29 
30  // Retrieve function value
31  virtual double operator ()(double argument) const override;
32  virtual double operator ()(const Argument & a) const override {return operator() (a[0]);}
33 
34  // Derivative.
35  virtual Derivative partial (unsigned int) const override;
36 
37  // Does this function have an analytic derivative?
38  virtual bool hasAnalyticDerivative() const override {return true;}
39 
40  private:
41 
42  // It is illegal to assign a fixed constant
43  const Square & operator=(const Square &right);
44 
45  };
46 } // namespace GeoGenfun
47 #endif
Definition: Abs.h:15