Sha256: baa2162e43d680745e246c0ca7b861a50eb205a0375e7ca80f7f104cf2da88c8

Contents?: true

Size: 357 Bytes

Versions: 22

Compression:

Stored size: 357 Bytes

Contents

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

h = GSL::Histogram.alloc(100, [-4, 4])

rng = GSL::Rng.alloc
for i in 0..10000 do
  h.increment(rng.gaussian)
end

h2 = h.rebin
h5 = h.rebin(5)
h7 = h.rebin(7)

printf("%d %d %d %d\n", h.n, h2.n, h5.n, h7.n)
printf("%f %f %f %f\n", h.sigma, h2.sigma, h5.sigma, h7.sigma)
GSL::graph(h, h2, h5, h7, "-T X -C -g 3 -x -4 4")

Version data entries

22 entries across 22 versions & 4 rubygems

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