Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

# NAG Toolbox: nag_lapack_zgbequ (f07bt)

## Purpose

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

## Syntax

[r, c, rowcnd, colcnd, amax, info] = f07bt(m, kl, ku, ab, 'n', n)
[r, c, rowcnd, colcnd, amax, info] = nag_lapack_zgbequ(m, kl, ku, ab, 'n', n)

## Description

nag_lapack_zgbequ (f07bt) 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 $B$ given by
 B = DR A DC $B = DR A DC$
have absolute value 1 $1$. The diagonal elements of DR ${D}_{R}$ and DC ${D}_{C}$ are restricted to lie in the safe range (δ,1 / δ) $\left(\delta ,1/\delta \right)$, where δ $\delta$ is the value returned by function nag_machine_real_safe (x02am). Use of these scaling factors is not guaranteed to reduce the condition number of A $A$ but works well in practice.

None.

## Parameters

### Compulsory Input Parameters

1:     m – int64int32nag_int scalar
m$m$, the number of rows of the matrix A$A$.
Constraint: m0${\mathbf{m}}\ge 0$.
2:     kl – int64int32nag_int scalar
kl${k}_{l}$, the number of subdiagonals of the matrix A$A$.
Constraint: kl0${\mathbf{kl}}\ge 0$.
3:     ku – int64int32nag_int scalar
ku${k}_{u}$, the number of superdiagonals of the matrix A$A$.
Constraint: ku0${\mathbf{ku}}\ge 0$.
4:     ab(ldab, : $:$) – complex array
The first dimension of the array ab must be at least kl + ku + 1${\mathbf{kl}}+{\mathbf{ku}}+1$
The second dimension of the array must be at least max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
The m$m$ by n$n$ band matrix A$A$ whose scaling factors are to be computed.
The matrix is stored in rows 1$1$ to kl + ku + 1${k}_{l}+{k}_{u}+1$, more precisely, the element Aij${A}_{ij}$ must be stored in
 ab(ku + 1 + i − j,j)  for ​max (1,j − ku) ≤ i ≤ min (m,j + kl).$abku+1+i-jj for ​max(1,j-ku)≤i≤min(m,j+kl).$
See Section [Further Comments] in (f07bn) for further details.

### Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The second dimension of the array ab.
n$n$, the number of columns of the matrix A$A$.
Constraint: n0${\mathbf{n}}\ge 0$.

ldab

### Output Parameters

1:     r(m) – double array
If ${\mathbf{INFO}}={\mathbf{0}}$ or ${\mathbf{INFO}}>\mathbf{m}$, r contains the row scale factors, the diagonal elements of DR${D}_{R}$. The elements of r will be positive.
2:     c(n) – double array
If ${\mathbf{INFO}}={\mathbf{0}}$, c contains the column scale factors, the diagonal elements of DC${D}_{C}$. The elements of c will be positive.
3:     rowcnd – double scalar
If ${\mathbf{INFO}}={\mathbf{0}}$ or ${\mathbf{INFO}}>\mathbf{m}$, rowcnd contains the ratio of the smallest value of r(i)${\mathbf{r}}\left(i\right)$ to the largest value of r(i)${\mathbf{r}}\left(i\right)$. If rowcnd0.1${\mathbf{rowcnd}}\ge 0.1$ and amax is neither too large nor too small, it is not worth scaling by DR${D}_{R}$.
4:     colcnd – double scalar
If ${\mathbf{INFO}}={\mathbf{0}}$, colcnd contains the ratio of the smallest value of c(i)${\mathbf{c}}\left(i\right)$ to the largest value of c(i)${\mathbf{c}}\left(i\right)$.
If colcnd0.1${\mathbf{colcnd}}\ge 0.1$, it is not worth scaling by DC${D}_{C}$.
5:     amax – double scalar
max|aij|$\mathrm{max}|{a}_{ij}|$. If amax is very close to overflow or underflow, the matrix A$A$ should be scaled.
6:     info – int64int32nag_int scalar
info = 0${\mathbf{info}}=0$ unless the function detects an error (see Section [Error Indicators and Warnings]).

## Error Indicators and Warnings

Cases prefixed with W are classified as warnings and do not generate an error of type NAG:error_n. See nag_issue_warnings.

info = i${\mathbf{info}}=-i$
If info = i${\mathbf{info}}=-i$, parameter i$i$ had an illegal value on entry. The parameters are numbered as follows:
1: m, 2: n, 3: kl, 4: ku, 5: ab, 6: ldab, 7: r, 8: c, 9: rowcnd, 10: colcnd, 11: amax, 12: info.
It is possible that info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.
W INFO > 0andINFOM${\mathbf{INFO}}>0 \text{and} {\mathbf{INFO}}\le {\mathbf{M}}$
If info = i${\mathbf{info}}=i$, the i$i$th row of A$A$ is exactly zero.
W ${\mathbf{INFO}}>{\mathbf{M}}$
If info = i${\mathbf{info}}=i$, the (im)$\left(i-{\mathbf{m}}\right)$th column of A$A$ is exactly zero.

## Accuracy

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

The real analogue of this function is nag_lapack_dgbequ (f07bf).

## Example

```function nag_lapack_zgbequ_example
m = int64(4);
kl = int64(1);
ku = int64(2);
ab = [0,  0 + 0i,  0.97 - 2.84i,  0.59 - 0.48i;
0 + 0i,  -2.05e-10 - 8.5e-11i,  -3.99 + 4.01i,  33300000000 - 10400000000i;
-1.65 + 2.26i,  -1.48e-10 - 1.75e-10i,  -10600000000 + 19400000000i,  -0.46 - 1.72i;
0 + 6.3i,  -0.77 + 2.83i,  4.48 - 1.09i,  0 + 0i];
[r, c, rowcnd, colcnd, amax, info] = nag_lapack_zgbequ(m, kl, ku, ab)
```
```

r =

0.2558
0.1250
0.0000
0.1795

c =

1.0e+10 *

0.0000
1.2139
0.0000
0.0000

rowcnd =

8.9474e-11

colcnd =

8.2380e-11

amax =

4.3700e+10

info =

0

```
```function f07bt_example
m = int64(4);
kl = int64(1);
ku = int64(2);
ab = [0,  0 + 0i,  0.97 - 2.84i,  0.59 - 0.48i;
0 + 0i,  -2.05e-10 - 8.5e-11i,  -3.99 + 4.01i,  33300000000 - 10400000000i;
-1.65 + 2.26i,  -1.48e-10 - 1.75e-10i,  -10600000000 + 19400000000i,  -0.46 - 1.72i;
0 + 6.3i,  -0.77 + 2.83i,  4.48 - 1.09i,  0 + 0i];
[r, c, rowcnd, colcnd, amax, info] = f07bt(m, kl, ku, ab)
```
```

r =

0.2558
0.1250
0.0000
0.1795

c =

1.0e+10 *

0.0000
1.2139
0.0000
0.0000

rowcnd =

8.9474e-11

colcnd =

8.2380e-11

amax =

4.3700e+10

info =

0

```

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013