Previous Next Contents Generated Index Doc Set Home



Solution to a Linear System in a UDU-Factored Symmetric Matrix in Packed Storage

The subroutines described in this section solve the linear system Ax = b for a symmetric matrix A in packed storage, which has been UDU-factored by xSPCO or xSPFA, and vectors b and x.

Calling Sequence

CALL DSPSL 
(DA, N, IPIVOT, DB)
CALL SSPSL 
(SA, N, IPIVOT, SB)
CALL ZSPSL 
(ZA, N, IPIVOT, ZB)
CALL CSPSL 
(CA, N, IPIVOT, CB)






void dspsl 
(double *da, int n, int *ipivot, double *db)
void sspsl 
(float *sa, int n, int *ipivot, float *sb)
void zspsl 
(doublecomplex *za, int n, int *ipivot, doublecomplex 
*zb)
void cspsl 
(complex *ca, int n, int *ipivot, complex *cb)

Arguments

xA

UDU factorization of the matrix A, as computed by xSPCO or xSPFA.

N

Order of the matrix A. N 0.

IPIVOT

Pivot vector as computed by xSPCO or xSPFA.

xB

On entry, the right-hand side vector b.
On exit, the solution vector x.

Sample Program

 
      PROGRAM TEST
      IMPLICIT NONE
C
      INTEGER           LENGTA, N
      PARAMETER        (N = 3)
      PARAMETER        (LENGTA = (N * N + N) / 2)
C
      DOUBLE PRECISION  A(LENGTA), B(N), RCOND, WORK(N)
      INTEGER           IPIVOT(N)
C
      EXTERNAL          DSPCO, DSPSL
C
C     Initialize the array A to store in packed symmetric format
C     the matrix A shown below.  Initialize the array B to store
C     the vector b shown below.
C
C         1  0  4        15
C     A = 0  2  0    b = 12
C         4  0  1        15
C
      DATA A / 1.0D0, 0.0D0, 2.0D0, 4.0D0, 0.0D0, 1.0D0 /
      DATA B / 1.5D1, 1.2D1, 1.5D1 /
C
      PRINT 1000
      PRINT 1010, A(1), A(2), A(4)
      PRINT 1010, A(2), A(3), A(5)
      PRINT 1010, A(4), A(5), A(6)
      PRINT 1020
      PRINT 1030, B
      CALL DSPCO (A, N, IPIVOT, RCOND, WORK)
      IF ((RCOND + 1.0D0) .EQ. RCOND) THEN
        PRINT 1040
      END IF
      CALL DSPSL (A, N, IPIVOT, B)
      PRINT 1050
      PRINT 1030, B
C
 1000 FORMAT (1X, 'A:')
 1010 FORMAT (3(3X, F4.1))
 1020 FORMAT (/1X, 'b:')
 1030 FORMAT (3X, F4.1)
 1040 FORMAT (1X, 'A may be singular to working precision.')
 1050 FORMAT (/1X, 'A**(-1) * b:')
C
      END
 

Sample Output

 
 A:
    1.0    0.0    4.0
    0.0    2.0    0.0
    4.0    0.0    1.0



 b:
   15.0
   12.0
   15.0



 A**(-1) * b:
    3.0
    6.0
    3.0






Previous Next Contents Generated Index Doc Set Home