This subprogram transposes sparse matrix A, stored in compressed-matrix storage mode, where A contains long-precision real numbers.
| Fortran | CALL DSMTM (m, nz, ac, ka, lda, n, nt, at, kt, ldt, aux, naux) |
| C and C++ | dsmtm (m, nz, ac, ka, lda, n, nt, at, kt, ldt, aux, naux); |
| PL/I | CALL DSMTM (m, nz, ac, ka, lda, n, nt, at, kt, ldt, aux, naux); |
If naux = 0 and error 2015 is unrecoverable, aux is ignored.
Otherwise, it is a storage work area used by this subroutine. Its size is specified by naux.
Specified as: an area of storage, containing long-precision real numbers. They can have any value.
If naux = 0 and error 2015 is unrecoverable, DSMTM dynamically allocates the work area used by this subroutine. The work area is deallocated before control is returned to the calling program.
Otherwise, naux >= n.
A sparse matrix A, stored in arrays AC and KA in compressed-matrix storage mode, is transposed, forming AT, and is stored in arrays AT and KT in compressed-matrix storage mode. See reference [73]. This subroutine is provided for when you want to do a matrix-vector product using a transposed matrix, AT. First, you transpose a matrix, A, using this subroutine, then you call DSMMX with the transposed matrix AT. This results in the following computation being performed: y<--ATx.
If your program uses a sparse matrix stored by rows and you want to use this subroutine, you should first convert your sparse matrix to compressed-matrix storage mode by using the DSRSM utility subroutine described in DSRSM--Convert a Sparse Matrix from Storage-by-Rows to Compressed-Matrix Storage Mode.
Error 2015 is unrecoverable, naux = 0, and unable to allocate work area.
None
This example shows how to transpose the following 5 by 4 sparse matrix A, which is stored in compressed-matrix storage mode in arrays AC and KA. Matrix A is:
* *
| 11.0 0.0 0.0 0.0 |
| 21.0 0.0 23.0 0.0 |
| 0.0 0.0 33.0 34.0 |
| 0.0 42.0 0.0 44.0 |
| 51.0 0.0 53.0 0.0 |
* *
The resulting 4 by 5 matrix transpose AT, stored in compressed-matrix storage mode in arrays AT and KT, is as follows. Matrix AT is:
* *
| 11.0 21.0 0.0 0.0 51.0 |
| 0.0 0.0 0.0 42.0 0.0 |
| 0.0 23.0 33.0 0.0 53.0 |
| 0.0 0.0 34.0 44.0 0.0 |
* *
As shown here, the value of N is larger than the actual number of columns in the matrix A. On output, the exact number of rows in the transposed matrix is returned in the output argument N.
On output, row 6 of AT and KT is is not accessed or modified by the subroutine. Column 4 and row 5 are accessed and modified. They are of no use in further computations and will not be used, because NT = 3 and M = 4.
M NZ AC KA LDA N NT AT KT LDT AUX NAUX
| | | | | | | | | | | |
CALL DSMTM( 5 , 2 , AC , KA , 5 , 5 , 4 , AT , KT , 6 , AUX , 5 )
* *
| 11.0 0.0 |
| 21.0 23.0 |
AC = | 33.0 34.0 |
| 42.0 44.0 |
| 51.0 53.0 |
* *
* *
| 1 1 |
| 1 3 |
KA = | 3 4 |
| 2 4 |
| 1 3 |
* *
N = 4 NT = 3
* *
| 11.0 21.0 51.0 0.0 |
| 42.0 0.0 0.0 0.0 |
AT = | 33.0 23.0 53.0 0.0 |
| 34.0 44.0 0.0 0.0 |
| 0.0 0.0 0.0 0.0 |
| . . . . |
* *
* *
| 1 2 5 1 |
| 4 1 1 1 |
KT = | 3 2 5 1 |
| 3 4 1 1 |
| 1 1 1 1 |
| . . . . |
* *