nag_rand_orthog_matrix (g05pxc) generates a random orthogonal matrix.
nag_rand_orthog_matrix (g05pxc) pre- or post-multiplies an
by
matrix
by a random orthogonal matrix
, overwriting
. The matrix
may optionally be initialized to the identity matrix before multiplying by
, hence
is returned.
is generated using the method of
Stewart (1980). The algorithm can be summarised as follows.
Let
follow independent multinormal distributions with zero mean and variance
and dimensions
; let
, where
is the identity matrix and
is the Householder transformation that reduces
to
,
being the vector with first element one and the remaining elements zero and
being a scalar, and let
. Then the product
is a random orthogonal matrix distributed according to the Haar measure over the set of orthogonal matrices of
. See
Theorem 3.3 in
Stewart (1980).
One of the initialization functions
nag_rand_init_repeatable (g05kfc) (for a repeatable sequence if computed sequentially) or
nag_rand_init_nonrepeatable (g05kgc) (for a non-repeatable sequence) must be called prior to the first call to nag_rand_orthog_matrix (g05pxc).
Stewart G W (1980) The efficient generation of random orthogonal matrices with an application to condition estimates SIAM J. Numer. Anal. 17 403–409
The maximum error in
should be a modest multiple of
machine precision (see
Chapter x02).
nag_rand_orthog_matrix (g05pxc) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
nag_rand_orthog_matrix (g05pxc) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this function. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
None.
Following initialization of the pseudorandom number generator by a call to
nag_rand_init_repeatable (g05kfc), a
by
orthogonal matrix is generated using the
option and the result printed.
None.