Title: Quasi-Random Sequences: GSL::QRng class

This chapter describes the quasi-random sequence generator GSL::QRng of arbitrary dimensions. A quasi-random sequence progressively covers a d-dimensional space with a set of points that are uniformly distributed. Quasi-random sequences are also known as low-discrepancy sequences. The quasi-random sequence generators use an interface that is similar to the interface for random number generators.

1 Class Methods

GSL::QRng.alloc(T, d)
This returns a GSL::QRng object, a quasi-random sequence generator of type T and dimension d.

2 Methods

GSL::QRng::init
This reinitializes the generator to its starting point.
GSL::QRng::get(x)

This calculate the next point x from the sequence generator. Here x is an instance of the GSL::Vector class. The space available for x must match the dimension of the generator. The point x will lie in the range 0 < x_i < 1 for each x_i.

This is used as

q = QRng.alloc(QRng::SOBOL, dim)
v = Vector.alloc(dim)
for i in 0..1024 do
  q.get(v)
  printf("%.5f %.5f\n", v[0], v[1])
end
GSL::QRng::get

This is used as

q = QRng.alloc(QRng::SOBOL, dim)
for i in 0..1024 do
  v = q.get()
  printf("%.5f %.5f\n", v[0], v[1])
end
GSL::QRng::name
Returns the name of the generator self.
GSL::QRng::size
GSL::QRng::clone
GSL::QRng::duplicate
Return a newly created generator which is an exact copy of the generator self.

3 Quasi-random number generator algorithms

In creating a generator by the method GSL::QRng.alloc(T, d), the algorithm type T is given by a String or a Fixnum constant. The following quasi-random sequence algorithms are available,

prev next

Reference index top