hide long namesshow long names
hide short namesshow short names
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 DR  and DC DC  intended to equilibrate a complex m m  by n n  band matrix A A  of band width (kl + ku + 1) ( kl + ku + 1 ) , 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 DR  and DC DC  are restricted to lie in the safe range (δ,1 / δ) (δ,1/δ) , where δ δ  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.

References

None.

Parameters

Compulsory Input Parameters

1:     m – int64int32nag_int scalar
mm, the number of rows of the matrix AA.
Constraint: m0m0.
2:     kl – int64int32nag_int scalar
klkl, the number of subdiagonals of the matrix AA.
Constraint: kl0kl0.
3:     ku – int64int32nag_int scalar
kuku, the number of superdiagonals of the matrix AA.
Constraint: ku0ku0.
4:     ab(ldab, : :) – complex array
The first dimension of the array ab must be at least kl + ku + 1kl+ku+1
The second dimension of the array must be at least max (1,n)max(1,n)
The mm by nn band matrix AA whose scaling factors are to be computed.
The matrix is stored in rows 11 to kl + ku + 1kl+ku+1, more precisely, the element AijAij must be stored in
ab(ku + 1 + ij,j)  for ​max (1,jku)imin (m,j + kl).
abku+1+i-jj  for ​max(1,j-ku)imin(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.
nn, the number of columns of the matrix AA.
Constraint: n0n0.

Input Parameters Omitted from the MATLAB Interface

ldab

Output Parameters

1:     r(m) – double array
If INFO = 0INFO=0 or INFO > mINFO>m, r contains the row scale factors, the diagonal elements of DRDR. The elements of r will be positive.
2:     c(n) – double array
If INFO = 0INFO=0, c contains the column scale factors, the diagonal elements of DCDC. The elements of c will be positive.
3:     rowcnd – double scalar
If INFO = 0INFO=0 or INFO > mINFO>m, rowcnd contains the ratio of the smallest value of r(i)ri to the largest value of r(i)ri. If rowcnd0.1rowcnd0.1 and amax is neither too large nor too small, it is not worth scaling by DRDR.
4:     colcnd – double scalar
If INFO = 0INFO=0, colcnd contains the ratio of the smallest value of c(i)ci to the largest value of c(i)ci.
If colcnd0.1colcnd0.1, it is not worth scaling by DCDC.
5:     amax – double scalar
max|aij|max|aij|. If amax is very close to overflow or underflow, the matrix AA should be scaled.
6:     info – int64int32nag_int scalar
info = 0info=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 = iinfo=-i
If info = iinfo=-i, parameter ii 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 > 0andINFOMINFO>0andINFOM
If info = iinfo=i, the iith row of AA is exactly zero.
W INFO > MINFO>M
If info = iinfo=i, the (im)(i-m)th column of AA is exactly zero.

Accuracy

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

Further Comments

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