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

ConstPlusFunction.cc
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: ConstPlusFunction.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
4
5namespace Genfun {
6FUNCTION_OBJECT_IMP(ConstPlusFunction)
7
8ConstPlusFunction::ConstPlusFunction(double constant, const AbsFunction *arg):
9 _constant(constant),
10 _arg(arg->clone())
11{
12}
13
15AbsFunction(right),
16_constant(right._constant),
17_arg(right._arg->clone())
18{}
19
21 return _arg->dimensionality();
22}
23
25{
26 delete _arg;
27}
28
29
30
31double ConstPlusFunction::operator ()(double x) const
32{
33 return _constant + (*_arg)(x);
34}
35
36
38{
39 return _constant + (*_arg)(x);
40}
41
42
43Derivative ConstPlusFunction::partial(unsigned int index) const {
44 return _arg->partial(index);
45}
46
47
48} // namespace Genfun
#define FUNCTION_OBJECT_IMP(classname)
virtual Derivative partial(unsigned int) const
virtual unsigned int dimensionality() const
virtual unsigned int dimensionality() const
ConstPlusFunction(double constant, const AbsFunction *arg)
Derivative partial(unsigned int) const
virtual double operator()(double argument) const