IBM Books

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

SPOSM, DPOSM, CPOSM, ZPOSM, SPOTRS, DPOTRS, CPOTRS, and ZPOTRS--Positive Definite Real Symmetric or Complex Hermitian Matrix Multiple Right-Hand Side Solve

These subroutines solve the system AX  =  B for X, using multiple right-hand sides, where X and B are general matrices and:

|SPOSM, DPOSM, CPOSM, and ZPOSM use the results of the factorization of matrix A, produced by a preceding call to SPOF/SPOFCD, DPOF/DPOFCD, CPOF, or ZPOF, respectively.

|SPOTRS, DPOTRS, CPOTRS, and ZPOTRS use the results of the |factorization of matrix A, produced by a preceding call to |SPOTRF, DPOTRF, CPOTRF, or ZPOTRF, respectively.

Table 95. Data Types

A, B, X Subroutine
Short-precision real SPOSM and SPOTRS
Long-precision real DPOSM and DPOTRF
Short-precision complex CPOSM and CPOTRF
Long-precision complex ZPOSM and ZPOTRF
Note:
|The input to these solve subroutines must be the output from the |corresponding factorization subroutines. |

Syntax

Fortran CALL SPOSM | DPOSM | CPOSM | ZPOSM (uplo, a, lda, n, b, ldb, nrhs)

CALL SPOTRS | DPOTRS | CPOTRS | ZPOTRS (uplo, n, nrhs, a, lda, b, ldb, info)

C and C++ sposm | dposm | cposm | zposm (uplo, a, lda, n, b, ldb, nrhs);

spotrs | dpotrs | cpotrs | zpotrs (uplo, n, nrhs, a, lda, b, ldb, info);

PL/I CALL SPOSM | DPOSM | CPOSM | ZPOSM (uplo, a, lda, n, b, ldb, nrhs);

CALL SPOTRS | DPOTRS | CPOTRS | ZPOTRS (uplo, n, nrhs, a, lda, b, ldb, info);

On Entry

uplo
indicates whether the original matrix A is stored in upper or lower storage mode, where:

If uplo = 'U', A is stored in upper storage mode.

If uplo = 'L', A is stored in lower storage mode.

Specified as: a single character. It must be 'U' or 'L'.

a
is the factorization of positive definite matrix A, produced by a preceding call to SPOF/SPOFCD, DPOF/DPOFCD, CPOF, ZPOF, |SPOTRF, DPOTRF, CPOTRF, or ZPOTRF, respectively. Specified as: an lda by (at least) n array, containing numbers of the data type indicated in Table 95.

lda
is the leading dimension of the array specified for a. Specified as: a fullword integer; lda > 0 and lda >= n.

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

b
is the matrix B, containing the nrhs right-hand sides of the system. The right-hand sides, each of length n, reside in the columns of matrix B. Specified as: an ldb by (at least) nrhs array, containing numbers of the data type indicated in Table 95.

ldb
is the leading dimension of the array specified for b. Specified as: a fullword integer; ldb > 0 and ldb >= n.

nrhs
is the number of right-hand sides in the system to be solved. Specified as: a fullword integer; nrhs >= 0.

|info
|See On Return.

On Return

b
is the matrix B, containing the nrhs solutions to the system in the columns of B. Specified as: an ldb by (at least) nrhs array, containing numbers of the data type indicated in Table 95.

| info
|info has the following meaning:

|If info = 0, the solve completed successfully.

Notes
  1. |In your C program, argument info must be passed by |reference.
  2. All subroutines accept lowercase letters for the uplo argument.
  3. The scalar data specified for input arguments uplo, lda, and n for these subroutines must be the same as the corresponding input arguments specified for |SPOF/SPOFCD/SPOTRF, DPOF/DPOFCD/DPOTRF, CPOF/CPOTRF, and |ZPOF/ZPOTRF, respectively.
  4. The array data specified for input argument a for these subroutines must be the same as the corresponding output arguments for |SPOF/SPOFCD/SPOTRF, DPOF/DPOFCD/DPOTRF, CPOF/CPOTRF, and |ZPOF/ZPOTRF, respectively.
  5. The vectors and matrices used in this computation must have no common elements; otherwise, results are unpredictable. See Concepts.
  6. For a description of how the matrices are stored:

Function

The system AX = B is solved for X, using multiple right-hand sides, where X and B are general matrices, and A is a positive definite symmetric matrix for SPOSM, DPOSM, |SPOTRS, and DPOTRS, and a positive definite complex Hermitian matrix for CPOSM, ZPOSM, |CPOTRS, and ZPOTRS. These subroutines use the results of the factorization of matrix A, produced by a preceding call to |SPOF/SPOFCD/SPOTRF, DPOF/DPOFCD/DPOTRF, CPOF/CPOTRF, or |ZPOF/ZPOTRF, respectively. For a description of how A is factored, see SPPF, DPPF, SPOF, DPOF, CPOF, ZPOF, SPOTRF, DPOTRF, CPOTRF, and ZPOTRF--Positive Definite Real Symmetric or Complex Hermitian Matrix Factorization.

If n or nrhs is 0, no computation is performed. See references [8] and [36].

Error Conditions

Computational Errors

None

Note:
If the factorization performed by SPOF, DPOF, CPOF, ZPOF, SPOFCD, DPOFCD, |SPOTRF, DPOTRF, CPOTRF, or ZPOTRF failed because matrix A was not positive definite, the results returned by this subroutine are unpredictable, and there may be a divide-by-zero program exception message.

Input-Argument Errors
  1. uplo <> 'U' or 'L'
  2. lda, ldb <= 0
  3. n < 0
  4. n > lda
  5. n > ldb
  6. nrhs < 0

Example 1

This example shows how to solve the system AX = B for two right-hand sides, where matrix A is the same matrix factored in the Example 3 for SPOF and SPOTRF.

Call Statement and Input
            UPLO  A  LDA  N   B  LDB  NRHS
             |    |   |   |   |   |    |
CALL SPOSM( 'L' , A , 9 , 9 , B , 9 ,  2  )

|or

|             UPLO  N  NRHS  A  LDA  B  LDB  INFO
|              |    |   |    |   |   |   |    |
|CALL SPOTRS( 'L' , 9 , 2 ,  A , 9 , B , 9 , INFO  )


A =(same as output A in Example 3)
        *             *
        |  9.0   45.0 |
        | 17.0   89.0 |
        | 24.0  131.0 |
        | 30.0  170.0 |
B    =  | 35.0  205.0 |
        | 39.0  235.0 |
        | 42.0  259.0 |
        | 44.0  276.0 |
        | 45.0  285.0 |
        *             *

Output
        *          *
        | 1.0  1.0 |
        | 1.0  2.0 |
        | 1.0  3.0 |
        | 1.0  4.0 |
B    =  | 1.0  5.0 |
        | 1.0  6.0 |
        | 1.0  7.0 |
        | 1.0  8.0 |
        | 1.0  9.0 |
        *          *
|INFO =    0

Example 2

This example shows how to solve the system ATX = B for two right-hand sides, where matrix A is the input matrix factored in Example 4 for SPOF and SPOTRF.

Call Statement and Input
            UPLO  A  LDA  N   B  LDB  NRHS
             |    |   |   |   |   |    |
CALL SPOSM( 'U' , A , 9 , 9 , B , 9 ,  2  )

|or

|             UPLO  N  NRHS A  LDA  B  LDB  INFO
|              |    |   |   |   |   |   |    |
|CALL SPOTRS( 'U' , 9 , 2 , A , 9 , B , 9 , INFO  )


A =(same as output A in Example 4)
        *             *
        |  9.0   45.0 |
        | 17.0   89.0 |
        | 24.0  131.0 |
        | 30.0  170.0 |
B    =  | 35.0  205.0 |
        | 39.0  235.0 |
        | 42.0  259.0 |
        | 44.0  276.0 |
        | 45.0  285.0 |
        *             *

Output
        *          *
        | 1.0  1.0 |
        | 1.0  2.0 |
        | 1.0  3.0 |
        | 1.0  4.0 |
B    =  | 1.0  5.0 |
        | 1.0  6.0 |
        | 1.0  7.0 |
        | 1.0  8.0 |
        | 1.0  9.0 |
        *          *
|INFO =     0

Example 3

This example shows how to solve the system AX = B for two right-hand sides, where matrix A is the same matrix factored in the Example 5 for CPOF |and CPOTRF.

Call Statement and Input
            UPLO  A  LDA  N   B  LDB  NRHS
             |    |   |   |   |   |    |
CALL CPOSM( 'L' , A , 3 , 3 , B , 3 ,  2  )

|or

|             UPLO  N  NRHS A  LDA  X   LDB  INFO
|              |    |   |   |   |   |    |    |
|CALL CPOTRS( 'L' , 3 , 2 , A , 3 , BX , 3 , INFO  )


A =(same as output A in Example 5)
        *                                *
        |  (60.0, -55.0)    (70.0, 10.0) |
B    =  |   (34.0, 58.0)  (-51.0, 110.0) |
        | (13.0, -152.0)    (75.0, 63.0) |
        *                                *

Output
        *                          *
        | (2.0, -1.0)  ( 2.0, 0.0) |
B    =  | (1.0,  1.0)  (-1.0, 2.0) |
        | (0.0, -2.0)  ( 1.0, 1.0) |
        *                          *
|INFO =     0    

Example 4

This example shows how to solve the system AX = B for two right-hand sides, where matrix A is the input matrix factored in Example 6 for CPOF |and CPOTRF.

Call Statement and Input
            UPLO  A  LDA  N   B  LDB  NRHS
             |    |   |   |   |   |    |
CALL CPOSM( 'U' , A , 3 , 3 , B , 3 ,  2  )

|or

|             UPLO  N  NRHS A  LDA  B   LDB  INFO
|              |    |   |   |   |   |    |    |
|CALL CPOTRS( 'U' , 3 , 2 , A , 3 , B , 3 , INFO  )


A =(same as output A in Example 6)
        *                               *
        | ( 33.0, -18.0)  (15.0,  -3.0) |
B    =  | ( 45.0, -45.0)  ( 8.0,  -2.0) |
        | (152.0,   1.0)  (43.0, -29.0) |
        *                               *

Output
        *                          *
        | (2.0, -1.0)  (2.0,  0.0) |
B    =  | (1.0, -1.0)  (0.0,  1.0) |
        | (3.0,  0.0)  (1.0, -1.0) |
        *                          *
|INFO =     0


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