Sha256: 58a54f50386bb48691ead75bc7f9216fa1c6d9ac7bf8bba9025624bac4ea4705

Contents?: true

Size: 272 Bytes

Versions: 16

Compression:

Stored size: 272 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

16 entries across 16 versions & 4 rubygems

Version Path
rb-gsl-1.16.0.4 examples/integration/qng.rb
rb-gsl-1.16.0.3 examples/integration/qng.rb
rb-gsl-1.16.0.3.rc1 examples/integration/qng.rb
gsl-nmatrix-1.15.3.2 examples/integration/qng.rb
gsl-nmatrix-1.15.3.1 examples/integration/qng.rb
rb-gsl-1.16.0.2 examples/integration/qng.rb
rb-gsl-1.16.0.1 examples/integration/qng.rb
rb-gsl-1.16.0 examples/integration/qng.rb
rb-gsl-1.15.3.2 examples/integration/qng.rb
rb-gsl-1.15.3.1 examples/integration/qng.rb
blackwinter-gsl-1.15.3.2 examples/integration/qng.rb
gsl-nmatrix-1.15.3.0 examples/integration/qng.rb
gsl-1.15.3 examples/integration/qng.rb
gsl-1.14.7 examples/integration/qng.rb
gsl-1.14.6 examples/integration/qng.rb
gsl-1.14.5 examples/integration/qng.rb