LSLQS

Solves a real symmetric positive definite system of linear equations in band symmetric storage mode without iterative refinement.

Required Arguments

ANCODA + 1 by N array containing the N by N positive definite band symmetric coefficient matrix in band symmetric storage mode. (Input)

NCODA — Number of upper codiagonals of A. (Input)

B — Vector of length N containing the right-hand side of the linear system. (Input)

X — Vector of length N containing the solution to the linear system. (Output)

Optional Arguments

N — Number of equations. (Input)
Default: N = size (A,2).

LDA — Leading dimension of A exactly as specified in the dimension statement of the calling program. (Input)
Default: LDA = size (A,1).

FORTRAN 90 Interface

Generic: CALL LSLQS (A, NCODA, B, X [, …])

Specific: The specific interface names are S_LSLQS and D_LSLQS.

FORTRAN 77 Interface

Single: CALL LSLQS (N, A, LDA, NCODA, B, X)

Double: The double precision name is DLSLQS.

Description

Routine LSLQS solves a system of linear algebraic equations having a real symmetric positive definite band coefficient matrix. It first uses the routine LFCQS to compute an RTR Cholesky factorization of the coefficient matrix and to estimate the condition number of the matrix. R is an upper triangular band matrix. The solution of the linear system is then found using the routine LFSQS.

LSLQS fails if any submatrix of R is not positive definite or if R has a zero diagonal element. These errors occur only if A is very close to a singular matrix or to a matrix which is not positive definite.

If the estimated condition number is greater than 1/ɛ (where ɛ is machine precision), a warning error is issued. This indicates that very small changes in A can cause very large changes in the solution x. If the coefficient matrix is ill-conditioned or poorly scaled, it is recommended that LSAQS be used.

Comments

1. Workspace may be explicitly provided, if desired, by use of L2LQS/DL2LQS. The reference is:

CALL L2LQS (N, A, LDA, NCODA, B, X, FACT, WK)

The additional arguments are as follows:

FACTNCODA + 1 by N work array containing the RTR factorization of A in band symmetric form on output. If A is not needed, A and FACT can share the same storage locations.

WK — Work vector of length N.

2. Informational errors

 

Type

Code

Description

3

1

The input matrix is too ill-conditioned. The solution might not be accurate.

4

2

The input matrix is not positive definite.

3. Integer Options with Chapter 11 Options Manager

16 This option uses four values to solve memory bank conflict (access inefficiency) problems. In routine L2LQS the leading dimension of FACT is increased by IVAL(3) when N is a multiple of IVAL(4). The values IVAL(3) and IVAL(4) are temporarily replaced by IVAL(1) and IVAL(2), respectively, in LSLQS. Additional memory allocation for FACT and option value restoration are done automatically in LSLQS. Users directly calling L2LQS can allocate additional space for FACT and set IVAL(3) and IVAL(4) so that memory bank conflicts no longer cause inefficiencies. There is no requirement that users change existing applications that use LSLQS or L2LQS. Default values for the option are IVAL(*) = 1,16,0,1.

17 This option has two values that determine if the L1 condition number is to be computed. Routine LSLQS temporarily replaces IVAL(2) by IVAL(1). The routine L2CQS computes the condition number if IVAL(2) = 2. Otherwise L2CQS skips this computation. LSLQS restores the option. Default values for the option are IVAL(*) = 1,2.

Example

A system of four linear equations is solved. The coefficient matrix has real positive definite band form and the right-hand-side vector b has four elements.

 

USE LSLQS_INT

USE WRRRN_INT

! Declare variables

INTEGER LDA, N, NCODA

PARAMETER (LDA=3, N=4, NCODA=2)

REAL A(LDA,N), B(N), X(N)

!

! Set values for A in band symmetric form, and B

!

! A = ( 0.0 0.0 -1.0 1.0 )

! ( 0.0 0.0 2.0 -1.0 )

! ( 2.0 4.0 7.0 3.0 )

!

! B = ( 6.0 -11.0 -11.0 19.0 )

!

DATA A/2*0.0, 2.0, 2*0.0, 4.0, -1.0, 2.0, 7.0, 1.0, -1.0, 3.0/

DATA B/6.0, -11.0, -11.0, 19.0/

! Solve A*X = B

CALL LSLQS (A, NCODA, B, X)

 

 

! Print results

CALL WRRRN (’X’, X, 1, N, 1)

END

Output

 

X

1 2 3 4

4.000 -6.000 2.000 9.000