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

KroneckerDelta.cc
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: KroneckerDelta.cc,v 1.1 2007/01/21 20:54:34 boudreau Exp $
5#include <assert.h>
6
7namespace Genfun {
8FUNCTION_OBJECT_IMP(KroneckerDelta)
9
11{}
12
14{
15}
16
18}
19
20double KroneckerDelta::operator() (double x) const {
21 if (x < 0.5 && x > -0.5) return 1;
22 return 0;
23}
24
25
26Derivative KroneckerDelta::partial(unsigned int index) const {
27 assert(index==0);
28 const AbsFunction & fPrime = FixedConstant(0);;
29 return Derivative(&fPrime);
30}
31
32} // namespace Genfun
#define FUNCTION_OBJECT_IMP(classname)
Derivative partial(unsigned int) const
virtual double operator()(double argument) const