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

FunctionPlusParameter.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // $Id: FunctionPlusParameter.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
5 
6 namespace Genfun {
7 FUNCTION_OBJECT_IMP(FunctionPlusParameter)
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 
34 double FunctionPlusParameter::operator ()(double x) const
35 {
36  return _parameter->getValue() + (*_function)(x);
37 }
38 
39 
41 {
42  return _parameter->getValue() + (*_function)(x);
43 }
44 
45 Derivative FunctionPlusParameter::partial(unsigned int index) const {
46  return _function->partial(index);
47 }
48 
49 } // namespace Genfun