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
AbsFunction
(right),
15
_arg1(right._arg1->clone())
16
{
17
}
18
19
20
FunctionNegation::~FunctionNegation
()
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
Generated on Mon May 6 2013 04:04:10 for CLHEP by
1.8.1.2