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_zpbequ (f07ht)

Purpose

nag_lapack_zpbequ (f07ht) computes a diagonal scaling matrix S S  intended to equilibrate a complex n n  by n n  Hermitian positive definite band matrix A A , with bandwidth (2kd + 1) (2kd+1) , and reduce its condition number.

Syntax

[s, scond, amax, info] = f07ht(uplo, kd, ab, 'n', n)
[s, scond, amax, info] = nag_lapack_zpbequ(uplo, kd, ab, 'n', n)

Description

nag_lapack_zpbequ (f07ht) computes a diagonal scaling matrix S S  chosen so that
sj = 1 / sqrt(ajj) .
sj=1 / ajj .
This means that the matrix B B  given by
B = SAS ,
B=SAS ,
has diagonal elements equal to unity. This in turn means that the condition number of B B , κ2(B) κ2(B) , is within a factor n n  of the matrix of smallest possible condition number over all possible choices of diagonal scalings (see Corollary 7.6 of Higham (2002)).

References

Higham N J (2002) Accuracy and Stability of Numerical Algorithms (2nd Edition) SIAM, Philadelphia

Parameters

Compulsory Input Parameters

1:     uplo – string (length ≥ 1)
Indicates whether the upper or lower triangular part of AA is stored in the array ab, as follows:
uplo = 'U'uplo='U'
The upper triangle of AA is stored.
uplo = 'L'uplo='L'
The lower triangle of AA is stored.
Constraint: uplo = 'U'uplo='U' or 'L''L'.
2:     kd – int64int32nag_int scalar
kdkd, the number of superdiagonals of the matrix AA if uplo = 'U'uplo='U', or the number of subdiagonals if uplo = 'L'uplo='L'.
Constraint: kd0kd0.
3:     ab(ldab, : :) – complex array
The first dimension of the array ab must be at least kd + 1kd+1
The second dimension of the array must be at least max (1,n)max(1,n)
The upper or lower triangle of the Hermitian positive definite band matrix AA whose scaling factors are to be computed.
The matrix is stored in rows 11 to kd + 1kd+1, more precisely,
  • if uplo = 'U'uplo='U', the elements of the upper triangle of AA within the band must be stored with element AijAij in ab(kd + 1 + ij,j)​ for ​max (1,jkd)ijabkd+1+i-jj​ for ​max(1,j-kd)ij;
  • if uplo = 'L'uplo='L', the elements of the lower triangle of AA within the band must be stored with element AijAij in ab(1 + ij,j)​ for ​jimin (n,j + kd).ab1+i-jj​ for ​jimin(n,j+kd).
Only the elements of the array ab corresponding to the diagonal elements of AA are referenced. (Row (kd + 1)(kd+1) of ab when uplo = 'U'uplo='U', row 11 of ab when uplo = 'L'uplo='L'.)

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The second dimension of the array ab.
nn, the order of the matrix AA.
Constraint: n0n0.

Input Parameters Omitted from the MATLAB Interface

ldab

Output Parameters

1:     s(n) – double array
If INFO = 0INFO=0, s contains the diagonal elements of the scaling matrix SS.
2:     scond – double scalar
If INFO = 0INFO=0, scond contains the ratio of the smallest value of s to the largest value of s. If scond0.1scond0.1 and amax is neither too large nor too small, it is not worth scaling by SS.
3:     amax – double scalar
max|aij|max|aij|. If amax is very close to overflow or underflow, the matrix AA should be scaled.
4:     info – int64int32nag_int scalar
info = 0info=0 unless the function detects an error (see Section [Error Indicators and Warnings]).

Error Indicators and Warnings

  info = iinfo=-i
If info = iinfo=-i, parameter ii had an illegal value on entry. The parameters are numbered as follows:
1: uplo, 2: n, 3: kd, 4: ab, 5: ldab, 6: s, 7: scond, 8: amax, 9: 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.
  INFO > 0INFO>0
If info = iinfo=i, the iith diagonal element of AA is not positive (and hence AA cannot be positive definite).

Accuracy

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

Further Comments

The real analogue of this function is nag_lapack_dpbequ (f07hf).

Example

function nag_lapack_zpbequ_example
uplo = 'U';
kd = int64(1);
ab = [ 0 - 3.193166841966381e-39i,  1.08 - 1.73i, ...
     -400000000 + 2900000000i,  -3300000000 + 22400000000i;
      9.39 + 0i,  1.69 + 0i,  2.65e+20 + 0i,  2.17 + 0i];
[s, scond, amax, info] = nag_lapack_zpbequ(uplo, kd, ab)
 

s =

    0.3263
    0.7692
    0.0000
    0.6788


scond =

   7.9858e-11


amax =

   2.6500e+20


info =

                    0


function f07ht_example
uplo = 'U';
kd = int64(1);
ab = [ 0 - 3.193166841966381e-39i,  1.08 - 1.73i, ...
     -400000000 + 2900000000i,  -3300000000 + 22400000000i;
      9.39 + 0i,  1.69 + 0i,  2.65e+20 + 0i,  2.17 + 0i];
[s, scond, amax, info] = f07ht(uplo, kd, ab)
 

s =

    0.3263
    0.7692
    0.0000
    0.6788


scond =

   7.9858e-11


amax =

   2.6500e+20


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