module GSL::Integration

Defined in:

gsl/maths/analysis/integrate.cr

Class Method Summary

Class Method Detail

def self.cquad(function : Proc(Float64, Float64), a : Float64, b : Float64, *, epsabs : Float64 = 0.0, epsrel : Float64 = 0.0, limit = 1000) #

[View source]
def self.integrate(function : Proc(Float64, Float64), a : Float64, b : Float64, *, epsabs : Float64 = 0.0, epsrel : Float64 = 0.0, limit = 1000, algorithm : Algorithm = Algorithm::CQUAD) #

[View source]
def self.integrate(a : Float64, b : Float64, *, epsabs : Float64 = 0.0, epsrel : Float64 = 0.0, limit = 1000, algorithm : Algorithm = Algorithm::CQUAD, &function : Proc(Float64, Float64)) #

[View source]
def self.qag(function : Proc(Float64, Float64), a : Float64, b : Float64, *, epsabs : Float64 = 0.0, epsrel : Float64 = 0.0, limit = 1000, key : QAGKey = QAGKey::GSL_INTEG_GAUSS61) #

[View source]
def self.qagp(function : Proc(Float64, Float64), points, *, epsabs : Float64 = 0.0, epsrel : Float64 = 0.0, limit = 1000) #

[View source]
def self.qags(function : Proc(Float64, Float64), a : Float64, b : Float64, *, epsabs : Float64 = 0.0, epsrel : Float64 = 0.0, limit = 1000) #

[View source]
def self.qawc(function : Proc(Float64, Float64), a : Float64, b : Float64, c : Float64, *, epsabs : Float64 = 0.0, epsrel : Float64 = 0.0, limit = 1000) #

[View source]
def self.qng(function : Proc(Float64, Float64), a : Float64, b : Float64, *, epsabs : Float64 = 0.0, epsrel : Float64 = 0.0) #

The QNG algorithm is a non-adaptive procedure which uses fixed Gauss-Kronrod-Patterson abscissae to sample the integrand at a maximum of 87 points. It is provided for fast integration of smooth functions Integrates function from a to b with absolute precision epsabs OR relative precision epsrel. If none of precisions given, it is assumed that epsabs = 1e-9. Returns integration result, estimated error and number of evaluations. Example: ``` f = ->(x : Float64) { Math.sin(x) } result, eps, count = GSL::Integration.qng(f, 0.0, Math::PI/2)`


[View source]
def self.qng(a : Float64, b : Float64, *, epsabs : Float64 = 0.0, epsrel : Float64 = 0.0, &function : Proc(Float64, Float64)) #

Yielding version of #qng Example: ``` result, eps, count = GSL::Integration.qng(0.0, Math::PI/2) { |x| Math.sin(x) }`


[View source]
def self.romberg(function : Proc(Float64, Float64), a : Float64, b : Float64, *, epsabs : Float64 = 0.0, epsrel : Float64 = 0.0, limit = 1000) #

[View source]