#!/usr/local/bin/ruby require "GSL" include GSL::Random # Test quasi-random sequences # generate output suitable for graph(1) from GNU plotutils: # ruby test/qrng.rb > qrng.dat # graph -Tps < qrng.dat > qrng.ps STDERR.puts "Running tests for quasi-random sequences..." q = QRNG::new(QRNG::SOBOL, 2) #puts "\nname : #{q.name}" #puts "dim : #{q.dim}" #puts "size : #{q.size}" a = [0, 0] puts "#m=0,S=2" 1024.times do |i| a = q.get print a.join(" "), "\n" end #q.reset STDERR.puts "\ndone."