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
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 
48  Constant ( const Constant& right ) ;
49 
51  ~Constant() override;
52 
53  public:
54 
56  unsigned int dimensionality () const override { return m_DIM ; }
58  bool hasAnalyticDerivative () const override { return true ; }
60  double operator() ( double ) const override { return m_value ; }
62  double operator() ( const Argument& ) const override { return m_value ; }
64  Derivative partial ( unsigned int i ) const override ;
65 
66  private:
67 
68  // the default constructor is disabled
69  Constant() ;
70  // the assignement operator is disabled
71  Constant& operator=( const Constant& );
72 
73  private:
74 
75  double m_value ;
76  size_t m_DIM ;
77 
78  };
79 
80  } // end of namespace GaudiMathImplementation
81 } // end of namespace Genfun
82 
83 #if defined(__clang__) || defined(__CLING__)
84 #pragma clang diagnostic pop
85 #elif defined(__GNUC__) && __GNUC__ >= 5
86 #pragma GCC diagnostic pop
87 #endif
88 
89 // ============================================================================
90 // The END
91 // ============================================================================
92 #endif // GAUDIMATH_CONSTANT_H
93 // ============================================================================
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:58
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:56