Sha256: 60d97819e4fac0b6135528a9065cbdbabd1b0526f79d1dc678df647c8df3d84f

Contents?: true

Size: 271 Bytes

Versions: 6

Compression:

Stored size: 271 Bytes

Contents

#!/usr/bin/env ruby
require("gsl")
include GSL
include Math

f = Function.alloc { |x| Math::sin(x)/x }

p f.qng(0, 2.0*Math::PI)

# Singular at x = 0
f2 = Function.alloc { |x| exp(-x)/sqrt(x) }

# This will fail...
#p f2.qng(0, 1)

p Integration.qng(f, [0, 2*Math::PI])

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
gsl-2.1.0.3 examples/integration/qng.rb
gsl-2.1.0.2 examples/integration/qng.rb
gsl-2.1.0.1 examples/integration/qng.rb
gsl-2.1.0 examples/integration/qng.rb
gsl-1.16.0.6 examples/integration/qng.rb
rb-gsl-1.16.0.5 examples/integration/qng.rb