CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

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 $
5 
6 namespace Genfun {
7 FUNCTION_OBJECT_IMP(FunctionTimesParameter)
8 
10  _function(function->clone()),
11  _parameter(parameter->clone())
12 {
13  if (parameter->parameter() && _parameter->parameter()) {
14  _parameter->parameter()->connectFrom(parameter->parameter());
15  }
16 }
17 
19  _function(right._function->clone()),
20  _parameter(right._parameter->clone())
21 {}
22 
24  return _function->dimensionality();
25 }
26 
28 {
29  delete _function;
30  delete _parameter;
31 }
32 
33 
35 {
36  return _parameter->getValue() * (*_function)(x);
37 }
38 
39 
41 {
42  return _parameter->getValue() * (*_function)(x);
43 }
44 
45 
46 
47 
48 Derivative FunctionTimesParameter::partial(unsigned int index) const {
49  const AbsFunction & fPrime = (*_parameter)*(_function->partial(index));
50  return Derivative(&fPrime);
51 }
52 
53 } // namespace Genfun