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

Sqrt.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id: Sqrt.cc,v 1.7 2010/06/16 18:22:01 garren Exp $
4 #include <assert.h>
5 #include <cmath> // for sqrt
6 namespace Genfun {
8 
10 {}
11 
12 Sqrt::Sqrt(const Sqrt & right) : AbsFunction(right)
13 {
14 }
15 
17 }
18 
19 double Sqrt::operator() (double x) const {
20  return sqrt(x);
21 }
22 
23 
24 Derivative Sqrt::partial(unsigned int index) const {
25  assert(index==0);
26  const AbsFunction & fPrime = (0.5)/Sqrt();
27  return Derivative(&fPrime);
28 }
29 
30 
31 } // namespace Genfun
Derivative partial(unsigned int) const
Definition: Sqrt.cc:24
Sqrt()
Definition: Sqrt.cc:9
virtual ~Sqrt()
Definition: Sqrt.cc:16
#define FUNCTION_OBJECT_IMP(classname)
virtual double operator()(double argument) const
Definition: Sqrt.cc:19