?latme
?latme
Generates random non-symmetric square matrices with specified
eigenvalues.
Syntax
void slatme
(
lapack_int
*n
,
char
*dist
,
lapack_int
*iseed
,
float
*d
,
lapack_int
*mode
,
float
*cond
,
float
*dmax
,
char
*ei
,
char
*rsign
,
char
*upper
,
char
*sim
,
float
*ds
,
lapack_int
*modes
,
float
*conds
,
lapack_int
*kl
,
lapack_int
*ku
,
float
*anorm
,
float
*a
,
lapack_int
*lda
,
float
*work
,
lapack_int
*info
);
void dlatme
(
lapack_int
*n
,
char
*dist
,
lapack_int
*iseed
,
double
*d
,
lapack_int
*mode
,
double
*cond
,
double
*dmax
,
char
*ei
,
char
*rsign
,
char
*upper
,
char
*sim
,
double
*ds
,
lapack_int
*modes
,
double
*conds
,
lapack_int
*kl
,
lapack_int
*ku
,
double
*anorm
,
double
*a
,
lapack_int
*lda
,
double
*work
,
lapack_int
*info
);
void clatme
(
lapack_int
*n
,
char
*dist
,
lapack_int
*iseed
,
lapack_complex_float
*d
,
lapack_int
*mode
,
float
*cond
,
lapack_complex_float
*dmax
,
char
*ei
,
char
*rsign
,
char
*upper
,
char
*sim
,
float
*ds
,
lapack_int
*modes
,
float
*conds
,
lapack_int
*kl
,
lapack_int
*ku
,
float
*anorm
,
lapack_complex_float
*a
,
lapack_int
*lda
,
lapack_complex_float
*work
,
lapack_int
*info
);
void zlatme
(
lapack_int
*n
,
char
*dist
,
lapack_int
*iseed
,
lapack_complex_double
*d
,
lapack_int
*mode
,
double
*cond
,
lapack_complex_double
*dmax
,
char
*ei
,
char
*rsign
,
char
*upper
,
char
*sim
,
double
*ds
,
lapack_int
*modes
,
double
*conds
,
lapack_int
*kl
,
lapack_int
*ku
,
double
*anorm
,
lapack_complex_double
*a
,
lapack_int
*lda
,
lapack_complex_double
*work
,
lapack_int
*info
);
Include Files
- mkl.h
Description
The
?latme
routine generates random non-symmetric square matrices with
specified eigenvalues. ?latme
operates
by applying the following sequence of operations: - Set the diagonal tod, wheredmay be input or computed according tomode,cond,dmax, andrsignas described below.
- If, the upper triangle ofupper='T'ais set to random values out of distributiondist.
- If,sim='T'ais multiplied on the left by a random matrixX, whose singular values are specified byds,modes, andconds, and on the right byXinverse.
- If, the lower bandwidth is reduced tokl<n-1klusing Householder transformations. If, the upper bandwidth is reduced toku<n-1ku.
- Ifanormis not negative, the matrix is scaled to have maximum-element-normanorm.
Since the matrix cannot be reduced beyond Hessenberg form, no
packing options are available.
Input Parameters
- n
- The number of columns (or rows) ofA.
- dist
- On entry,distspecifies the type of distribution to be used to generate the random eigen-/singular values, and on the upper triangle (seeupper).If: uniform( 0, 1 )dist='U'If: uniform( -1, 1 )dist='S'If: normal( 0, 1 )dist='N'If: uniform on the complex disc |dist='D'z| < 1.
- iseed
- Array, size 4.On entryiseedspecifies the seed of the random number generator. The elements should lie between 0 and 4095 inclusive, andiseed[3]should be odd. The random number generator uses a linear congruential sequence limited to small integers, and so should produce machine independent random numbers.
- d
- Array, size (n). This array is used to specify the eigenvalues ofA.If, thenmode= 0dis assumed to contain the eigenvalues. Otherwise they are computed according tomode,cond,dmax, andrsignand placed ind.
- mode
- On entrymodedescribes how the eigenvalues are to be specified:means usemode= 0d(witheiforslatmeanddlatme) as input.setsmode= 1d[0]and= 1d(2:n]=1.0/.condsetsmode= 2d[0:n- 2]= 1andd[n- 1]=1.0/.condsetsmode= 3d[i- 1]=.cond**(-(i-1)/(n-1))setsmode= 4d[i- 1]= 1 - (.i-1)/(n-1)*(1 - 1/cond)setsmode= 5dto random numbers in the range( 1/such that their logarithms are uniformly distributed.cond, 1 )setsmode= 6dto random numbers from same distribution as the rest of the matrix.has the same meaning asmode< 0abs(, except that the order of the elements ofmode)dis reversed.Thus ifmodeis between 1 and 4,dhas entries ranging from 1 to 1/cond, if between -1 and -4,dhas entries ranging from 1/condto 1.
- cond
- On entry, this is used as described undermodeabove. If used, it must be≥1.
- dmax
- Ifmodeis not -6, 0 or 6, the contents ofdas computed according tomodeandcondare scaled by. Note thatdmax/ max(abs(d[))i- 1]dmaxneeds not be positive or real: ifdmaxis negative or complex (or zero),dwill be scaled by a negative or complex number (or zero). Ifthen the largest (absolute) eigenvalue will be equal torsign='F'dmax.
- ei
- Used byslatmeanddlatmeonly.Array, size (n).If, andmode= 0ei[0]is not' '(space character), this array specifies which elements ofd(on input) are real eigenvalues and which are the real and imaginary parts of a complex conjugate pair of eigenvalues. The elements ofeimay then only have the values'R'and'I'.Ifei[j- 1]=and'R'ei[j]=, then the'I'j-th eigenvalue is cmplx(d[,j- 1]d[), and the (j]j+1)-th is the complex conjugate thereof.Ifei[j- 1]=, then theei[=j]'R'j-th eigenvalue isd[(i.e., real).j- 1]ei[0]may not be'I', nor may two adjacent elements ofeiboth have the value'I'.Ifmodeis not 0, theneiis ignored. Ifmodeis 0 and, then the eigenvalues will all be real.ei[0]=' '
- rsign
- Ifmodeis not 0, 6, or -6, and, then the elements ofrsign='T'd, as computed according tomodeandcond, are multiplied by a random sign (+1 or -1) forslatmeanddlatmeor by a complex number from the unit circle |z| = 1 forclatmeandzlatme.If, the elements ofrsign='F'dare not multiplied.rsignmay only have the values'T'or'F'.
- upper
- If, then the elements ofupper='T'aabove the diagonal will be set to random numbers out ofdist.If, they will not.upper='F'uppermay only have the values'T'or'F'.
- sim
- If, thensim='T'awill be operated on by a "similarity transform", i.e., multiplied on the left by a matrixXand on the right byXinverse., whereX=USVUandVare random unitary matrices andSis a (diagonal) matrix of singular values specified byds,modes, andconds.If, thensim='F'awill not be transformed.
- ds
- This array is used to specify the singular values ofX, in the same way thatdspecifies the eigenvalues ofa. If, themode= 0dscontains the singular values, which may not be zero.
- modes
- Similar tomode, but for specifying the diagonal ofS.modes= -6 and +6 are not allowed (since they would result in randomly ill-conditioned eigenvalues.)
- conds
- Similar tocond, but for specifying the diagonal ofS.
- kl
- This specifies the lower bandwidth of the matrix.specifies upper Hessenberg form. Ifkl= 1klis at leastn-1, thenAwill have full lower bandwidth.
- ku
- This specifies the upper bandwidth of the matrix.specifies lower Hessenberg form.ku= 1Ifkuis at leastn-1, thenawill have full upper bandwidth.Ifkuandkuare both at leastn-1, thenawill be dense. Only one ofkuandklmay be less thann-1.
- anorm
- Ifanormis not negative, thenais scaled by a non-negative real number to make the maximum-element-norm ofato beanorm.
- lda
- Number of rows of matrixA.
- work
- Array, size(3*Workspace.n).
Output Parameters
- iseed
- On exit, the seed is updated.
- d
- Modified ifmodeis nonzero.
- ds
- Modified ifmodeis nonzero.
- a
- Array, size. On exit,lda*nais the desired test matrix.
- info
- If, execution is successful.info= 0If,info= -1nis negative .If,info= -2distis an illegal string.If,info= -5modeis not in range -6 to 6.If,info= -6condis less than 1.0, andmodeis not -6, 0, or 6 .If,info= -9rsignis not'T'or'F'.If,info= -10upperis not'T'or'F'.If,info= -11simis not'T'or'F'.If,info= -12modes= 0 anddshas a zero singular value.If,info= -13modesis not in the range -5 to 5.If,info= -14modesis nonzero andcondsis less than 1. .If,info= -15klis less than 1.If,info= -16kuis less than 1, orklandkuare both less thann-1.If,info= -19ldais less thanm.If, error return frominfo= 1?latm1(computingd) .If, cannot scale toinfo= 2dmax(max. eigenvalue is 0) .If, error return frominfo= 3slatm1(forslatmeand