CLHEP VERSION Reference Documentation
CLHEP Home Page CLHEP Documentation CLHEP Bug Reports |
00001 // -*- C++ -*- 00002 // $Id: FloatingConstant.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $ 00003 #include "CLHEP/GenericFunctions/FloatingConstant.hh" 00004 #include "CLHEP/GenericFunctions/FixedConstant.hh" 00005 #include <assert.h> 00006 namespace Genfun { 00007 FUNCTION_OBJECT_IMP(FloatingConstant) 00008 00009 FloatingConstant::FloatingConstant(const AbsParameter & p): 00010 _value(p.clone()) 00011 { 00012 if (_value->parameter() && p.parameter()) _value->parameter()->connectFrom(&p); 00013 } 00014 00015 FloatingConstant::FloatingConstant(const FloatingConstant & right): 00016 AbsFunction(right), _value(right._value->clone()) { 00017 } 00018 00019 FloatingConstant::~FloatingConstant() 00020 { 00021 } 00022 00023 AbsParameter & FloatingConstant::value() { 00024 return *_value; 00025 } 00026 00027 double FloatingConstant::operator ()(double) const 00028 { 00029 return _value->getValue(); 00030 } 00031 00032 Derivative FloatingConstant::partial(unsigned int index) const { 00033 assert(index==0); 00034 FixedConstant fPrime(0.0); 00035 return Derivative(&fPrime); 00036 } 00037 } // namespace Genfun