next up previous index
Next: F500 Linear Homogeneous Up: CERNLIB Previous: F150 Direct or

F406 Banded Linear Equations

Routine ID: F406
Author(s): G.A. ErskineLibrary: KERNLIB
Submitter: Submitted: 01.09.1983
Language: FortranRevised: 27.11.1984

Subroutine subprograms RBEQN and DBEQN solve a system of N simultaneous linear equations with K right-hand sides, the coefficient matrix being a band matrix with bandwidth 2M+1:

j=1Naijxjk= bik,(i=1,2,...,N, k=1,2,...,K); (aij= 0 for |i-j| > M).

Only those coefficients aij for which |i-j|≤M

need be supplied on entry (see Usage).

Structure:

SUBROUTINE subprograms
User Entry Names: RBEQN, DBEQN
Files Referenced: Printer
External References: KERMTR (N001), ABEND (Z035)

Usage:

For t=R (type REAL), t=D (type DOUBLE PRECISION),

    CALL tBEQN(N,M,ABAND,IDIM,IFAIL,K,B)
N
( INTEGER) Number of equations.
M
( INTEGER) Band parameter M.
ABAND
(type according to t) Two-dimensional array whose first dimension has the value IDIM.
IDIM
( INTEGER) First dimension of array ABAND (and of array B if K>1 ).
IFAIL
( INTEGER) On exit, IFAIL will be set to -1 if the coefficient matrix is singular, and to 0 otherwise.
K
( INTEGER) Number of right-hand sides in array B.
B
(type according to t) In general, a two-dimensional array whose first dimension has the value IDIM. B may be one-dimensional if K=1 .

On entry, ABAND must contain the packed form of the coefficient matrix as described below, and array B must contain the matrix of right-hand sides bik . Then, provided the coefficient matrix is non-singular, IFAIL will be set to 0 and the solution xik will replace bik in B. The contents of ABAND are destroyed. If the coefficient matrix is singular, IFAIL will be set to -1. In this case the contents of ABAND and B are unpredictable.

The storage convention for ABAND is that it must contain, on entry, those coefficients aij for which |i - j|≤M , stored "left-justified" as an array of N rows and at most 2M+1 columns. For example, if N=4 and M=1 , the coefficient matrix

(
a11 a12 0 0

a21 a22 a23 0

0 a32 a33 a34

0 0 a43 a44

)is stored as(
a11 a12 X

a21 a22 a23

a32 a33 a34

a43 a44 X

)

where X denotes elements whose value need not to be set.

If ALPHA(I,J) is a function subprogram or statement function which computes aij , the following Fortran statements will set ABAND correctly:

      DO 2 I =1,N
      L = 1
      DO 1 J = MAX(I-M,1),MIN(I+M,N)
      ABAND(I,L) = ALPHA(I,J)
      L = L+1
    1 CONTINUE
    2 CONTINUE

Method:

Gaussian elimination with row interchanges. The storage organization is as described in the reference.

Error handling:

If the integer arguments do not satisfy the conditions 1 ≤M+1 ≤N ≤IDIM, K ≤0 , a message is printed and program execution is terminated by calling ABEND (Z035).

References:

  1. J.H. Wilkinson and C. Reinsch (eds.), Handbook for automatic computation, Vol.2: Linear algebra (Springer-Verlag, New York 1971) 54.

F500



next up previous index
Next: F500 Linear Homogeneous Up: CERNLIB Previous: F150 Direct or


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995