CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
GenericFunctions
src
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 $
3
#include "
CLHEP/GenericFunctions/Sqrt.hh
"
4
#include <assert.h>
5
#include <cmath>
// for sqrt
6
namespace
Genfun {
7
FUNCTION_OBJECT_IMP
(Sqrt)
8
9
Sqrt
::
Sqrt
()
10
{}
11
12
Sqrt::Sqrt
(
const
Sqrt
& right) :
AbsFunction
(right)
13
{
14
}
15
16
Sqrt::~Sqrt
() {
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
Generated on Mon May 6 2013 04:04:11 for CLHEP by
1.8.1.2