IBM Books

Engineering and Scientific Subroutine Library for AIX Version 3 Release 3: Guide and Reference

DGSS--General Sparse Matrix or Its Transpose Solve Using Storage by Indices, Rows, or Columns

This subroutine solves either of the following systems:

Ax = b
ATx = b

where A is a sparse matrix, AT is the transpose of sparse matrix A, and x and b are vectors. DGSS uses the results of the factorization of matrix A, produced by a preceding call to DGSF.

Note:
The input to this solve subroutine must be the output from the factorization subroutine, DGSF.

Syntax

Fortran CALL DGSS (jopt, n, a, ia, ja, lna, bx, aux, naux)
C and C++ dgss (jopt, n, a, ia, ja, lna, bx, aux, naux);
PL/I CALL DGSS (jopt, n, a, ia, ja, lna, bx, aux, naux);

On Entry

jopt
indicates the type of computation to be performed, where:

If jopt = 0, Ax = b is solved, where the right-hand side is not sparse.

If jopt = 1, ATx = b is solved, where the right-hand side is not sparse.

If jopt = 10, Ax = b is solved, where the right-hand side is sparse.

If jopt = 11, ATx = b is solved, where the right-hand side is sparse.

Specified as: a fullword integer; jopt = 0, 1, 10, or 11.

n
is the order n of sparse matrix A. Specified as: a fullword integer; n >= 0.

a
is the factorization of sparse matrix A, stored in array A, produced by a preceding call to DGSF. Specified as: an array of length lna, containing long-precision real numbers.

ia
is the array, referred to as IA, produced by a preceding call to DGSF. Specified as: an array of length lna, containing fullword integers.

ja
is the array, referred to as JA, produced by a preceding call to DGSF. Specified as: an array of length lna, containing fullword integers.

lna
is the length of the arrays A, IA, and JA. In DGSS, lna must be identical to the value specified in DGSF; otherwise, results are unpredictable. Specified as: a fullword integer; lna > 0.

bx
is the vector b of length n, containing the right-hand side of the system. Specified as: a one-dimensional array of (at least) length n, containing long-precision real numbers.

aux
is the storage work area passed to this subroutine by a preceding call to DGSF. Its size is specified by naux. Specified as: an area of storage, containing long-precision real numbers.

naux
is the size of the work area specified by aux--that is, the number of elements in aux. Specified as: a fullword integer; naux >= 10n+100.

On Return

ia
is the transformed array, referred to as IA, which can be used as input in subsequent calls to this subroutine. This may result in a performance increase. Specified as: an array of length lna, containing fullword integers.

bx
is the solution vector x of length n, containing the results of the computation. Specified as: a one-dimensional array, containing long-precision real numbers.

Notes
  1. The input arguments n, lna, and naux, must be the same as those specified for DGSF. Whereas, the input arguments a, ia, ja, and aux must be those produced on output by DGSF. Otherwise, results are unpredictable.
  2. You have the option of having the minimum required value for naux dynamically returned to your program. For details, see Using Auxiliary Storage in ESSL.

Function

The system Ax = b is solved for x, where A is a sparse matrix and x and b are vectors. Depending on the value specified for the jopt argument, DGSS can also solve the system ATx = b, where AT is the transpose of sparse matrix A.

If the value specified for the jopt argument is 0 or 10, the following equation is solved:

Ax = b

If the value specified for the jopt argument is 1 or 11, the following equation is solved:

ATx = b

DGSS uses the results of the factorization of matrix A, produced by a preceding call to DGSF. The transformed matrix A consists of the upper triangular matrix U and the lower triangular matrix L.

See references [10], [47], and [93].

Error Conditions

Computational Errors

None

Input-Argument Errors
  1. jopt <> 0, 1, 10, or 11
  2. n < 0
  3. lna <= 0
  4. naux is too small--that is, less than the minimum required value. Return code 1 is returned if error 2015 is recoverable.

Example 1

This example shows how to solve the system Ax = b, where matrix A is a 5 by 5 sparse matrix. The right-hand side is not sparse.

Note:
The input for this subroutine is the same as the output from DGSF, except for BX.
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 |
                *                         *

Call Statement and Input
          JOPT  N   A   IA   JA   LNA   BX   AUX   NAUX
           |    |   |    |    |    |     |    |     |
CALL DGSS( 0  , 5 , A , IA , JA , 27  , BX , AUX , 150 )
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)
BX       =  (1.0, 1.0, 1.0, 1.0, 1.0)

Output
IA       =  (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, . , . , . , . ,
             . , . , . , 2, 1, 1, 3, 3, 5, 5)
BX       =  (-5.500000, 9.500000, 3.000000, -2.000000, -1.000000)

Example 2

This example shows how to solve the system ATx = b, using the same matrix A used in Example 1. The input is also the same as in Example 1, except for the jopt argument. The right-hand side is not sparse.

Call Statement and Input
          JOPT  N   A   IA   JA   LNA   BX   AUX   NAUX
           |    |   |    |    |    |     |    |     |
CALL DGSS( 1  , 5 , A , IA , JA , 27  , BX , AUX , 150 )
 
BX       =  (1.0, 1.0, 1.0, 1.0, 1.0)

Output
IA       =  (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, . , . , . , . ,
             . , . , . , 2, 1, 1, 3, 3, 5, 5)
BX       =  (0.000000, -3.000000, -2.000000, 2.000000, 7.000000)

Example 3

This example shows how to solve the system Ax = b, using the same matrix A as in Examples 1 and 2. The input is also the same as in Examples 1 and 2, except for the jopt and bx arguments. The right-hand side is sparse.

Call Statement and Input
          JOPT  N   A   IA   JA   LNA   BX   AUX   NAUX
           |    |   |    |    |    |     |    |     |
CALL DGSS( 10 , 5 , A , IA , JA , 27  , BX , AUX , 150 )
 
BX       =  (0.0, 0.0, 0.0, 1.0, 0.0)

Output
IA       =  (1, 4, 2, 5, 3, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
             0, 2, 1, 1, 3, 3, 5, 5)
BX       =  (0.000000, 3.000000, 0.000000, 0.000000, -1.000000)

Example 4

This example shows how to solve the system ATx = b, using the same matrix A as in Examples 1, 2, and 3. The input is also the same as in Examples 1, 2, and 3, except for the jopt argument. The right-hand side is sparse.

Call Statement and Input
          JOPT  N   A   IA   JA   LNA   BX   AUX   NAUX
           |    |   |    |    |    |     |    |     |
CALL DGSS( 11 , 5 , A , IA , JA , 27  , BX , AUX , 150 )
 
BX       =  (0.0, 0.0, 0.0, 1.0, 0.0)

Output
IA       =  (1, 4, 2, 5, 3, 5, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
             0, 2, 1, 1, 3, 3, 5, 5)
BX       =   (0.000000, 0.000000, 1.000000, 0.000000, -3.000000 )


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]