Sha256: 4fac0fcd07feb7eef71107f005e4b8530eb4abb7c65e43eef41635ba9621d7f7

Contents?: true

Size: 639 Bytes

Versions: 22

Compression:

Stored size: 639 Bytes

Contents

#!/usr/bin/env ruby
require 'gsl'
include GSL
include Math

f456 = Function.alloc { |x|
  if x.zero?
    val = 0.0
  else
    val = log(x)
  end
  val
}

exp_result = -1.281368483991674190E-01
exp_abserr =  6.875028324415666248E-12

table = [10.0*PI, 1.0, GSL::Integration::SINE, 1000]
result = f456.qawo(0.0, [0.0, 1e-7], table)
p result
puts("exp_result: #{exp_result}")
puts("exp_abserr: #{exp_abserr}")

table = Integration::QAWO_Table.alloc(10.0*PI, 1.0, GSL::Integration::SINE, 1000)
p f456.qawo(0.0, [0.0, 1e-7], table)
p f456.qawo(0.0, table)

p Integration.qawo(f456, 0.0, table)
p Integration.qawo(f456, 0.0, [0.0, 1e-7], table)

Version data entries

22 entries across 22 versions & 4 rubygems

Version Path
gsl-2.1.0.3 examples/integration/qawo.rb
gsl-2.1.0.2 examples/integration/qawo.rb
gsl-2.1.0.1 examples/integration/qawo.rb
gsl-2.1.0 examples/integration/qawo.rb
gsl-1.16.0.6 examples/integration/qawo.rb
rb-gsl-1.16.0.5 examples/integration/qawo.rb
rb-gsl-1.16.0.4 examples/integration/qawo.rb
rb-gsl-1.16.0.3 examples/integration/qawo.rb
rb-gsl-1.16.0.3.rc1 examples/integration/qawo.rb
gsl-nmatrix-1.15.3.2 examples/integration/qawo.rb
gsl-nmatrix-1.15.3.1 examples/integration/qawo.rb
rb-gsl-1.16.0.2 examples/integration/qawo.rb
rb-gsl-1.16.0.1 examples/integration/qawo.rb
rb-gsl-1.16.0 examples/integration/qawo.rb
rb-gsl-1.15.3.2 examples/integration/qawo.rb
rb-gsl-1.15.3.1 examples/integration/qawo.rb
blackwinter-gsl-1.15.3.2 examples/integration/qawo.rb
gsl-nmatrix-1.15.3.0 examples/integration/qawo.rb
gsl-1.15.3 examples/integration/qawo.rb
gsl-1.14.7 examples/integration/qawo.rb