Sha256: 29566baad5342088b8bfe515ba31a7603c9b6ee5a90d8a7fbbd597f9b29898b0
Contents?: true
Size: 574 Bytes
Versions: 22
Compression:
Stored size: 574 Bytes
Contents
#!/usr/bin/env ruby require("gsl") include GSL dim = 2 q = QRng.alloc(QRng::HDSOBOL, dim) #q = QRng.alloc("sobol", dim) #q = QRng.alloc("niederreiter_2", dim) #q = QRng.alloc(QRng::NIEDERREITER_2, dim) p q.name v = Vector.alloc(dim) IO.popen("graph -T X -C --title-font-size 0.04 -L 'Distribution of first 1024 points from the quasi-random HDSobol sequence' -m -1 -S 2", "w") do |io| for i in 0..1024 do # v = q.get() # by creating a alloc vector q.get(v) # by using an existing vector (efficient) io.printf("%e %e\n", v[0], v[1]) end end
Version data entries
22 entries across 22 versions & 4 rubygems