1 #ifndef GAUDIMATH_NUMERICALINDEFINITEINTEGRAL_H
2 #define GAUDIMATH_NUMERICALINDEFINITEINTEGRAL_H 1
12 #include "GaudiKernel/StatusCode.h"
16 #include "GaudiMath/Integration.h"
20 #include "CLHEP/GenericFunctions/AbsFunction.hh"
22 #include "gsl/gsl_integration.h"
29 namespace GaudiMathImplementation
75 class GAUDI_API NumericalIndefiniteIntegral :
public AbsFunction
78 struct _Workspace { gsl_integration_workspace* ws ; };
83 typedef std::vector<double> Points ;
88 FUNCTION_OBJECT_DEF( NumericalIndefiniteIntegral )
155 NumericalIndefiniteIntegral
156 ( const AbsFunction& function ,
165 const
double epsabs = 1e-10 ,
166 const
double epsrel = 1.e-7 ,
167 const
size_t size = 1000 );
210 NumericalIndefiniteIntegral
211 ( const AbsFunction& function ,
214 const Points& points ,
217 const
double epsabs = 1e-9 ,
218 const
double epsrel = 1.e-6 ,
219 const
size_t size = 1000 ) ;
258 NumericalIndefiniteIntegral
259 ( const AbsFunction& function ,
263 const
double epsabs = 1e-9 ,
264 const
double epsrel = 1.e-6 ,
265 const
size_t size = 1000 ) ;
268 NumericalIndefiniteIntegral
269 ( const NumericalIndefiniteIntegral& ) ;
272 virtual ~NumericalIndefiniteIntegral() =
default;
277 virtual
unsigned int dimensionality()
const {
return m_DIM ; }
280 virtual double operator() (
double argument )
const ;
282 virtual double operator() (
const Argument& argument )
const ;
285 virtual bool hasAnalyticDerivative()
const {
return true ;}
293 const AbsFunction&
function ()
const {
return *m_function ; }
295 double a ()
const {
return m_a ; }
297 const Points& points ()
const {
return m_points ; }
299 double epsabs ()
const {
return m_epsabs ; }
301 double epsrel ()
const {
return m_epsrel ; }
304 double result ()
const {
return m_result ; }
306 double error ()
const {
return m_error ; }
309 size_t size ()
const {
return m_size ; }
313 limit ()
const {
return m_limit ; }
316 type ()
const {
return m_type ; }
319 category ()
const {
return m_category ; }
322 rule ()
const {
return m_rule ; }
327 double QAGI ( _Function*
fun )
const ;
329 double QAGP ( _Function*
fun )
const ;
331 double QNG ( _Function*
fun )
const ;
333 double QAG ( _Function*
fun )
const ;
335 double QAGS ( _Function*
fun )
const ;
338 _Workspace* allocate ()
const ;
340 _Workspace* ws ()
const
341 {
return m_ws.get(); }
345 (
const std::string& message ,
351 NumericalIndefiniteIntegral() ;
353 NumericalIndefiniteIntegral&
operator=
354 (
const NumericalIndefiniteIntegral& ) ;
358 struct gsl_ws_deleter {
359 void operator()(_Workspace* p)
const {
360 if (p) gsl_integration_workspace_free ( p->ws ) ;
366 std::unique_ptr<const AbsFunction> m_function ;
378 std::unique_ptr<double[]> m_pdata ;
383 mutable double m_result ;
384 mutable double m_error ;
387 mutable std::unique_ptr<_Workspace,gsl_ws_deleter> m_ws ;
389 mutable Argument m_argument ;
399 #endif // GAUDIMATH_NUMERICALINDEFINITEINTEGRAL_H
Category
integration category
Genfun::GaudiMathImplementation::NumericalDerivative Derivative
This class is used for returning status codes from appropriate routines.
Type
type of integration (for finite limits)
Limit
how to distinguish variable low and variable high limits
double fun(const std::vector< double > &x)
GaudiMath.h GaudiMath/GaudiMath.h.
KronrodRule
integration rule
Type
the list of available types for ntuples
collection of common types for classes NumericalIndefiniteIntegral and NumericalDefiniteIntegral ...