GeoModel - GeoModelCore
ConstOverParameter.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/ConstOverParameter.h"
8 #include "GeoGenericFunctions/Parameter.h"
9 
10 namespace GeoGenfun {
11 PARAMETER_OBJECT_IMP(ConstOverParameter)
12 
13 ConstOverParameter::ConstOverParameter(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 ConstOverParameter::ConstOverParameter(const ConstOverParameter & right) :
21 AbsParameter(right),
22 _constant(right._constant),
23 _parameter(right._parameter->clone())
24 {}
25 
26 
27 ConstOverParameter::~ConstOverParameter()
28 {
29  delete _parameter;
30 }
31 
32 
33 double ConstOverParameter::getValue() const {
34  return _constant / _parameter->getValue();
35 }
36 
37 } // namespace GeoGenfun
Definition: Abs.h:15