Previous Next Contents Generated Index Doc Set Home



Equilibration Scale Factors for a General Matrix in Banded Storage

The subroutines described in this section compute row and column scalings intended to equilibrate a general matrix A in banded storage and reduce its condition number. The scale factors are chosen to try to make largest element of the equilibrated matrix have magnitude equal to 1. Note that these subroutines only compute the scale factors for A. Additional code must be written to actually equilibrate A. Each element of the equilibrated matrix B has the value B(i,j) = ROWSC(i) × B(i,j) × COLSC(j).

Calling Sequence

CALL DGBEQU 
(M, N, NSUB, NSUPER, DA, LDA, DROWSC, DCOLSC, DROWCN, 
DCOLCN, DAMAX, INFO)
CALL SGBEQU 
(M, N, NSUB, NSUPER, SA, LDA, SROWSC, SCOLSC, SROWCN, 
SCOLCN, SAMAX, INFO)
CALL ZGBEQU 
(M, N, NSUB, NSUPER, ZA, LDA, DROWSC, DCOLSC, DROWCN, 
DCOLCN, DAMAX, INFO)
CALL CGBEQU 
(M, N, NSUB, NSUPER, CA, LDA, SROWSC, SCOLSC, SROWCN, 
SCOLCN, SAMAX, INFO)






void dgbequ 
(int m, int n, int nsub, int nsuper, double *da, int 
lda, double *drowsc, double *dcolsc, double *drowcn, 
double *dcolcn, double *damax, int *info)
void sgbequ 
(int m, int n, int nsub, int nsuper, float *sa, int 
lda, float *srowsc, float *scolsc, float *srowcn, float 
*scolcn, float *samax, int *info)
void zgbequ 
(int m, int n, int nsub, int nsuper, doublecomplex *za, 
int lda, double *drowsc, double *dcolsc, double 
*drowcn, double *dcolcn, double *damax, int *info)
void cgbequ 
(int m, int n, int nsub, int nsuper, complex *ca, int 
lda, float *srowsc, float *scolsc, float *srowcn, float 
*scolcn, float *samax, int *info)

Arguments

M

Number of rows in the matrix A. M 0.

N

Number of columns in the matrix A. N 0.

NSUB

Number of subdiagonals of A. N-1 NSUB 0 but if N = 0 then NSUB = 0.

NSUPER

Number of superdiagonals of A. N-1 NSUPER 0 but if N = 0 then NSUPER = 0.

xA

Matrix A.

LDA

Leading dimension of the array A as specified in a dimension or type statement. LDA NSUB + NSUPER + 1.

xROWSC

On exit, if INFO = 0 or INFO > M, ROWSC contains the row scale factors for the matrix A.

xCOLSC

On exit, if INFO = 0, COLSC contains the column scale factors for the matrix A.

xROWCN

On exit, if INFO = 0 or INFO > M, the ratio of the smallest ROWSC(i) to the largest ROWSC(i). If ROWCN 0.1 and AMAX is not close to overflow or underflow, then it is not worth scaling by ROWSC.

xCOLCN

On exit, if INFO = 0, the ratio of the smallest COLSC(i) to the largest COLSC(i). If COLCN 0.1 and AMAX is not close to overflow or underflow, then it is not worth scaling by COLSC.

xAMAX

On exit, the absolute value of the largest element of A. If AMAX is very close to overflow or underflow, A should be scaled regardless of the value of ROWCN or COLCN.

INFO

On exit:

INFO = 0

Subroutine completed normally.

INFO < 0

The ith argument, where i = |INFO|, had an illegal value.

1 INFO M

Row INFO of the array A is exactly zero.

INFO > M

Column (INFO-M) of array A is exactly zero.

Sample Program




      PROGRAM TEST
      IMPLICIT NONE
C
      INTEGER           LDA, N, NSUB, NSUPER
      PARAMETER        (N = 4)
      PARAMETER        (NSUB = 1)
      PARAMETER        (NSUPER = 0)
      PARAMETER        (LDA = NSUB + 1 + NSUPER)
C
      DOUBLE PRECISION  A(LDA,N), AMAX, COLSCA(N), COLCND
      DOUBLE PRECISION  ROWCND, ROWSCA(N)
      INTEGER           ICOL, INFO, IROW
C
      EXTERNAL          DGBEQU
      INTRINSIC         ABS
C
C     Initialize the array A to store in banded storage mode the
C     4x4 matrix A shown below.
C
C         2  0  0  0
C     A = 4  4  0  0
C         0  4  4  0
C         0  0  2  2
C
      DATA A / 2.0D0, 4.0D0, 4.0D0, 4.0D0, 4.0D0, 2.0D0, 2.0D0,
     $         8D8 /
C
      PRINT 1000
      PRINT 1010, A(1,1), 0.0D0,  0.0D0,  0.0D0
      PRINT 1010, A(2,1), A(1,2), 0.0D0,  0.0D0
      PRINT 1010,  0.0D0, A(2,2), A(1,3), 0.0D0
      PRINT 1010,  0.0D0,  0.0D0, A(2,3), A(1,4)
      PRINT 1020
      PRINT 1010, ((A(IROW,ICOL), ICOL = 1, N), IROW = 1, LDA)
C
      CALL DGBEQU (N, N, NSUB, NSUPER, A, LDA, ROWSCA, COLSCA,
     $             ROWCND, COLCND, AMAX, INFO)
      IF (INFO .NE. 0) THEN
        PRINT 1030, ABS(INFO)
        STOP 1
      END IF
      PRINT 1040
      PRINT 1010, ROWSCA
      PRINT 1050
      PRINT 1010, COLSCA
C
 1000 FORMAT (1X, 'A in full format:')
 1010 FORMAT (4(3X, F8.5))
 1020 FORMAT (/1X, 'A in banded form:  (* in unused elements)')
 1030 FORMAT (1X, 'Illegal argument to DGBEQU, INFO = ', I4)
 1040 FORMAT (/1X, 'Row scale factors:')
 1050 FORMAT (/1X, 'Column scale factors:')
C
      END
 

Sample Output

 
 A in full format:
    2.00000    0.00000    0.00000    0.00000
    4.00000    4.00000    0.00000    0.00000
    0.00000    4.00000    4.00000    0.00000
    0.00000    0.00000    2.00000    2.00000



 A in banded form:  (* in unused elements)
    2.00000    4.00000    4.00000    2.00000
    4.00000    4.00000    2.00000   ********



 Row scale factors:
    0.50000    0.25000    0.25000    0.50000



 Column scale factors:
    1.00000    1.00000    1.00000    1.00000






Previous Next Contents Generated Index Doc Set Home