Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 7/13/2023
Public

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

Document Table of Contents

?latm1

Computes the entries of a matrix as specified.

Syntax

call slatm1( mode, cond, irsign, idist, iseed, d, n, info )

call dlatm1( mode, cond, irsign, idist, iseed, d, n, info )

call clatm1( mode, cond, irsign, idist, iseed, d, n, info )

call zlatm1( mode, cond, irsign, idist, iseed, d, n, info )

Include Files

  • mkl.fi

Description

The ?latm1 routine computes the entries of D(1..n) as specified by mode, cond and irsign. idist and iseed determine the generation of random numbers.

?latm1 is called by slatmr (for slatm1 and dlatm1), and by clatmr(for clatm1 and zlatm1) to generate random test matrices for LAPACK programs.

Input Parameters

mode

INTEGER. On entry describes how d is to be computed:

mode = 0 means do not change d.

mode = 1 sets d(1) = 1 and d(2:n) = 1.0/cond

mode = 2 sets d(1:n-1) = 1 and d(n)=1.0/cond

mode = 3 sets d(i)=cond**(-(i-1)/(n-1))

mode = 4 sets d(i)= 1 - (i-1)/(n-1)*(1 - 1/cond)

mode = 5 sets d to random numbers in the range ( 1/cond , 1 ) such that their logarithms are uniformly distributed.

mode = 6 sets d to random numbers from same distribution as the rest of the matrix.

mode < 0 has the same meaning as abs(mode), except that the order of the elements of d is reversed.

Thus if mode is positive, d has entries ranging from 1 to 1/cond, if negative, from 1/cond to 1.

cond

REAL for slatm1,

DOUBLE PRECISION for dlatm1,

REAL for clatm1,

DOUBLE PRECISION for zlatm1,

On entry, used as described under mode above. If used, it must be 1.

irsign

INTEGER.

On entry, if mode is not -6, 0, or 6, determines sign of entries of d.

If irsign = 0, entries of d are unchanged.

If irsign = 1, each entry of d is multiplied by a random complex number uniformly distributed with absolute value 1.

idist

INTEGER. Specifies the distribution of the random numbers.

For slatm1 and dlatm1:

= 1: uniform (0,1)

= 2: uniform (-1,1)

= 3: normal (0,1)

For clatm1 and zlatm1:

= 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).

Specifies the seed of the random number generator. The random number generator uses a linear congruential sequence limited to small integers, and so should produce machine independent random numbers. The values of iseed(4) are changed on exit, and can be used in the next call to ?latm1 to continue the same random number sequence.

d

REAL for slatm1,

DOUBLE PRECISION for dlatm1,

COMPLEX for clatm1,

DOUBLE COMPLEX for zlatm1,

Array, size n.

n

INTEGER. Number of entries of d.

Output Parameters

iseed

On exit, the seed is updated.

d

On exit, d is updated, unless mode = 0.

info

INTEGER.

If info = 0, the execution is successful.

If info = -1, mode is not in range -6 to 6.

If info = -2, mode is neither -6, 0 nor 6, and irsign is neither 0 nor 1.

If info = -3, mode is neither -6, 0 nor 6 and cond is less than 1.

If info = -4, mode equals 6 or -6 and idist is not in range 1 to 4.

If info = -7, n is negative.