This subroutine factors sparse matrix A by Gaussian elimination, using a modified Markowitz count with threshold pivoting. The sparse matrix can be stored by indices, rows, or columns. To solve the system of equations, follow the call to this subroutine with a call to DGSS.
| Fortran | CALL DGSF (iopt, n, nz, a, ia, ja, lna, iparm, rparm, oparm, aux, naux) |
| C and C++ | dgsf (iopt, n, nz, a, ia, ja, lna, iparm, rparm, oparm, aux, naux); |
| PL/I | CALL DGSF (iopt, n, nz, a, ia, ja, lna, iparm, rparm, oparm, aux, naux); |
If iopt = 0, it is stored by indices.
If iopt = 1, it is stored by rows.
If iopt = 2, it is stored by columns.
Specified as: a fullword integer; iopt = 0, 1, or 2.
If iopt = 0, it contains the row numbers that correspond to the elements in array A.
If iopt = 1, it contains the row pointers.
If iopt = 2, it contains the row numbers that correspond to the elements in array A.
Specified as: an array of length lna, containing fullword integers; IA(i) >= 1. See Sparse Matrix for more information on storage techniques.
If iopt = 0, it contains the column numbers that correspond to the elements in array A.
If iopt = 1, it contains the column numbers that correspond to the elements in array A.
If iopt = 2, it contains the column pointers.
Specified as: an array of length lna, containing fullword integers; JA(i) >= 1. See Sparse Matrix for more information on storage techniques.
The size of lna depends on the structure of the input matrix. The requirement that lna > 2nz does not guarantee a successful run of the program. If the input matrix is expected to have many fill-ins, lna should be set larger. Larger lna may result in a performance improvement.
For details on how lna relates to storage compressions, see Performance and Accuracy Considerations.
If IPARM(1) = 0, the following default values are used:
If IPARM(1) = 1, the default values are not used.
If IPARM(3) = 0, this subroutine checks the values in arrays IA and JA.
If IPARM(3) = 1, this subroutine assumes that the input values are correct in arrays IA and JA.
If IPARM(4) = 0, this computation is not performed.
If IPARM(4) = 1, this subroutine computes:
These values are stored in OPARM(2) and OPARM(3), respectively.
Specified as: an array of (at least) length 5, containing fullword integers, where the iparm values must be:
Specified as: a one-dimensional array of (at least) length 5, containing long-precision real numbers, where the rparm values must be:
For additional information about rparm, see Performance and Accuracy Considerations.
Returned as: a one-dimensional array of length 5, containing long-precision real numbers.
The matrix A is factored by Gaussian elimination, using a modified Markowitz count with threshold pivoting to compute the sparse LU factorization of A:
where:
To solve the system of equations, follow the call to this subroutine with a call to DGSS. If n is 0, no computation is performed. See references [10], [47], and [93].
This example factors 5 by 5 sparse matrix A, which is stored by indices in arrays A, IA, and JA. The three storage techniques are shown in this example, and the output is the same regardless of the storage technique used. The matrix is factored using Gaussian elimination with threshold pivoting. Matrix A is:
* *
| 2.0 0.0 4.0 0.0 0.0 |
| 1.0 1.0 0.0 0.0 3.0 |
| 0.0 0.0 3.0 4.0 0.0 |
| 2.0 2.0 0.0 1.0 5.0 |
| 0.0 0.0 1.0 1.0 0.0 |
* *
IOPT N NZ A IA JA LNA IPARM RPARM OPARM AUX NAUX
| | | | | | | | | | | |
CALL DGSF( 0 , 5, 13, A, IA, JA, 27 , IPARM, RPARM, OPARM, AUX, 150 )
A = (2.0, 1.0, 1.0, 3.0, 4.0, 1.0, 5.0, 2.0, 2.0, 1.0, 1.0,
4.0, 3.0, . , . , . , . , . , . , . , . , . , . , . , . ,
. , . )
IA = (1, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5, 1, 2, . , . , . , . ,
. , . , . , . , . , . , . , . , . , . )
JA = (1, 1, 2, 3, 4, 4, 5, 1, 2, 3, 4, 3, 5, . , . , . , . ,
. , . , . , . , . , . , . , . , . , . )
IPARM = (1, 3, 1, 1)
RPARM = (1.D-12, 0.1D0)
IOPT N NZ A IA JA LNA IPARM RPARM OPARM AUX NAUX
| | | | | | | | | | | |
CALL DGSF( 1 , 5, 13, A, IA, JA, 27 , IPARM, RPARM, OPARM, AUX, 150 )
A = (2.0, 4.0, 1.0, 1.0, 3.0, 3.0, 4.0, 2.0, 2.0, 1.0, 5.0,
1.0, 1.0, . , . , . , . , . , . , . , . , . , . , . , . ,
. , . )
IA = (1, 3, 6, 8, 12, 14, . , . , . , . , . , . , . , . , . ,
. , . , . , . , . )
JA = (1, 3, 1, 2, 5, 3, 4, 1, 2, 4, 5, 3, 4, . , . , . , . ,
. , . , . , . , . , . , . , . , . , . )
IPARM = (1, 3, 1, 1)
RPARM = (1.D-12, 0.1D0)
IOPT N NZ A IA JA LNA IPARM RPARM OPARM AUX NAUX
| | | | | | | | | | | |
CALL DGSF( 2 , 5, 13, A, IA, JA, 27 , IPARM, RPARM, OPARM, AUX, 150 )
A = (2.0, 1.0, 2.0, 1.0, 2.0, 4.0, 3.0, 1.0, 4.0, 1.0, 1.0,
3.0, 5.0, . , . , . , . , . , . , . , . , . , . , . , . ,
. , . )
IA = (1, 2, 4, 2, 4, 1, 3, 5, 3, 4, 5, 2, 4, . , . , . , . ,
. , . , . , . , . , . , . , . , . , . )
JA = (1, 4, 6, 9, 12, 14, . , . , . , . , . , . , . , . , . ,
. , . , . , . , . )
IPARM = (1, 3, 0, 1)
RPARM = (1.D-12, 0.1D0)
A = (0.5, . , 0.3, 1.0, . , 1.0, . , 3.0, . , . , . , 1.0,
1.0, . , . , . , . , . , . , . , -1.7, -0.5, -1.0, -1.0,
4.0, -3.0, -4.0)
IA = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, . , . , . , . ,
. , . , . , 2, 1, 1, 3, 3, 5, 5)
JA = (1, 0, 5, 2, 0, 4, 0, 2, 0, 0, 0, 3, 4, . , . , . , . ,
. , . , . , 4, 2, 4, 4, 1, 3, 1)
OPARM = (1.000000, 0.333333, 3.000000)