ACBCB

Adds two complex band matrices, both in band storage mode.

Required Arguments

AN by N complex band matrix with NLCA lower codiagonals and NUCA upper codiagonals stored in band mode with dimension (NLCA + NUCA + 1) by N.   (Input)

NLCA — Number of lower codiagonals of A.   (Input)

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

BN by N complex band matrix with NLCB lower codiagonals and NUCB upper codiagonals stored in band mode with dimension (NLCB + NUCB + 1) by N.   (Input)

NLCB — Number of lower codiagonals of B.   (Input)

NUCB — Number of upper codiagonals of B.   (Input)

CN by N complex band matrix with NLCC lower codiagonals and NUCC upper codiagonals containing the sum A + B in band mode with dimension (NLCC + NUCC + 1) by N.   (Output)

NLCC — Number of lower codiagonals of C.   (Input)
NLCC must be at least as large as max(NLCA, NLCB).

NUCC — Number of upper codiagonals of C.   (Input)
NUCC must be at least as large as max(NUCA, NUCB).

Optional Arguments

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

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

FORTRAN 90 Interface

Generic:          CALL ACBCB (A, NLCA, NUCA, B, NLCB, NUCB, C, NLCC, NUCC [,…])

Specific:          The specific interface names are S_ACBCB and D_ACBCB.

FORTRAN 77 Interface

Single:             CALL ACBCB (N, A, LDA, NLCA, NUCA, B, LDB, NLCB, NUCB, C, LDC, NLCC, NUCC)

Double:           The double precision name is DACBCB.

Description

The routine ACBCB adds two complex matrices stored in band mode, returning a complex matrix stored in band mode.

Example

Add two complex matrices of order 4 stored in band mode. Matrix A has two upper codiagonals and no lower codiagonals. Matrix B has no upper codiagonals and two lower codiagonals. The output matrix C has two upper codiagonals and two lower codiagonals.

 

      USE ACBCB_INT

      USE WRCRN_INT

 

      IMPLICIT   NONE

!                                 Declare variables

      INTEGER    LDA, LDB, LDC, N, NLCA, NLCB, NLCC, NUCA, NUCB, NUCC

      PARAMETER  (LDA=3, LDB=3, LDC=5, N=3, NLCA=0, NLCB=2, NLCC=2, &

                NUCA=2, NUCB=0, NUCC=2)

!

      COMPLEX    A(LDA,N), B(LDB,N), C(LDC,N)

!                                 Set values for A (in band mode)

!                 A = ( 0.0 + 0.0i  0.0 + 0.0i  3.0 - 2.0i )

!                     ( 0.0 + 0.0i  -1.0+ 3.0i  6.0 + 0.0i )

!                     ( 1.0 + 4.0i  5.0 - 2.0i  3.0 + 1.0i )

!

!                                 Set values for B (in band mode)

!                 B = ( 3.0 + 1.0i  4.0 + 1.0i  7.0 - 1.0i )

!                     ( -1.0- 4.0i  9.0 + 3.0i  0.0 + 0.0i )

!                     ( 2.0 - 1.0i  0.0 + 0.0i  0.0 + 0.0i )

!

      DATA A/(0.0,0.0), (0.0,0.0), (1.0,4.0), (0.0,0.0), (-1.0,3.0), &

          (5.0,-2.0), (3.0,-2.0), (6.0,0.0), (3.0,1.0)/

      DATA B/(3.0,1.0), (-1.0,-4.0), (2.0,-1.0), (4.0,1.0), (9.0,3.0), &

          (0.0,0.0), (7.0,-1.0), (0.0,0.0), (0.0,0.0)/

!                                 Compute C = A+B

      CALL ACBCB (A, NLCA, NUCA, B, NLCB, NUCB, C, NLCC, NUCC)

!                                 Print results

      CALL WRCRN ('C = A+B', C)

      END

Output

 

                        C = A+B
                 1                2                3
1  (  0.00,  0.00)  (  0.00,  0.00)  (  3.00, -2.00)
2  (  0.00,  0.00)  ( -1.00,  3.00)  (  6.00,  0.00)
3  (  4.00,  5.00)  (  9.00, -1.00)  ( 10.00,  0.00)
4  ( -1.00, -4.00)  (  9.00,  3.00)  (  0.00,  0.00)
5  (  2.00, -1.00)  (  0.00,  0.00)  (  0.00,  0.00)


Visual Numerics, Inc.
Visual Numerics - Developers of IMSL and PV-WAVE
http://www.vni.com/
PHONE: 713.784.3131
FAX:713.781.9260