Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 {
30  class GAUDI_API Constant : public AbsFunction {
31  public:
33  FUNCTION_OBJECT_DEF( Constant )
34 
35  public:
40  Constant( const double value, const size_t dim );
41 
43  unsigned int dimensionality() const override { return m_DIM; }
45  bool hasAnalyticDerivative() const override { return true; }
47  double operator()( double ) const override { return m_value; }
49  double operator()( const Argument& ) const override { return m_value; }
51  Derivative partial( unsigned int i ) const override;
52 
53  // the assignement operator is disabled
54  Constant& operator=( const Constant& ) = delete;
55 
56  private:
57  double m_value;
58  size_t m_DIM;
59  };
60 
61  } // end of namespace GaudiMathImplementation
62 } // end of namespace Genfun
63 
64 #if defined( __clang__ ) || defined( __CLING__ )
65 # pragma clang diagnostic pop
66 #elif defined( __GNUC__ ) && __GNUC__ >= 5
67 # pragma GCC diagnostic pop
68 #endif
69 
70 // ============================================================================
71 // The END
72 // ============================================================================
73 #endif // GAUDIMATH_CONSTANT_H
Fixed constant function.
Definition: Constant.h:30
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
Definition: GaudiMath.h:26
PropertyMgr & operator=(const PropertyMgr &)=delete
double operator()(double) const override
Function value.
Definition: Constant.h:47
bool hasAnalyticDerivative() const override
Does this function have an analytic derivative?
Definition: Constant.h:45
double operator()(const Argument &) const override
Function value.
Definition: Constant.h:49
CLHEP.
Definition: IEqSolver.h:13
#define GAUDI_API
Definition: Kernel.h:71
Genfun::GaudiMathImplementation::Constant Constant
Definition: GaudiMath.h:25
unsigned int dimensionality() const override
dimensionality of the problem
Definition: Constant.h:43