CLHEP 2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
FloatingConstant.cc
Go to the documentation of this file.
1// -*- C++ -*-
2// $Id: FloatingConstant.cc,v 1.3 2003/09/06 14:04:14 boudreau Exp $
3#include "CLHEP/GenericFunctions/FloatingConstant.hh"
4#include "CLHEP/GenericFunctions/FixedConstant.hh"
5#include <assert.h>
6namespace Genfun {
7FUNCTION_OBJECT_IMP(FloatingConstant)
8
10 _value(p.clone())
11{
12 if (_value->parameter() && p.parameter()) _value->parameter()->connectFrom(&p);
13}
14
16 AbsFunction(right), _value(right._value->clone()) {
17}
18
20{
21}
22
24 return *_value;
25}
26
28{
29 return _value->getValue();
30}
31
32// don't generate warnings about unused parameter inside assert
33#if defined __GNUC__
34 #if __GNUC__ > 3 && __GNUC_MINOR__ > 6
35 #pragma GCC diagnostic push
36 #pragma GCC diagnostic ignored "-Wunused-parameter"
37 #endif
38#endif
39#ifdef __clang__
40 #pragma clang diagnostic push
41 #pragma clang diagnostic ignored "-Wunused-parameter"
42#endif
43Derivative FloatingConstant::partial(unsigned int index) const {
44 assert(index==0);
45 FixedConstant fPrime(0.0);
46 return Derivative(&fPrime);
47}
48#if defined __GNUC__
49 #if __GNUC__ > 3 && __GNUC_MINOR__ > 6
50 #pragma GCC diagnostic pop
51 #endif
52#endif
53#ifdef __clang__
54 #pragma clang diagnostic pop
55#endif
56} // namespace Genfun
#define FUNCTION_OBJECT_IMP(classname)
Definition: AbsFunction.hh:149
virtual double getValue() const =0
Derivative partial(unsigned int) const override
FloatingConstant(const AbsParameter &p)
virtual double operator()(double argument) const override
Definition: Abs.hh:14
FunctionNoop Derivative
Definition: AbsFunction.hh:42