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

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