LATIN_RANDOM
Latin Random Squares in M dimensions
LATIN_RANDOM
is a Python library which
makes Latin random squares.
A Latin square is a selection of one point from each row and
column of a square matrix or table. In M dimensions, the
corresponding item is a set of N points, where, in each dimension,
there is exactly one point whose coordinates are in a given
"column" or range of values. To emphasize the
use of higher dimensions, these objects are sometimes called
Latin hypersquares.
A Latin Random Square (I just made up this name) is a set of
N points, where one point is taken at random from each of the
subsquares of a Latin Square. These points may be regarded as
an M dimensional quasirandom pointset.
Licensing:
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
Languages:
LATIN_RANDOM is available in
a C version and
a C++ version and
a FORTRAN77 version and
a FORTRAN90 version and
a MATLAB version and
a Python version.
Related Data and Programs:
HALTON,
a Python library which
computes elements of a Halton Quasi Monte Carlo (QMC) sequence,
using a simple interface.
HAMMERSLEY,
a Python library which
computes elements of a Hammersley Quasi Monte Carlo (QMC) sequence,
using a simple interface.
UNIFORM,
a Python library which
computes elements of a uniform pseudorandom sequence.
VAN_DER_CORPUT,
a Python library which
computes elements of a 1D van der Corput Quasi Monte Carlo (QMC) sequence
using a simple interface.
Reference:

Paul Bratley, Bennett Fox, Linus Schrage,
A Guide to Simulation,
Springer Verlag, pages 201202, 1983.

C J Colbourn and J H Dinitz,
CRC Handbook of Combinatorial Design,
CRC, 1996.

Bennett Fox,
Algorithm 647:
Implementation and Relative Efficiency of Quasirandom
Sequence Generators,
ACM Transactions on Mathematical Software,
Volume 12, Number 4, pages 362376, 1986.

Michael McKay, William Conover, Richard Beckman,
A Comparison of Three Methods for Selecting Values of Input
Variables in the Analysis of Output From a Computer Code,
Technometrics,
Volume 21, pages 239245, 1979.

Albert Nijenhuis, Herbert Wilf,
Combinatorial Algorithms,
Academic Press, 1978, second edition,
ISBN 0125192606.

Herbert Ryser,
Combinatorial Mathematics,
Mathematical Association of America, 1963.
Source Code:

i4_uniform_ab.py,
returns a scaled uniform I4 between A and B.

latin_random.py, the source code.

perm_uniform.py,
randomly selects a permutation of the integers 0 through N1.

r8mat_transpose_print.py,
prints an R8MAT, transposed.

r8mat_transpose_print_some.py,
prints some of an R8MAT, transposed.

r8mat_uniform_01.py,
returns a unit pseudorandom R8MAT.

r8mat_write.py,
writes an R8MAT to a file.

timestamp.py,
prints the current YMDHMS date as a timestamp;
Examples and Tests:
List of Routines:

GET_SEED returns a seed for the random number generator.

GET_UNIT returns a free FORTRAN unit number.

I4_UNIFORM returns a scaled pseudorandom I4.
You can go up one level to
the Python source codes.
Last revised on 13 November 2014.