GeoModel - GeoModelCore
ConstTimesParameter.cpp
1 //==========================================================================//
2 // Imported from the QAT library (qat.pitt.edu) by the copyright holder //
3 // Joe Boudreau. Software licensed under the terms and conditions of the //
4 // GNU Lesser Public License v3. //
5 //==========================================================================//
6 
7 #include "GeoGenericFunctions/ConstTimesParameter.h"
8 #include "GeoGenericFunctions/Parameter.h"
9 
10 namespace GeoGenfun {
11 PARAMETER_OBJECT_IMP(ConstTimesParameter)
12 
13 ConstTimesParameter::ConstTimesParameter(double xconstant, const AbsParameter *aparm):
14  _constant(xconstant),
15  _parameter(aparm->clone())
16 {
17  if (aparm->parameter() && _parameter->parameter()) _parameter->parameter()->connectFrom(aparm->parameter());
18 }
19 
20 ConstTimesParameter::ConstTimesParameter(const ConstTimesParameter & right) :
21 AbsParameter(),
22 _constant(right._constant),
23 _parameter(right._parameter->clone())
24 {}
25 
26 
27 ConstTimesParameter::~ConstTimesParameter()
28 {
29  delete _parameter;
30 }
31 
32 
33 double ConstTimesParameter::getValue() const {
34  return _constant * _parameter->getValue();
35 }
36 
37 
38 } // namespace GeoGenfun
Definition: Abs.h:15