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

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