CCGCB
Converts a complex general matrix to a matrix in complex band storage mode.
Required Arguments
A — Complex N by N array containing the matrix. (Input)
NLC — Number of lower codiagonals in B. (Input)
NUC — Number of upper codiagonals in B. (Input)
B — Complex (NUC + 1 + NLC) by N array containing the band matrix in band storage mode. (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 CCGCB (A, NLC, NUC, B [])
Specific: The specific interface names are S_CCGCB and D_CCGCB.
FORTRAN 77 Interface
Single: CALL CCGCB (N, A, LDA, NLC, NUC, B, LDB)
Double: The double precision name is DCCGCB.
Description
The routine CCGCB converts the complex general matrix A of order N with mu = NUC upper codiagonals and ml = NLC lower codiagonals into the complex band matrix B of order N in band storage mode. The first mu rows of B then contain the upper codiagonals of A, the next row contains the main diagonal of A, and the last ml rows of B contain the lower codiagonals of A.
Example
A complex general matrix of order 4 with one upper codiagonal and three lower codiagonals is copied to a complex band matrix of order 4 in band storage mode.
 
USE CCGCB_INT
USE WRCRN_INT
 
IMPLICIT NONE
! Declare variables
INTEGER LDA, LDB, N, NLC, NUC
PARAMETER (LDA=4, LDB=5, N=4, NLC=3, NUC=1)
!
COMPLEX A(LDA,N), B(LDB,N)
! Set values for A
! A = ( 1.0+0.0i 2.0+1.0i 0.0+0.0i 0.0+0.0i )
! ( -2.0+1.0i 1.0+0.0i 3.0+2.0i 0.0+0.0i )
! ( 0.0+0.0i -3.0+2.0i 1.0+0.0i 4.0+3.0i )
! ( -7.0+1.0i 0.0+0.0i -4.0+3.0i 1.0+0.0i )
!
DATA A/(1.0,0.0), (-2.0,1.0), (0.0,0.0), (-7.0,1.0), (2.0,1.0), &
(1.0,0.0), (-3.0,2.0), (0.0,0.0), (0.0,0.0), (3.0,2.0), &
(1.0,0.0), (-4.0,3.0), (0.0,0.0), (0.0,0.0), (4.0,3.0), &
(1.0,0.0)/
! Convert A to band matrix B
CALL CCGCB (A, NLC, NUC, B)
! Print results
CALL WRCRN ('B', B)
END
Output
 
B
1 2 3 4
1 ( 0.000, 0.000) ( 2.000, 1.000) ( 3.000, 2.000) ( 4.000, 3.000)
2 ( 1.000, 0.000) ( 1.000, 0.000) ( 1.000, 0.000) ( 1.000, 0.000)
3 (-2.000, 1.000) (-3.000, 2.000) (-4.000, 3.000) ( 0.000, 0.000)
4 ( 0.000, 0.000) ( 0.000, 0.000) ( 0.000, 0.000) ( 0.000, 0.000)
5 (-7.000, 1.000) ( 0.000, 0.000) ( 0.000, 0.000) ( 0.000, 0.000)