NAG Library Routine Document

1Purpose

f07btf (zgbequ) computes diagonal scaling matrices ${D}_{R}$ and ${D}_{C}$ intended to equilibrate a complex $m$ by $n$ band matrix $A$ of band width $\left({k}_{l}+{k}_{u}+1\right)$, and reduce its condition number.

2Specification

Fortran Interface
 Subroutine f07btf ( m, n, kl, ku, ab, ldab, r, c, amax, info)
 Integer, Intent (In) :: m, n, kl, ku, ldab Integer, Intent (Out) :: info Real (Kind=nag_wp), Intent (Out) :: r(m), c(n), rowcnd, colcnd, amax Complex (Kind=nag_wp), Intent (In) :: ab(ldab,*)
#include nagmk26.h
 void f07btf_ ( const Integer *m, const Integer *n, const Integer *kl, const Integer *ku, const Complex ab[], const Integer *ldab, double r[], double c[], double *rowcnd, double *colcnd, double *amax, Integer *info)
The routine may be called by its LAPACK name zgbequ.

3Description

f07btf (zgbequ) computes the diagonal scaling matrices. The diagonal scaling matrices are chosen to try to make the elements of largest absolute value in each row and column of the matrix $B$ given by
 $B = DR A DC$
have absolute value $1$. The diagonal elements of ${D}_{R}$ and ${D}_{C}$ are restricted to lie in the safe range $\left(\delta ,1/\delta \right)$, where $\delta$ is the value returned by routine x02amf. Use of these scaling factors is not guaranteed to reduce the condition number of $A$ but works well in practice.

None.

5Arguments

1:     $\mathbf{m}$ – IntegerInput
On entry: $m$, the number of rows of the matrix $A$.
Constraint: ${\mathbf{m}}\ge 0$.
2:     $\mathbf{n}$ – IntegerInput
On entry: $n$, the number of columns of the matrix $A$.
Constraint: ${\mathbf{n}}\ge 0$.
3:     $\mathbf{kl}$ – IntegerInput
On entry: ${k}_{l}$, the number of subdiagonals of the matrix $A$.
Constraint: ${\mathbf{kl}}\ge 0$.
4:     $\mathbf{ku}$ – IntegerInput
On entry: ${k}_{u}$, the number of superdiagonals of the matrix $A$.
Constraint: ${\mathbf{ku}}\ge 0$.
5:     $\mathbf{ab}\left({\mathbf{ldab}},*\right)$ – Complex (Kind=nag_wp) arrayInput
Note: the second dimension of the array ab must be at least $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$.
On entry: the $m$ by $n$ band matrix $A$ whose scaling factors are to be computed.
The matrix is stored in rows $1$ to ${k}_{l}+{k}_{u}+1$, more precisely, the element ${A}_{ij}$ must be stored in
 $abku+1+i-jj for ​max1,j-ku≤i≤minm,j+kl.$
See Section 9 in f07bnf (zgbsv) for further details.
6:     $\mathbf{ldab}$ – IntegerInput
On entry: the first dimension of the array ab as declared in the (sub)program from which f07btf (zgbequ) is called.
Constraint: ${\mathbf{ldab}}\ge {\mathbf{kl}}+{\mathbf{ku}}+1$.
7:     $\mathbf{r}\left({\mathbf{m}}\right)$ – Real (Kind=nag_wp) arrayOutput
On exit: if ${\mathbf{info}}={\mathbf{0}}$ or ${\mathbf{info}}>\mathbf{m}$, r contains the row scale factors, the diagonal elements of ${D}_{R}$. The elements of r will be positive.
8:     $\mathbf{c}\left({\mathbf{n}}\right)$ – Real (Kind=nag_wp) arrayOutput
On exit: if ${\mathbf{info}}={\mathbf{0}}$, c contains the column scale factors, the diagonal elements of ${D}_{C}$. The elements of c will be positive.
9:     $\mathbf{rowcnd}$ – Real (Kind=nag_wp)Output
On exit: if ${\mathbf{info}}={\mathbf{0}}$ or ${\mathbf{info}}>\mathbf{m}$, rowcnd contains the ratio of the smallest value of ${\mathbf{r}}\left(i\right)$ to the largest value of ${\mathbf{r}}\left(i\right)$. If ${\mathbf{rowcnd}}\ge 0.1$ and amax is neither too large nor too small, it is not worth scaling by ${D}_{R}$.
10:   $\mathbf{colcnd}$ – Real (Kind=nag_wp)Output
On exit: if ${\mathbf{info}}={\mathbf{0}}$, colcnd contains the ratio of the smallest value of ${\mathbf{c}}\left(i\right)$ to the largest value of ${\mathbf{c}}\left(i\right)$.
If ${\mathbf{colcnd}}\ge 0.1$, it is not worth scaling by ${D}_{C}$.
11:   $\mathbf{amax}$ – Real (Kind=nag_wp)Output
On exit: $\mathrm{max}\left|{a}_{ij}\right|$. If amax is very close to overflow or underflow, the matrix $A$ should be scaled.
12:   $\mathbf{info}$ – IntegerOutput
On exit: ${\mathbf{info}}=0$ unless the routine detects an error (see Section 6).

6Error Indicators and Warnings

${\mathbf{info}}<0$
If ${\mathbf{info}}=-i$, argument $i$ had an illegal value. An explanatory message is output, and execution of the program is terminated.
${\mathbf{info}}>0 \text{and} {\mathbf{info}}\le {\mathbf{m}}$
Row $〈\mathit{\text{value}}〉$ of $A$ is exactly zero.
${\mathbf{info}}>{\mathbf{m}}$
Column $〈\mathit{\text{value}}〉$ of $A$ is exactly zero.

7Accuracy

The computed scale factors will be close to the exact scale factors.

8Parallelism and Performance

f07btf (zgbequ) makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

The real analogue of this routine is f07bff (dgbequ).

10Example

This example equilibrates the complex band matrix $A$ given by
 $A = -1.65+2.26i -2.05-0.85i×10-10 -(0.97-2.84i ((0 -0.00+6.30i -1.48-1.75i×10-10 (-3.99+4.01i ((0.59-0.48i -0 (-0.77+2.83i -1.06+1.94i×1010 (3.33-1.04i×1010 -0 -(0 -(0.48-1.09i -0.46-1.72i .$
Details of the scaling factors, and the scaled matrix are output.

10.1Program Text

Program Text (f07btfe.f90)

10.2Program Data

Program Data (f07btfe.d)

10.3Program Results

Program Results (f07btfe.r)

© The Numerical Algorithms Group Ltd, Oxford, UK. 2017