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

Erf.cc
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: Erf.cc,v 1.6 2010/06/16 18:22:01 garren Exp $
3
4#include <cmath>
5
8#include <assert.h>
9namespace Genfun {
11
13{
14 _incompleteGamma.a().setValue(0.5);
15}
16
17Erf::Erf(const Erf & right):
18 AbsFunction(right), _incompleteGamma(right._incompleteGamma)
19{
20}
21
23}
24
25double Erf::operator() (double x) const {
26 return x<0 ? -_incompleteGamma(x*x): _incompleteGamma(x*x);
27}
28
29
30
31Derivative Erf::partial(unsigned int index) const {
32 assert(index==0);
33 Gaussian gauss = Gaussian();
34 gauss.sigma().setValue(sqrt(2.0));
35 const AbsFunction & fPrime = 2.0*gauss;
36 return Derivative(& fPrime);
37}
38
39} // namespace Genfun
#define FUNCTION_OBJECT_IMP(classname)
Derivative partial(unsigned int) const
Definition: Erf.cc:31
virtual ~Erf()
Definition: Erf.cc:22
virtual double operator()(double argument) const
Definition: Erf.cc:25
Erf()
Definition: Erf.cc:12
Parameter & sigma()
Definition: Gaussian.cc:44
void setValue(double value)
Definition: Parameter.cc:57