CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
GenericFunctions
src
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 $
3
#include "
CLHEP/GenericFunctions/FunctionNegation.hh
"
4
5
namespace
Genfun {
6
FUNCTION_OBJECT_IMP
(FunctionNegation)
7
8
FunctionNegation
::
FunctionNegation
(const
AbsFunction
*arg1):
9
_arg1(arg1->clone())
10
{
11
}
12
13
FunctionNegation::FunctionNegation
(
const
FunctionNegation
& right):
14
_arg1(right._arg1->clone())
15
{
16
}
17
18
19
FunctionNegation::~FunctionNegation
()
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
Generated on Sun Jun 17 2012 08:08:26 for CLHEP by
1.8.1.1