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
6namespace Genfun {
8
10{}
11
12Sqrt::Sqrt(const Sqrt & right) : AbsFunction(right)
13{
14}
15
17}
18
19double Sqrt::operator() (double x) const {
20 return sqrt(x);
21}
22
23
24Derivative 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
#define FUNCTION_OBJECT_IMP(classname)
virtual ~Sqrt()
Definition: Sqrt.cc:16
virtual double operator()(double argument) const
Definition: Sqrt.cc:19
Sqrt()
Definition: Sqrt.cc:9
Derivative partial(unsigned int) const
Definition: Sqrt.cc:24