g05px generates a random orthogonal matrix.
Syntax
C# |
---|
public static void g05px( string side, string init, int m, int n, G05..::..G05State g05state, double[,] a, out int ifail ) |
Visual Basic |
---|
Public Shared Sub g05px ( _ side As String, _ init As String, _ m As Integer, _ n As Integer, _ g05state As G05..::..G05State, _ a As Double(,), _ <OutAttribute> ByRef ifail As Integer _ ) |
Visual C++ |
---|
public: static void g05px( String^ side, String^ init, int m, int n, G05..::..G05State^ g05state, array<double,2>^ a, [OutAttribute] int% ifail ) |
F# |
---|
static member g05px : side : string * init : string * m : int * n : int * g05state : G05..::..G05State * a : float[,] * ifail : int byref -> unit |
Parameters
- side
- Type: System..::..StringOn entry: indicates whether the matrix is multiplied on the left or right by the random orthogonal matrix .
- The matrix is multiplied on the left, i.e., premultiplied.
- The matrix is multiplied on the right, i.e., post-multiplied.
Constraint: or .
- init
- Type: System..::..StringOn entry: indicates whether or not a should be initialized to the identity matrix.Constraint: or .
- m
- Type: System..::..Int32On entry: , the number of rows of the matrix .Constraints:
- if , ;
- otherwise .
- n
- Type: System..::..Int32On entry: , the number of columns of the matrix .Constraints:
- if , ;
- otherwise .
- g05state
- Type: NagLibrary..::..G05..::..G05StateAn Object of type G05.G05State.
- a
- Type: array<System..::..Double,2>[,](,)[,][,]An array of size [dim1, n]Note: dim1 must satisfy the constraint:On entry: if , a must contain the matrix .On exit: the matrix when or the matrix when .
- ifail
- Type: System..::..Int32%On exit: unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).
Description
g05px 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 methods (G05KFF not in this release) (for a repeatable sequence if computed sequentially) or (G05KGF not in this release) (for a non-repeatable sequence) must be called prior to the first call to g05px.
References
Stewart G W (1980) The efficient generation of random orthogonal matrices with an application to condition estimates SIAM J. Numer. Anal. 17 403–409
Error Indicators and Warnings
Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface
(LDA) In these
cases, an error in another parameter has usually caused an incorrect value to be inferred.
On entry, or .
On entry, or .
On entry, .
On entry, .
On entry, state vector was not initialized or has been corrupted.
- On entry, an orthogonal matrix of dimension has been requested.
Accuracy
The maximum error in should be a modest multiple of
machine precision (see
X02 class).
Parallelism and Performance
None.
Further Comments
None.