CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
GenericFunctions
src
FunctionTimesParameter.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
// $Id: FunctionTimesParameter.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
3
#include "
CLHEP/GenericFunctions/FunctionTimesParameter.hh
"
4
#include "
CLHEP/GenericFunctions/Parameter.hh
"
5
6
namespace
Genfun {
7
FUNCTION_OBJECT_IMP
(FunctionTimesParameter)
8
9
FunctionTimesParameter
::
FunctionTimesParameter
(const
AbsParameter
*parameter, const
AbsFunction
*function):
10
_function
(function->clone()),
11
_parameter(parameter->clone())
12
{
13
if
(parameter->parameter() && _parameter->parameter()) {
14
_parameter->parameter()->connectFrom(parameter->parameter());
15
}
16
}
17
18
FunctionTimesParameter::FunctionTimesParameter
(
const
FunctionTimesParameter
& right) :
19
AbsFunction
(right),
20
_function
(right.
_function
->clone()),
21
_parameter(right._parameter->clone())
22
{}
23
24
unsigned
int
FunctionTimesParameter::dimensionality
()
const
{
25
return
_function->
dimensionality
();
26
}
27
28
FunctionTimesParameter::~FunctionTimesParameter
()
29
{
30
delete
_function;
31
delete
_parameter;
32
}
33
34
35
double
FunctionTimesParameter::operator ()
(
double
x)
const
36
{
37
return
_parameter->
getValue
() * (*_function)(x);
38
}
39
40
41
double
FunctionTimesParameter::operator ()
(
const
Argument
& x)
const
42
{
43
return
_parameter->
getValue
() * (*_function)(x);
44
}
45
46
47
48
49
Derivative
FunctionTimesParameter::partial
(
unsigned
int
index)
const
{
50
const
AbsFunction
& fPrime = (*_parameter)*(_function->
partial
(index));
51
return
Derivative
(&fPrime);
52
}
53
54
}
// namespace Genfun
Generated on Mon May 6 2013 04:04:10 for CLHEP by
1.8.1.2