CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
GenericFunctions
src
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
6
namespace
Genfun {
7
FUNCTION_OBJECT_IMP
(ConstMinusFunction)
8
9
ConstMinusFunction
::
ConstMinusFunction
(
double
constant, const
AbsFunction
*arg):
10
_constant(constant),
11
_arg(arg->clone())
12
{
13
}
14
15
ConstMinusFunction::ConstMinusFunction
(
const
ConstMinusFunction
& right) :
16
AbsFunction
(right),
17
_constant(right._constant),
18
_arg(right._arg->clone())
19
{}
20
21
unsigned
int
ConstMinusFunction::dimensionality
()
const
{
22
return
_arg->
dimensionality
();
23
}
24
25
ConstMinusFunction::~ConstMinusFunction
()
26
{
27
delete
_arg;
28
}
29
30
31
32
double
ConstMinusFunction::operator ()
(
double
x)
const
33
{
34
return
_constant - (*_arg)(x);
35
}
36
37
38
double
ConstMinusFunction::operator ()
(
const
Argument
& x)
const
39
{
40
return
_constant - (*_arg)(x);
41
}
42
43
44
Derivative
ConstMinusFunction::partial
(
unsigned
int
index)
const
{
45
const
AbsFunction
& fPrime = -_arg->
partial
(index);
46
return
Derivative
(& fPrime);
47
}
48
49
50
}
// namespace Genfun
Generated on Mon May 6 2013 04:04:10 for CLHEP by
1.8.1.2