LSAQS
Solves a real symmetric positive definite system of linear equations in band symmetric storage mode with iterative refinement.
Required Arguments
ANCODA + 1 by N array containing the N by N positive definite band 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 LSAQS (A, NCODA, B, X [])
Specific: The specific interface names are S_LSAQS and D_LSAQS.
FORTRAN 77 Interface
Single: CALL LSAQS (N, A, LDA, NCODA, B, X)
Double: The double precision name is DLSAQS.
Description
Routine LSAQS 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 iterative refinement routine LFIQS.
LSAQS fails if any submatrix of R is not positive definite, if R has a zero diagonal element or if the iterative refinement algorithm fails to converge. 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. Iterative refinement can sometimes find the solution to such a system. LSAQS solves the problem that is represented in the computer; however, this problem may differ from the problem whose solution is desired.
Comments
1. Workspace may be explicitly provided, if desired, by use of L2AQS/DL2AQS. The reference is:
CALL L2AQS (N, A, LDA, NCODA, B, X, FACT, WK)
The additional arguments are as follows:
FACT — Work vector of length NCODA + 1 by N containing the RT R factorization of A in band symmetric storage form on output.
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 L2AQS 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 LSAQS. Additional memory allocation for FACT and option value restoration are done automatically in LSAQS.
Users directly calling L2AQS 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 LSAQS or L2AQS. 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 LSAQS temporarily replaces IVAL(2) by IVAL(1). The routine L2CQS computes the condition number if IVAL(2) = 2. Otherwise L2CQS skips this computation. LSAQS 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 LSAQS_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 LSAQS (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
Published date: 03/19/2020
Last modified date: 03/19/2020