AdaptiveIntegrate

AdaptiveIntegrate uses the Gauss-Kronrod algorithm to integrate a function to a specified precision. For efficiency reasons the function is passed into the integrator as a template parameter.

template<RealArray Integrand(const RealArray& x, void *p)> 
    int AdaptiveIntegrate(const Real LowerLimit, const Real UpperLimit, 
                          void *p, const Real Precision, Real& Integral, 
                          Real& IntegralError);
The integrand function should be written to take an input array of Real values on which the function is to be evaluated and return a Real array of values. Any parameters required can be passed through the pointer p. An example use of AdaptiveIntegrate can be found in gaussianAbsorptionLine.cxx in the XSFunctions directory.




HEASARC Home | Observatories | Archive | Calibration | Software | Tools | Students/Teachers/Public

Last modified: Wednesday, 23-Mar-2022 17:16:50 EDT

HEASARC Home | Observatories | Archive | Calibration | Software | Tools | Students/Teachers/Public

Last modified: 23-Mar-2022