The Gaudi Framework  v28r3 (cc1cf868)
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:
34 
36  FUNCTION_OBJECT_DEF( Constant )
37 
38  public:
39 
44  Constant ( const double value ,
45  const size_t dim ) ;
46 
47 
49  unsigned int dimensionality () const override { return m_DIM ; }
51  bool hasAnalyticDerivative () const override { return true ; }
53  double operator() ( double ) const override { return m_value ; }
55  double operator() ( const Argument& ) const override { return m_value ; }
57  Derivative partial ( unsigned int i ) const override ;
58 
59  // the assignement operator is disabled
60  Constant& operator=( const Constant& ) = delete;
61 
62  private:
63 
64  double m_value ;
65  size_t m_DIM ;
66 
67  };
68 
69  } // end of namespace GaudiMathImplementation
70 } // end of namespace Genfun
71 
72 #if defined(__clang__) || defined(__CLING__)
73 #pragma clang diagnostic pop
74 #elif defined(__GNUC__) && __GNUC__ >= 5
75 #pragma GCC diagnostic pop
76 #endif
77 
78 // ============================================================================
79 // The END
80 // ============================================================================
81 #endif // GAUDIMATH_CONSTANT_H
82 // ============================================================================
Fixed constant function.
Definition: Constant.h:31
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
Definition: GaudiMath.h:29
PropertyMgr & operator=(const PropertyMgr &)=delete
bool hasAnalyticDerivative() const override
Does this function have an analytic derivative?
Definition: Constant.h:51
virtual Out operator()(const vector_of_const_< In > &inputs) const =0
CLHEP.
Definition: IEqSolver.h:13
#define GAUDI_API
Definition: Kernel.h:107
Genfun::GaudiMathImplementation::Constant Constant
Definition: GaudiMath.h:27
unsigned int dimensionality() const override
dimensionality of the problem
Definition: Constant.h:49