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

dim = 2
#q = QRng.new(QRng::SOBOL, dim)
q = QRng.new("sobol", dim)
#q = QRng.new("niederreiter_2", dim)
#q = QRng.new(QRng::NIEDERREITER_2, dim)

v = Vector.new(dim)
IO.popen("graph -T X -C --title-font-size 0.04 -L 'Distribution of first 1024 points from the quasi-random Sobol sequence' -m -1 -S 2", "w") do |io|
  for i in 0..1024 do
    #       v = q.get()    # by creating a new vector
    q.get(v)       # by using an existing vector (efficient)
    io.printf("%e %e\n", v[0], v[1])
  end
end

