CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 // -*- C++ -*- 00002 // $Id: Sqrt.hh,v 1.2 2003/09/06 14:04:13 boudreau Exp $ 00003 //----------------------Sqrt--------- --------------------------------------// 00004 // // 00005 // Class Sqrt // 00006 // Joe Boudreau, Petar Maksimovic, Nov. 1999 // 00007 // // 00008 // Sqrt is a function that returns the square root of the argument // 00009 //--------------------------------------------------------------------------// 00010 #ifndef Sqrt_h 00011 #define Sqrt_h 1 00012 #include "CLHEP/GenericFunctions/AbsFunction.hh" 00013 namespace Genfun { 00014 00019 class Sqrt : public AbsFunction { 00020 00021 FUNCTION_OBJECT_DEF(Sqrt) 00022 00023 public: 00024 00025 // Constructor 00026 Sqrt(); 00027 00028 // Copy constructor 00029 Sqrt(const Sqrt &right); 00030 00031 // Destructor 00032 virtual ~Sqrt(); 00033 00034 // Retrieve function value 00035 virtual double operator ()(double argument) const; 00036 virtual double operator ()(const Argument & a) const {return operator() (a[0]);} 00037 00038 // Derivative. 00039 Derivative partial (unsigned int) const; 00040 00041 // Does this function have an analytic derivative? 00042 virtual bool hasAnalyticDerivative() const {return true;} 00043 00044 private: 00045 00046 // It is illegal to assign a fixed constant 00047 const Sqrt & operator=(const Sqrt &right); 00048 00049 }; 00050 } // namespace Genfun 00051 #endif 00052 00053