CRBRG

Converts a real matrix in band storage mode to a real general matrix.

Required Arguments

A — Real (NUC + 1 + NLC) by N array containing the band matrix in band storage mode. (Input)

NLC — Number of lower codiagonals in A. (Input)

NUC — Number of upper codiagonals in A. (Input)

B — Real N by N array containing the matrix. (Output)

Optional Arguments

N — Order of the matrices A and B. (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).

LDB — Leading dimension of B exactly as specified in the dimension statement of the calling program. (Input)
Default: LDB = SIZE (B,1).

FORTRAN 90 Interface

Generic: CALL CRBRG (A, NLC, NUC, B [])

Specific: The specific interface names are S_CRBRG and D_CRBRG.

FORTRAN 77 Interface

Single: CALL CRBRG (N, A, LDA, NLC, NUC, B, LDB)

Double: The double precision name is DCRBRG.

Description

The routine CRBRG converts the real band matrix A of order N in band storage mode into the real N × N general matrix B with mu = NUC upper codiagonals and ml = NLC lower codiagonals. The first mu rows of A are copied to the upper codiagonals of B, the next row of A is copied to the diagonal of B, and the last ml rows of A are copied to the lower codiagonals of B.

Example

A real band matrix of order 3 in band storage mode with one upper codiagonal and one lower codiagonal is copied to a 3 × 3 real general matrix.

 

USE CRBRG_INT

USE WRRRN_INT

 

IMPLICIT NONE

! Declare variables

INTEGER LDA, LDB, N, NLC, NUC

PARAMETER (LDA=3, LDB=3, N=3, NLC=1, NUC=1)

!

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

! Set values for A (in band mode)

! A = ( 0.0 1.0 1.0)

! ( 4.0 3.0 2.0)

! ( 2.0 2.0 0.0)

!

DATA A/0.0, 4.0, 2.0, 1.0, 3.0, 2.0, 1.0, 2.0, 0.0/

! Convert band matrix A to matrix B

CALL CRBRG (A, NLC, NUC, B)

! Print results

CALL WRRRN ('B', B)

END

Output

 

B

1 2 3

1 4.000 1.000 0.000

2 2.000 3.000 1.000

3 0.000 2.000 2.000