This subroutine can perform either or both of the following functions for general sparse matrix A, stored in skyline storage mode, and for vectors x and b:
You also have the choice of using profile-in or diagonal-out skyline storage mode for A on input or output.
Fortran | CALL DGKFS (n, au, nu, idu, al, nl, idl, iparm, rparm, aux, naux, bx, ldbx, mbx) |
C and C++ | dgkfs (n, au, nu, idu, al, nl, idl, iparm, rparm, aux, naux, bx, ldbx, mbx); |
PL/I | CALL DGKFS (n, au, nu, idu, al, nl, idl, iparm, rparm, aux, naux, bx, ldbx, mbx); |
In each case:
If IPARM(4) = 0, diagonal-out skyline storage mode is used for A.
If IPARM(4) = 1, profile-in skyline storage mode is used for A.
Specified as: a one-dimensional array of (at least) length nu, containing long-precision real numbers.
In each case:
If IPARM(4) = 0, diagonal-out skyline storage mode is used for A.
If IPARM(4) = 1, profile-in skyline storage mode is used for A.
Specified as: a one-dimensional array of (at least) length nl, containing long-precision real numbers.
If IPARM(1) = 0, the following default values are used. For restrictions, see Notes.
If IPARM(1) = 1, the default values are not used.
Type of Computation | Ax = b | Ax = b and Determinant(A) | ATx = b | ATx = b and Determinant(A) |
---|---|---|---|---|
Factor and Solve | 0 | 10 | 100 | 110 |
Factor Only | 1 | 11 | N/A | N/A |
Solve Only | 2 | N/A | 102 | N/A |
If IPARM(3) = 0, and:
If IPARM(3) > 0, and you are doing a factor only, then a partial factorization is performed on matrix A. Rows 1 through IPARM(3) of columns 1 through IPARM(3) in matrix A must be in factored form from a preceding call to this subroutine. The factorization is performed on rows IPARM(3)+1 through n and columns IPARM(3)+1 through n. For an illustration, see Notes.
If IPARM(4) = 0, diagonal-out skyline storage mode is used.
If IPARM(4) = 1, profile-in skyline storage mode is used.
If IPARM(5) = 0, diagonal-out skyline storage mode is used.
If IPARM(5) = 1, profile-in skyline storage mode is used.
If you are doing a factor and solve or a factor only, then IPARM(10) indicates whether certain default values for iparm and rparm are used by this subroutine, where:
If you are doing a solve only, this argument is not used.
If you are doing a factor and solve or a factor only, then IPARM(11) through IPARM(15) control the type of processing to apply to pivot elements occurring in regions 1 through 5, respectively. The pivot elements are ukk for k = 1, n when doing a full factorization, and they are k = IPARM(3)+1, n when doing a partial factorization. The region in which a pivot element falls depends on the sign and magnitude of the pivot element. The regions are determined by RPARM(10). For a description of the regions and associated pivot values, see Notes. For each region i for i = 1,5, where the pivot occurs in region i, the processing applied to the pivot element is determined by IPARM(10+i), where:
If you are doing a solve only, these arguments are not used.
Specified as: a one-dimensional array of (at least) length 25, containing fullword integers, where:
If you are doing a factor and solve or a factor only, RPARM(10) is the tolerance value for small pivots. This sets the bounds for the pivot regions, where pivots are processed according to the options you specify for the five regions in IPARM(11) through IPARM(15), respectively. The suggested value is 10-15 <= IPARM(10) <= 1.
If you are doing a solve only, this argument is not used.
If you are doing a factor and solve or a factor only, RPARM(11) through RPARM(15) are the fix-up values to use for the pivots in regions 1 through 5, respectively. For each RPARM(10+i) for i = 1,5, where the pivot occurs in region i:
If you are doing a solve only, these arguments are not used.
Specified as: a one-dimensional array of (at least) length 25, containing long-precision real numbers, where if IPARM(2) = 0, 1, 10, 11, 100, or 110, then:
If naux = 0 and error 2015 is unrecoverable, aux is ignored.
Otherwise, it is the storage work area used by this subroutine. Its size is specified by naux.
Specified as: an area of storage, containing long-precision real numbers.
If naux = 0 and error 2015 is unrecoverable, DGKFS dynamically allocates the work area used by this subroutine. The work area is deallocated before control is returned to the calling program.
Otherwise,
If you are doing a factor only, use naux >= 5n.
If you are doing a factor and solve or a solve only, use naux >= 5n+4mbx.
If you are doing a factor and solve or a solve only, bx is the array, containing the mbx right-hand side vectors b of the system Ax = b or ATx = b. Each vector b is length n and is stored in the corresponding column of the array.
If you are doing a factor only, this argument is not used in the computation.
Specified as: an ldbx by (at least) mbx array, containing long-precision real numbers.
If you are doing a factor and solve or a solve only, ldbx is the leading dimension of the array specified for bx.
If you are doing a factor only, this argument is not used in the computation.
Specified as: a fullword integer; ldbx >= n and:
If mbx <> 0, then ldbx > 0.
If mbx = 0, then ldbx >= 0.
If you are doing a factor and solve or a solve only, mbx is the number of right-hand side vectors, b, in the array specified for bx.
If you are doing a factor only, this argument is not used in the computation.
Specified as: a fullword integer; mbx >= 0.
If IPARM(5) = 0, diagonal-out skyline storage mode is used for A.
If IPARM(5) = 1, profile-in skyline storage mode is used for A.
(If mbx = 0 and you are doing a solve only, then au is unchanged on output.) Returned as: a one-dimensional array of (at least) length nu, containing long-precision real numbers.
If IPARM(5) = 0, diagonal-out skyline storage mode is used for A.
If IPARM(5) = 1, profile-in skyline storage mode is used for A.
(If mbx = 0 and you are doing a solve only, then al is unchanged on output.) Returned as: a one-dimensional array of (at least) length nl, containing long-precision real numbers.
If you are doing a factor and solve or a factor only, and:
If you are doing a solve only, this argument is not used in the computation and is unchanged.
If you are doing a factor and solve or a factor only, IPARM(21) through IPARM(25) have the following meanings for each region i for i = 1,5, respectively:
If you are doing a solve only, these arguments are not used in the computation and are unchanged.
Returned as: a one-dimensional array of (at least) length 25, containing fullword integers.
If you are doing a factor and solve or a factor only, and:
If you are doing a solve only, this argument is not used in the computation and is unchanged.
If you are computing the determinant of matrix A, then RPARM(17) is the mantissa, detbas, and RPARM(18) is the power of 10, detpwr, used to express the value of the determinant: detbas(10detpwr), where 1 <= detbas < 10. Also:
If you are not computing the determinant of matrix A, these arguments are not used in the computation and are unchanged.
Returned as: a one-dimensional array of (at least) length 25, containing long-precision real numbers.
If you are doing a factor and solve or a solve only, bx is the array, containing the mbx solution vectors x of the system Ax = b or ATx = b. Each vector x is length n and is stored in the corresponding column of the array. (If mbx = 0, then bx is unchanged on output.)
If you are doing a factor only, this argument is not used in the computation and is unchanged.
Returned as: an ldbx by (at least) mbx array, containing long-precision real numbers.
![]() |
For a description of how sparse matrices are stored in skyline storage mode, see Profile-In Skyline Storage Mode and Diagonal-Out Skyline Storage Mode.
You use the partial factorization function when, for design or storage reasons, you must factor the matrix A in stages. When doing a partial factorization, you must use the same skyline storage mode for all parts of the matrix as it is progressively factored.
This subroutine can factor, compute the determinant of, and solve general sparse matrix A, stored in skyline storage mode. For all computations, input matrix A can be stored in either diagonal-out or profile-in skyline storage mode. Output matrix A can also be stored in either of these modes and can be different from the mode used for input.
Matrix A is factored into the following form using specified pivot processing:
where:
The transformed matrix A, factored into its LU form, is stored in packed format in arrays AU and AL. The inverse of the diagonal of matrix U is stored in the corresponding elements of array AU. The off-diagonal elements of the upper triangular matrix U are stored in the corresponding off-diagonal elements of array AU. The off-diagonal elements of the lower triangular matrix L are stored in the corresponding off-diagonal elements of array AL. (The diagonal elements stored in array AL do not have meaningful values.)
The partial factorization of matrix A, which you can do when you specify the factor-only option, assumes that the first IPARM(3) rows and columns are already factored in the input matrix. It factors the remaining n-IPARM(3) rows and columns in matrix A. (See Notes for an illustration.) It updates only the elements in arrays AU and AL corresponding to the part of matrix A that is factored.
The determinant can be computed with any of the factorization computations. With a full factorization, you get the determinant for the whole matrix. With a partial factorization, you get the determinant for only that part of the matrix factored in this computation.
The system Ax = b or ATx = b, having multiple right-hand sides, is solved for x, using the transformed matrix A produced by this call or a subsequent call to this subroutine.
See references [9], [12], [25], [47], and [71]. If n is 0, no computation is performed. If mbx is 0, no solve is performed.
This example shows how to factor a 9 by 9 general sparse matrix A and solve the system Ax = b with three right-hand sides. The default values are used for IPARM and RPARM. Input matrix A, shown here, is stored in diagonal-out skyline storage mode. Matrix A is:
* * | 2.0 2.0 2.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 2.0 4.0 4.0 2.0 2.0 0.0 0.0 0.0 2.0 | | 2.0 4.0 6.0 4.0 4.0 0.0 2.0 0.0 4.0 | | 2.0 4.0 6.0 6.0 6.0 2.0 4.0 0.0 6.0 | | 0.0 0.0 0.0 2.0 4.0 4.0 4.0 2.0 4.0 | | 0.0 2.0 4.0 6.0 8.0 6.0 8.0 4.0 10.0 | | 0.0 0.0 0.0 2.0 4.0 6.0 8.0 6.0 8.0 | | 0.0 0.0 0.0 2.0 4.0 6.0 8.0 8.0 10.0 | | 2.0 4.0 6.0 6.0 8.0 6.0 10.0 8.0 16.0 | * *
Output matrix A, shown here, is in LU factored form with U-1 on the diagonal, and is stored in diagonal-out skyline storage mode. Matrix B is:
* * | 0.5 2.0 2.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 1.0 0.5 2.0 2.0 2.0 0.0 0.0 0.0 2.0 | | 1.0 1.0 0.5 2.0 2.0 0.0 2.0 0.0 2.0 | | 1.0 1.0 1.0 0.5 2.0 2.0 2.0 0.0 2.0 | | 0.0 0.0 0.0 1.0 0.5 2.0 2.0 2.0 2.0 | | 0.0 1.0 1.0 1.0 1.0 0.5 2.0 2.0 2.0 | | 0.0 0.0 0.0 1.0 1.0 1.0 0.5 2.0 2.0 | | 0.0 0.0 0.0 1.0 1.0 1.0 1.0 0.5 2.0 | | 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 0.5 | * *
N AU NU IDU AL NL IDL IPARM RPARM AUX NAUX BX LDBX MBX | | | | | | | | | | | | | | CALL DGKFS( 9 , AU, 33, IDU, AL, 35, IDL, IPARM, RPARM, AUX, 57 , BX , 12 , 3 )
AU = (2.0, 4.0, 2.0, 6.0, 4.0, 2.0, 6.0, 4.0, 2.0, 4.0, 6.0, 4.0, 2.0, 6.0, 4.0, 2.0, 8.0, 8.0, 4.0, 4.0, 2.0, 8.0, 6.0, 4.0, 2.0, 16.0, 10.0, 8.0, 10.0, 4.0, 6.0, 4.0, 2.0) IDU = (1, 2, 4, 7, 10, 14, 17, 22, 26, 34) AL = (0.0, 0.0, 2.0, 0.0, 4.0, 2.0, 0.0, 6.0, 4.0, 2.0, 0.0, 2.0, 0.0, 8.0, 6.0, 4.0, 2.0, 0.0, 6.0, 4.0, 2.0, 0.0, 8.0, 6.0, 4.0, 2.0, 0.0, 8.0, 10.0, 6.0, 8.0, 6.0, 6.0, 4.0, 2.0) IDL = (1, 2, 4, 7, 11, 13, 18, 22, 27, 36) IPARM = (0, . , . , . , . , . , . , . , . , . , . , . , . , . , . , . , . , . , . , . , . , . , . , . , . )
* * | 6.00 12.00 18.00 | | 16.00 32.00 48.00 | | 26.00 52.00 78.00 | | 36.00 72.00 108.00 | | 20.00 40.00 60.00 | BX = | 48.00 96.00 144.00 | | 34.00 68.00 102.00 | | 38.00 76.00 114.00 | | 66.00 132.00 198.00 | | . . . | | . . . | | . . . | * *
* * | 1.00 2.00 3.00 | | 1.00 2.00 3.00 | | 1.00 2.00 3.00 | | 1.00 2.00 3.00 | | 1.00 2.00 3.00 | BX = | 1.00 2.00 3.00 | | 1.00 2.00 3.00 | | 1.00 2.00 3.00 | | 1.00 2.00 3.00 | | . . . | | . . . | | . . . | * *
This example shows how to factor the 9 by 9 general sparse matrix A from Example 1, solve the system ATx = b with three right-hand sides, and compute the determinant of A. The default values for pivot processing are used for IPARM. Input matrix A is stored in profile-in skyline storage mode. Output matrix A is in LU factored form with U-1 on the diagonal, and is stored in diagonal-out skyline storage mode. It is the same as output matrix A in Example 1.
N AU NU IDU AL NL IDL IPARM RPARM AUX NAUX BX LDBX MBX | | | | | | | | | | | | | | CALL DGKFS( 9, AU, 33, IDU, AL, 35, IDL, IPARM, RPARM, AUX, 57 , BX , 12 , 3 )
AU = (2.0, 2.0, 4.0, 2.0, 4.0, 6.0, 2.0, 4.0, 6.0, 2.0, 4.0, 6.0, 4.0, 2.0, 4.0, 6.0, 2.0, 4.0, 4.0, 8.0, 8.0, 2.0, 4.0, 6.0, 8.0, 2.0, 4.0, 6.0, 4.0, 10.0, 8.0, 10.0, 16.0) IDU = (1, 3, 6, 9, 13, 16, 21, 25, 33, 34) AL = (0.0, 2.0, 0.0, 2.0, 4.0, 0.0, 2.0, 4.0, 6.0, 0.0, 2.0, 0.0, 2.0, 4.0, 6.0, 8.0, 0.0, 2.0, 4.0, 6.0, 0.0, 2.0, 4.0, 6.0, 8.0, 0.0, 2.0, 4.0, 6.0, 6.0, 8.0, 6.0, 10.0, 8.0, 0.0) IDL = (1, 3, 6, 10, 12, 17, 21, 26, 35, 36) IPARM = (1, 110, 0, 1, 0, . , . , . , . , 0, . , . , . , . , . , . , . , . , . , . , . , . , . , . , . )
* * | 10.00 20.00 30.00 | | 20.00 40.00 60.00 | | 28.00 56.00 84.00 | | 30.00 60.00 90.00 | | 40.00 80.00 120.00 | BX = | 30.00 60.00 90.00 | | 44.00 88.00 132.00 | | 28.00 56.00 84.00 | | 60.00 120.00 180.00 | | . . . | | . . . | | . . . | * *
This example shows how to factor a 9 by 9 negative-definite general sparse matrix A, solve the system Ax = b with three right-hand sides, and compute the determinant of A. (Default values for pivot processing are not used for IPARM because A is negative-definite.) Input matrix A, shown here, is stored in diagonal-out skyline storage mode:
* * | -2.0 -2.0 -2.0 0.0 0.0 0.0 0.0 0.0 0.0 | | -2.0 -4.0 -4.0 -2.0 -2.0 0.0 0.0 0.0 -2.0 | | -2.0 -4.0 -6.0 -4.0 -4.0 0.0 -2.0 0.0 -4.0 | | -2.0 -4.0 -6.0 -6.0 -6.0 -2.0 -4.0 0.0 -6.0 | | 0.0 0.0 0.0 -2.0 -4.0 -4.0 -4.0 -2.0 -4.0 | | 0.0 -2.0 -4.0 -6.0 -8.0 -6.0 -8.0 -4.0 -10.0 | | 0.0 0.0 0.0 -2.0 -4.0 -6.0 -8.0 -6.0 -8.0 | | 0.0 0.0 0.0 -2.0 -4.0 -6.0 -8.0 -8.0 -10.0 | | -2.0 -4.0 -6.0 -6.0 -8.0 -6.0 -10.0 -8.0 -16.0 | * *
Output matrix A, shown here, is in LU factored form with U-1 on the diagonal, and is stored in diagonal-out skyline storage mode. Matrix A is:
* * | -0.5 -2.0 -2.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 1.0 -0.5 -2.0 -2.0 -2.0 0.0 0.0 0.0 -2.0 | | 1.0 1.0 -0.5 -2.0 -2.0 0.0 -2.0 0.0 -2.0 | | 1.0 1.0 1.0 -0.5 -2.0 -2.0 -2.0 0.0 -2.0 | | 0.0 0.0 0.0 1.0 -0.5 -2.0 -2.0 -2.0 -2.0 | | 0.0 1.0 1.0 1.0 1.0 -0.5 -2.0 -2.0 -2.0 | | 0.0 0.0 0.0 1.0 1.0 1.0 -0.5 -2.0 -2.0 | | 0.0 0.0 0.0 1.0 1.0 1.0 1.0 -0.5 -2.0 | | 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 -0.5 | * *
N AU NU IDU AL NL IDL IPARM RPARM AUX NAUX BX LDBX MBX | | | | | | | | | | | | | | CALL DGKFS( 9, AU, 33, IDU, AL, 35, IDL, IPARM, RPARM, AUX, 57 , BX , 12 , 3 )
AU = (-2.0, -4.0, -2.0, -6.0, -4.0, -2.0, -6.0, -4.0, -2.0, -4.0, -6.0, -4.0, -2.0, -6.0, -4.0, -2.0, -8.0, -8.0, -4.0, -4.0, -2.0, -8.0, -6.0, -4.0, -2.0, -16.0, -10.0, -8.0, -10.0, -4.0, -6.0, -4.0, -2.0) IDU = (1, 2, 4, 7, 10, 14, 17, 22, 26, 34) AL = (0.0, 0.0, -2.0, 0.0, -4.0, -2.0, 0.0, -6.0, -4.0, -2.0, 0.0, -2.0, 0.0, -8.0, -6.0, -4.0, -2.0, 0.0, -6.0, -4.0, -2.0, 0.0, -8.0, -6.0, -4.0, -2.0, 0.0, -8.0, -10.0, -6.0, -8.0, -6.0, -6.0, -4.0, -2.0) IDL = (1, 2, 4, 7, 11, 13, 18, 22, 27, 36) IPARM = (1, 10, 0, 0, 0, . , . , . , . , 1, 0, -1, -1, -1, -1, . , . , . , . , . , . , . , . , . , . )
* * | -1.00 -2.00 -3.00 | | -1.00 -2.00 -3.00 | | -1.00 -2.00 -3.00 | | -1.00 -2.00 -3.00 | | -1.00 -2.00 -3.00 | BX = | -1.00 -2.00 -3.00 | | -1.00 -2.00 -3.00 | | -1.00 -2.00 -3.00 | | -1.00 -2.00 -3.00 | | . . . | | . . . | | . . . | * *
This example shows how to factor the first six rows and columns, referred to as matrix A1, of the 9 by 9 general sparse matrix A from Example 1 and compute the determinant of A1. Input matrix A1, shown here, is stored in diagonal-out skyline storage mode. Input matrix A1 is:
* * | 2.0 2.0 2.0 0.0 0.0 0.0 | | 2.0 4.0 4.0 2.0 2.0 0.0 | | 2.0 4.0 6.0 4.0 4.0 0.0 | | 2.0 4.0 6.0 6.0 6.0 2.0 | | 0.0 0.0 0.0 2.0 4.0 4.0 | | 0.0 2.0 4.0 6.0 8.0 6.0 | * *
Output matrix A1, shown here, is in LU factored form with U-1 on the diagonal, and is stored in diagonal-out skyline storage mode. Output matrix A1 is:
* * | 0.5 2.0 2.0 0.0 0.0 0.0 | | 1.0 0.5 2.0 2.0 2.0 0.0 | | 1.0 1.0 0.5 2.0 2.0 0.0 | | 1.0 1.0 1.0 0.5 2.0 2.0 | | 0.0 0.0 0.0 1.0 0.5 2.0 | | 0.0 1.0 1.0 1.0 1.0 0.5 | * *
N AU NU IDU AL NL IDL IPARM RPARM AUX NAUX BX LDBX MBX | | | | | | | | | | | | | | CALL DGKFS( 6, AU, 33, IDU, AL, 35, IDL, IPARM, RPARM, AUX, 45 , BX , LDBX , MBX )
This example shows how to do a partial factorization of the 9 by 9 general sparse matrix A from Example 1, where the first six rows and columns were factored in Example 4. It factors the remaining three rows and columns and computes the determinant of that part of the matrix. The input matrix, referred to as A2, shown here, is made up of the output factored matrix A1 plus the three remaining unfactored rows and columns of matrix A. Matrix A2 is:
* * | 0.5 2.0 2.0 0.0 0.0 0.0 0.0 0.0 0.0 | | 1.0 0.5 2.0 2.0 2.0 0.0 0.0 0.0 2.0 | | 1.0 1.0 0.5 2.0 2.0 0.0 2.0 0.0 4.0 | | 1.0 1.0 1.0 0.5 2.0 2.0 4.0 0.0 6.0 | | 0.0 0.0 0.0 1.0 0.5 2.0 4.0 2.0 4.0 | | 0.0 1.0 1.0 1.0 1.0 0.5 8.0 4.0 10.0 | | 0.0 0.0 0.0 2.0 4.0 6.0 8.0 6.0 8.0 | | 0.0 0.0 0.0 2.0 4.0 6.0 8.0 8.0 10.0 | | 2.0 4.0 6.0 6.0 8.0 6.0 10.0 8.0 16.0 | * *
Both parts of input matrix A2 are stored in diagonal-out skyline storage mode.
Output matrix A2 is the same as output matrix A in Example 1 and is stored in diagonal-out skyline storage mode.
N AU NU IDU AL NL IDL IPARM RPARM AUX NAUX BX LDBX MBX | | | | | | | | | | | | | | CALL DGKFS( 9, AU, 33, IDU, AL, 35, IDL, IPARM, RPARM, AUX, 45 , BX , LDBX , MBX )
This example shows how to solve the system Ax = b with one right-hand side for a general sparse matrix A. Input matrix A, used here, is the same as factored output matrix A from Example 1, stored in profile-in skyline storage mode. Here, output matrix A is unchanged on output and is stored in profile-in skyline storage mode.
N AU NU IDU AL NL IDL IPARM RPARM AUX NAUX BX LDBX MBX | | | | | | | | | | | | | | CALL DGKFS( 9, AU, 33, IDU, AL, 35, IDL, IPARM, RPARM, AUX, 49 , BX , 9 , 1 )