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  _arg1(right._arg1->clone())
15 {
16 }
17 
18 
20 {
21  delete _arg1;
22 }
23 
24 unsigned int FunctionNegation::dimensionality() const {
25  return _arg1->dimensionality();
26 }
27 
28 
29 double FunctionNegation::operator ()(double x) const
30 {
31  return -((*_arg1)(x));
32 }
33 
34 double FunctionNegation::operator ()(const Argument & x) const
35 {
36  return -((*_arg1)(x));
37 }
38 
39 
40 Derivative FunctionNegation::partial(unsigned int index) const {
41  const AbsFunction & fPrime = -(_arg1->partial(index));
42  return Derivative(&fPrime);
43 }
44 
45 
46 } // namespace Genfun