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

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