CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
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 $
3#include "CLHEP/GenericFunctions/ConstMinusFunction.hh"
4
5
6namespace Genfun {
7FUNCTION_OBJECT_IMP(ConstMinusFunction)
8
9ConstMinusFunction::ConstMinusFunction(double constant, const AbsFunction *arg):
10 _constant(constant),
11 _arg(arg->clone())
12{
13}
14
16AbsFunction(right),
17_constant(right._constant),
18_arg(right._arg->clone())
19{}
20
22 return _arg->dimensionality();
23}
24
26{
27 delete _arg;
28}
29
30
31
32double ConstMinusFunction::operator ()(double x) const
33{
34 return _constant - (*_arg)(x);
35}
36
37
39{
40 return _constant - (*_arg)(x);
41}
42
43
44Derivative ConstMinusFunction::partial(unsigned int index) const {
45 const AbsFunction & fPrime = -_arg->partial(index);
46 return Derivative(& fPrime);
47}
48
49
50} // namespace Genfun
#define FUNCTION_OBJECT_IMP(classname)
Definition: AbsFunction.hh:149
virtual Derivative partial(unsigned int) const
Definition: AbsFunction.cc:40
virtual unsigned int dimensionality() const
Definition: AbsFunction.cc:79
Derivative partial(unsigned int) const override
virtual double operator()(double argument) const override
ConstMinusFunction(double constant, const AbsFunction *arg)
virtual unsigned int dimensionality() const override
Definition: Abs.hh:14
FunctionNoop Derivative
Definition: AbsFunction.hh:42