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_zgbbrd (f08ls)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_lapack_zgbbrd (f08ls) reduces a complex m by n band matrix to real upper bidiagonal form.

Syntax

[ab, d, e, q, pt, c, info] = f08ls(vect, m, kl, ku, ab, c, 'n', n, 'ncc', ncc)
[ab, d, e, q, pt, c, info] = nag_lapack_zgbbrd(vect, m, kl, ku, ab, c, 'n', n, 'ncc', ncc)

Description

nag_lapack_zgbbrd (f08ls) reduces a complex m by n band matrix to real upper bidiagonal form B by a unitary transformation: A=QBPH. The unitary matrices Q and PH, of order m and n respectively, are determined as a product of Givens rotation matrices, and may be formed explicitly by the function if required. A matrix C may also be updated to give C~=QHC.
The function uses a vectorizable form of the reduction.

References

None.

Parameters

Compulsory Input Parameters

1:     vect – string (length ≥ 1)
Indicates whether the matrices Q and/or PH are generated.
vect='N'
Neither Q nor PH is generated.
vect='Q'
Q is generated.
vect='P'
PH is generated.
vect='B'
Both Q and PH are generated.
Constraint: vect='N', 'Q', 'P' or 'B'.
2:     m int64int32nag_int scalar
m, the number of rows of the matrix A.
Constraint: m0.
3:     kl int64int32nag_int scalar
The number of subdiagonals, kl, within the band of A.
Constraint: kl0.
4:     ku int64int32nag_int scalar
The number of superdiagonals, ku, within the band of A.
Constraint: ku0.
5:     abldab: – complex array
The first dimension of the array ab must be at least kl+ku+1.
The second dimension of the array ab must be at least max1,n.
The original m by n band matrix A.
The matrix is stored in rows 1 to kl+ku+1, more precisely, the element Aij must be stored in
abku+1+i-jj  for ​max1,j-kuiminm,j+kl. 
6:     cldc: – complex array
The first dimension, ldc, of the array c must satisfy
  • if ncc>0, ldc max1,m ;
  • if ncc=0, ldc1.
The second dimension of the array c must be at least max1,ncc.
An m by nC matrix C.

Optional Input Parameters

1:     n int64int32nag_int scalar
Default: the second dimension of the array ab.
n, the number of columns of the matrix A.
Constraint: n0.
2:     ncc int64int32nag_int scalar
Default: the second dimension of the array c.
nC, the number of columns of the matrix C.
Constraint: ncc0.

Output Parameters

1:     abldab: – complex array
The first dimension of the array ab will be kl+ku+1.
The second dimension of the array ab will be max1,n.
ab stores values generated during the reduction.
2:     dminm,n – double array
The diagonal elements of the bidiagonal matrix B.
3:     eminm,n-1 – double array
The superdiagonal elements of the bidiagonal matrix B.
4:     qldq: – complex array
The first dimension, ldq, of the array q will be
  • if vect='Q' or 'B', ldq= max1,m ;
  • otherwise ldq=1.
The second dimension of the array q will be max1,m if vect='Q' or 'B' and 1 otherwise.
If vect='Q' or 'B', contains the m by m unitary matrix Q.
If vect='N' or 'P', q is not referenced.
5:     ptldpt: – complex array
The first dimension, ldpt, of the array pt will be
  • if vect='P' or 'B', ldpt= max1,n ;
  • otherwise ldpt=1.
The second dimension of the array pt will be max1,n if vect='P' or 'B' and 1 otherwise.
The n by n unitary matrix PH, if vect='P' or 'B'. If vect='N' or 'Q', pt is not referenced.
6:     cldc: – complex array
The first dimension, ldc, of the array c will be
  • if ncc>0, ldc= max1,m ;
  • if ncc=0, ldc=1.
The second dimension of the array c will be max1,ncc.
c stores QHC. If ncc=0, c is not referenced.
7:     info int64int32nag_int scalar
info=0 unless the function detects an error (see Error Indicators and Warnings).

Error Indicators and Warnings

   info=-i
If info=-i, parameter i had an illegal value on entry. The parameters are numbered as follows:
1: vect, 2: m, 3: n, 4: ncc, 5: kl, 6: ku, 7: ab, 8: ldab, 9: d, 10: e, 11: q, 12: ldq, 13: pt, 14: ldpt, 15: c, 16: ldc, 17: work, 18: rwork, 19: 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.

Accuracy

The computed bidiagonal form B satisfies QBPH=A+E, where
E2 c n ε A2 ,  
cn is a modestly increasing function of n, and ε is the machine precision.
The elements of B themselves may be sensitive to small perturbations in A or to rounding errors in the computation, but this does not affect the stability of the singular values and vectors.
The computed matrix Q differs from an exactly unitary matrix by a matrix F such that
F2 = Oε .  
A similar statement holds for the computed matrix PH.

Further Comments

The total number of real floating-point operations is approximately the sum of: where k=kl+ku, assuming nk. For this section we assume that m=n
The real analogue of this function is nag_lapack_dgbbrd (f08le).

Example

This example reduces the matrix A to upper bidiagonal form, where
A = 0.96-0.81i -0.03+0.96i 0.00+0.00i 0.00+0.00i -0.98+1.98i -1.20+0.19i -0.66+0.42i 0.00+0.00i 0.62-0.46i 1.01+0.02i 0.63-0.17i -1.11+0.60i 0.00+0.00i 0.19-0.54i -0.98-0.36i 0.22-0.20i 0.00+0.00i 0.00+0.00i -0.17-0.46i 1.47+1.59i 0.00+0.00i 0.00+0.00i 0.00+0.00i 0.26+0.26i .  
function f08ls_example


fprintf('f08ls example results\n\n');

% Banded complex matrix A stored in banded format
m  = int64(6);
n  = int64(4);
kl = int64(2);
ku = int64(1);
ab = [ 0.00 + 0.00i, -0.03 + 0.96i, -0.66 + 0.42i, -1.11 + 0.60i;
       0.96 - 0.81i, -1.20 + 0.19i,  0.63 - 0.17i,  0.22 - 0.20i;
      -0.98 + 1.98i,  1.01 + 0.02i, -0.98 - 0.36i,  1.47 + 1.59i;
       0.62 - 0.46i,  0.19 - 0.54i, -0.17 - 0.46i,  0.26 + 0.26i];

% Reduce A to bidiagonal form
c = [];
vect = 'No Q or PT';
[~, d, e, ~, ~, ~, info] = f08ls( ...
                                  vect, m, kl, ku, ab, c);

fprintf('Diagonal:\n');
fprintf(' %8.4f',d);
fprintf('\nOff-diagonal (absolute values):\n');
fprintf(' %8.4f',abs(e));
fprintf('\n');


f08ls example results

Diagonal:
   2.6560   1.7501   2.0607   0.8658
Off-diagonal (absolute values):
   1.7033   1.2800   0.1467

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–2015