Returns set entry of a random matrix.
?latm3routine returns the (
jsub) entry of a random matrix of dimension (
n) described by the other parameters. (
jsub) is the final position of the (
j) entry after pivoting according to
?latm3is called by the
?latmrroutine in order to build random test matrices. No error checking on parameters is done, because this routine is called in a tight loop by
?latmrwhich has already checked the parameters.
?latm2in 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,
?latm3can be used to construct random matrices which differ only in their order of rows and/or columns.
?latm2is 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 (
jsub) entry is returned is constructed as follows (this routine only computes one entry):
- Ifisubis outside(1..orm)jsubis outside(1..n), returns zero (this is convenient for generating matrices in band format).
- Generate a matrixAwith random entries of distributionidist.
- Set the diagonal toD.
- Grade the matrix, if desired, from the left (bydl) and/or from the right (bydrordl) as specified byigrade.
- Permute, if desired, the rows and/or columns as specified byipvtngandiwork.
- Band the matrix to have lower bandwidthkland upper bandwidthku.
- Set random entries to zero as specified bysparse.
- Number of rows of matrix.INTEGER.
- Number of columns of matrix.INTEGER.