Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

?latm3

Returns set entry of a random matrix.

Syntax

res = slatm3( m, n, i, j, isub, jsub, kl, ku, idist, iseed, d, igrade, dl, dr, ipvtng, iwork, sparse )

res = dlatm3( m, n, i, j, isub, jsub, kl, ku, idist, iseed, d, igrade, dl, dr, ipvtng, iwork, sparse )

res = clatm3( m, n, i, j, isub, jsub, kl, ku, idist, iseed, d, igrade, dl, dr, ipvtng, iwork, sparse )

res = zlatm3( m, n, i, j, isub, jsub, kl, ku, idist, iseed, d, igrade, dl, dr, ipvtng, iwork, sparse )

Include Files

  • mkl.fi

Description

The ?latm3 routine returns the (isub, jsub) entry of a random matrix of dimension (m, n) described by the other parameters. (isub, jsub) is the final position of the (i ,j ) entry after pivoting according to ipvtng and iwork. ?latm3 is called by the ?latmr routine in order to build random test matrices. No error checking on parameters is done, because this routine is called in a tight loop by ?latmr which has already checked the parameters.

Use of ?latm3 differs from ?latm2 in the order in which the random number generator is called to fill in random matrix entries. With ?latm2, the generator is called to fill in the pivoted matrix columnwise. With ?latm3, the generator is called to fill in the matrix columnwise, after which it is pivoted. Thus, ?latm3 can be used to construct random matrices which differ only in their order of rows and/or columns. ?latm2 is used to construct band matrices while avoiding calling the random number generator for entries outside the band (and therefore generating random numbers in different orders for different pivot orders).

The matrix whose (isub, jsub ) entry is returned is constructed as follows (this routine only computes one entry):

  • If isub is outside (1..m) or jsub is outside (1..n), returns zero (this is convenient for generating matrices in band format).

  • Generate a matrix A with random entries of distribution idist.

  • Set the diagonal to D.

  • Grade the matrix, if desired, from the left (by dl) and/or from the right (by dr or dl) as specified by igrade.

  • Permute, if desired, the rows and/or columns as specified by ipvtng and iwork.

  • Band the matrix to have lower bandwidth kl and upper bandwidth ku.

  • Set random entries to zero as specified by sparse.

Input Parameters

m

INTEGER. Number of rows of matrix.

n

INTEGER. Number of columns of matrix.

i

INTEGER. Row of unpivoted entry to be returned.

j

INTEGER. Column of unpivoted entry to be returned.

isub

INTEGER. Row of pivoted entry to be returned.

jsub

INTEGER. Column of pivoted entry to be returned.

kl

INTEGER. Lower bandwidth.

ku

INTEGER. Upper bandwidth.

idist

INTEGER. On entry, idist specifies the type of distribution to be used to generate a random matrix.

for slatm2 and dlatm2:

= 1: uniform (0,1)

= 2: uniform (-1,1)

= 3: normal (0,1)

for clatm2 and zlatm2:

= 1: real and imaginary parts each uniform (0,1)

= 2: real and imaginary parts each uniform (-1,1)

= 3: real and imaginary parts each normal (0,1)

= 4: complex number uniform in disk(0, 1)

iseed

INTEGER. Array, size 4.

Seed for random number generator.

d

REAL for slatm3,

DOUBLE PRECISION for dlatm3,

COMPLEX for clatm3,

DOUBLE COMPLEX for zlatm3,

Array, size (min(i, j)). Diagonal entries of matrix.

igrade

INTEGER. Specifies grading of matrix as follows:

= 0: no grading

= 1: matrix premultiplied by diag( dl )

= 2: matrix postmultiplied by diag( dr )

= 3: matrix premultiplied by diag( dl ) and postmultiplied by diag( dr)

= 4: matrix premultiplied by diag( dl ) and postmultiplied by inv( diag( dl ) )

For slatm2 and slatm2:

= 5: matrix premultiplied by diag( dl ) and postmultiplied by diag( dl)

For clatm2 and zlatm2:

= 5: matrix premultiplied by diag( dl ) and postmultiplied by diag( conjg( dl ) )

= 6: matrix premultiplied by diag( dl ) and postmultiplied by diag( dl)

dl

REAL for slatm3,

DOUBLE PRECISION for dlatm3,

COMPLEX for clatm3,

DOUBLE COMPLEX for zlatm3,

Array, size (i or j, as appropriate).

Left scale factors for grading matrix.

dr

REAL for slatm3,

DOUBLE PRECISION for dlatm3,

COMPLEX for clatm3,

DOUBLE COMPLEX for zlatm3,

Array, size (i or j, as appropriate).

Right scale factors for grading matrix.

ipvtng

INTEGER. On entry specifies pivoting permutations as follows:

If ipvtng = 0: none.

If ipvtng = 1: row pivoting.

If ipvtng = 2: column pivoting.

If ipvtng = 3: full pivoting, i.e., on both sides.

sparse

REAL for slatm3,

DOUBLE PRECISION for dlatm3,

REAL for clatm3,

DOUBLE PRECISION for zlatm3,

On entry, specifies the sparsity of the matrix if sparse matrix is to be generated. sparse should lie between 0 and 1. A uniform( 0, 1 ) random number x is generated and compared to sparse; if x is larger the matrix entry is unchanged and if x is smaller the entry is set to zero. Thus on the average a fraction sparse of the entries will be set to zero.

iwork

INTEGER.

Array, size (i or j, as appropriate). This array specifies the permutation used. The row (or column) originally in position k is in position iwork( k ) after pivoting. This differs from iwork for ?latm2.

Output Parameters

isub

On exit, row of pivoted entry is updated.

jsub

On exit, column of pivoted entry is updated.

iseed

On exit, the seed is updated.

res

REAL for slatm3,

DOUBLE PRECISION for dlatm3,

COMPLEX for clatm3,

DOUBLE COMPLEX for zlatm3,

Entry of a random matrix.