GeoModel - GeoModelCore
Sqrt.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 //----------------------Sqrt--------- --------------------------------------//
7 // //
8 // Class Sqrt //
9 // //
10 // Sqrt is a function that returns the square root of the argument //
11 //--------------------------------------------------------------------------//
12 #ifndef Sqrt_h
13 #define Sqrt_h 1
14 #include "GeoGenericFunctions/AbsFunction.h"
15 namespace GeoGenfun {
16 
17  class Sqrt : public AbsFunction {
18 
19  FUNCTION_OBJECT_DEF(Sqrt)
20 
21  public:
22 
23  // Constructor
24  Sqrt();
25 
26  // Copy constructor
27  Sqrt(const Sqrt &right);
28 
29  // Destructor
30  virtual ~Sqrt();
31 
32  // Retrieve function value
33  virtual double operator ()(double argument) const override;
34  virtual double operator ()(const Argument & a) const override {return operator() (a[0]);}
35 
36  // Derivative.
37  virtual Derivative partial (unsigned int) const override;
38 
39  // Does this function have an analytic derivative?
40  virtual bool hasAnalyticDerivative() const override {return true;}
41 
42  private:
43 
44  // It is illegal to assign a fixed constant
45  const Sqrt & operator=(const Sqrt &right);
46 
47  };
48 } // namespace GeoGenfun
49 #endif
50 
51 
Definition: Abs.h:15