The Gaudi Framework  v30r3 (a5ef0a68)
Constant.h
Go to the documentation of this file.
1 #ifndef GAUDIMATH_CONSTANT_H
2 #define GAUDIMATH_CONSTANT_H 1
3 // ============================================================================
4 // Include files
5 // ============================================================================
6 // CLHEP
7 // ============================================================================
8 #include "CLHEP/GenericFunctions/AbsFunction.hh"
9 // ============================================================================
10 #include "GaudiKernel/Kernel.h"
11 
12 #if defined( __clang__ ) || defined( __CLING__ )
13 #pragma clang diagnostic push
14 #pragma clang diagnostic ignored "-Winconsistent-missing-override"
15 #elif defined( __GNUC__ ) && __GNUC__ >= 5
16 #pragma GCC diagnostic push
17 #pragma GCC diagnostic ignored "-Wsuggest-override"
18 #endif
19 
20 namespace Genfun // due to CLHEP
21 {
22  namespace GaudiMathImplementation
23  {
31  class GAUDI_API Constant : public AbsFunction
32  {
33  public:
35  FUNCTION_OBJECT_DEF( Constant )
36 
37  public:
42  Constant( const double value, const size_t dim );
43 
45  unsigned int dimensionality() const override { return m_DIM; }
47  bool hasAnalyticDerivative() const override { return true; }
49  double operator()( double ) const override { return m_value; }
51  double operator()( const Argument& ) const override { return m_value; }
53  Derivative partial( unsigned int i ) const override;
54 
55  // the assignement operator is disabled
56  Constant& operator=( const Constant& ) = delete;
57 
58  private:
59  double m_value;
60  size_t m_DIM;
61  };
62 
63  } // end of namespace GaudiMathImplementation
64 } // end of namespace Genfun
65 
66 #if defined( __clang__ ) || defined( __CLING__ )
67 #pragma clang diagnostic pop
68 #elif defined( __GNUC__ ) && __GNUC__ >= 5
69 #pragma GCC diagnostic pop
70 #endif
71 
72 // ============================================================================
73 // The END
74 // ============================================================================
75 #endif // GAUDIMATH_CONSTANT_H
76 // ============================================================================
Fixed constant function.
Definition: Constant.h:31
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
Definition: GaudiMath.h:27
PropertyMgr & operator=(const PropertyMgr &)=delete
double operator()(double) const override
Function value.
Definition: Constant.h:49
bool hasAnalyticDerivative() const override
Does this function have an analytic derivative?
Definition: Constant.h:47
double operator()(const Argument &) const override
Function value.
Definition: Constant.h:51
#define GAUDI_API
Definition: Kernel.h:104
Genfun::GaudiMathImplementation::Constant Constant
Definition: GaudiMath.h:26
unsigned int dimensionality() const override
dimensionality of the problem
Definition: Constant.h:45