Computes row and column scaling factors intended to equilibrate a banded matrix and reduce its condition number.
FORTRAN 77:
call sgbequ( m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info )
call dgbequ( m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info )
call cgbequ( m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info )
call zgbequ( m, n, kl, ku, ab, ldab, r, c, rowcnd, colcnd, amax, info )
FORTRAN 95:
call gbequ( ab, r, c [,kl] [,rowcnd] [,colcnd] [,amax] [,info] )
C:
lapack_int LAPACKE_sgbequ( int matrix_order, lapack_int m, lapack_int n, lapack_int kl, lapack_int ku, const float* ab, lapack_int ldab, float* r, float* c, float* rowcnd, float* colcnd, float* amax );
lapack_int LAPACKE_dgbequ( int matrix_order, lapack_int m, lapack_int n, lapack_int kl, lapack_int ku, const double* ab, lapack_int ldab, double* r, double* c, double* rowcnd, double* colcnd, double* amax );
lapack_int LAPACKE_cgbequ( int matrix_order, lapack_int m, lapack_int n, lapack_int kl, lapack_int ku, const lapack_complex_float* ab, lapack_int ldab, float* r, float* c, float* rowcnd, float* colcnd, float* amax );
lapack_int LAPACKE_zgbequ( int matrix_order, lapack_int m, lapack_int n, lapack_int kl, lapack_int ku, const lapack_complex_double* ab, lapack_int ldab, double* r, double* c, double* rowcnd, double* colcnd, double* amax );
The routine computes row and column scalings intended to equilibrate an m-by-n band matrix A and reduce its condition number. The output array r returns the row scale factors and the array c the column scale factors. These factors are chosen to try to make the largest element in each row and column of the matrix B with elements bij=r(i)*aij*c(j) have absolute value 1.
See ?laqgb auxiliary function that uses scaling factors computed by ?gbequ.
The data types are given for the Fortran interface. A <datatype> placeholder, if present, is used for the C interface data types in the C interface section above. See C Interface Conventions for the C interface principal conventions and type definitions.
m |
INTEGER. The number of rows of the matrix A; m ≥ 0. |
n |
INTEGER. The number of columns of the matrix A; n ≥ 0. |
kl |
INTEGER. The number of subdiagonals within the band of A; kl ≥ 0. |
ku |
INTEGER. The number of superdiagonals within the band of A; ku ≥ 0. |
ab |
REAL for sgbequ DOUBLE PRECISION for dgbequ COMPLEX for cgbequ DOUBLE COMPLEX for zgbequ. Array, DIMENSION (ldab,*). Contains the original band matrix A stored in rows from 1 to kl + ku + 1. The second dimension of ab must be at least max(1,n). |
ldab |
INTEGER. The leading dimension of ab; ldab ≥ kl+ku+1. |
r, c |
REAL for single precision flavors DOUBLE PRECISION for double precision flavors. Arrays: r(m), c(n). If info = 0, or info > m, the array r contains the row scale factors of the matrix A. If info = 0, the array c contains the column scale factors of the matrix A. |
rowcnd |
REAL for single precision flavors DOUBLE PRECISION for double precision flavors. If info = 0 or info > m, rowcnd contains the ratio of the smallest r(i) to the largest r(i). |
colcnd |
REAL for single precision flavors DOUBLE PRECISION for double precision flavors. If info = 0, colcnd contains the ratio of the smallest c(i) to the largest c(i). |
amax |
REAL for single precision flavors DOUBLE PRECISION for double precision flavors. Absolute value of the largest element of the matrix A. |
info |
INTEGER. If info = 0, the execution is successful. If info = -i, the i-th parameter had an illegal value. If info = i and i ≤ m, the i-th row of A is exactly zero; i > m, the (i-m)th column of A is exactly zero. |
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95 Interface Conventions.
Specific details for the routine gbequ interface are as follows:
ab |
Holds the array A of size (kl+ku+1,n). |
r |
Holds the vector of length (m). |
c |
Holds the vector of length n. |
kl |
If omitted, assumed kl = ku. |
ku |
Restored as ku = lda-kl-1. |
All the components of r and c are restricted to be between SMLNUM = smallest safe number and BIGNUM= largest safe number. Use of these scaling factors is not guaranteed to reduce the condition number of A but works well in practice.
SMLNUM and
BIGNUM are parameters representing machine precision. You can use the
?lamch routines to compute them. For example, compute single precision (real and complex) values of
SMLNUM and
BIGNUM as follows:
SMLNUM = slamch ('s')
BIGNUM = 1 / SMLNUM
If rowcnd ≥ 0.1 and amax is neither too large nor too small, it is not worth scaling by r.
If colcnd ≥ 0.1, it is not worth scaling by c.
If amax is very close to overflow or very close to underflow, the matrix A should be scaled.