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

Sqrt.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 // $Id: Sqrt.cc,v 1.7 2010/06/16 18:22:01 garren Exp $
00003 #include "CLHEP/GenericFunctions/Sqrt.hh"
00004 #include <assert.h>
00005 #include <cmath>        // for sqrt
00006 namespace Genfun {
00007 FUNCTION_OBJECT_IMP(Sqrt)
00008 
00009 Sqrt::Sqrt()
00010 {}
00011 
00012 Sqrt::Sqrt(const Sqrt & right) : AbsFunction(right)
00013 {
00014 }
00015 
00016 Sqrt::~Sqrt() {
00017 }
00018 
00019 double Sqrt::operator() (double x) const {
00020   return sqrt(x);
00021 }
00022 
00023 
00024 Derivative Sqrt::partial(unsigned int index) const {
00025   assert(index==0);
00026   const AbsFunction & fPrime = (0.5)/Sqrt();
00027   return Derivative(&fPrime);
00028 }
00029 
00030 
00031 } // namespace Genfun

Generated on 15 Nov 2012 for CLHEP by  doxygen 1.4.7