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_zhbtrd (f08hs)

Purpose

nag_lapack_zhbtrd (f08hs) reduces a complex Hermitian band matrix to tridiagonal form.

Syntax

[ab, d, e, q, info] = f08hs(vect, uplo, kd, ab, q, 'n', n)
[ab, d, e, q, info] = nag_lapack_zhbtrd(vect, uplo, kd, ab, q, 'n', n)

Description

nag_lapack_zhbtrd (f08hs) reduces a Hermitian band matrix AA to real symmetric tridiagonal form TT by a unitary similarity transformation:
T = QH A Q .
T = QH A Q .
The unitary matrix QQ is determined as a product of Givens rotation matrices, and may be formed explicitly by the function if required.
The function uses a vectorizable form of the reduction, due to Kaufman (1984).

References

Kaufman L (1984) Banded eigenvalue solvers on vector machines ACM Trans. Math. Software 10 73–86
Parlett B N (1998) The Symmetric Eigenvalue Problem SIAM, Philadelphia

Parameters

Compulsory Input Parameters

1:     vect – string (length ≥ 1)
Indicates whether QQ is to be returned.
vect = 'V'vect='V'
QQ is returned.
vect = 'U'vect='U'
QQ is updated (and the array q must contain a matrix on entry).
vect = 'N'vect='N'
QQ is not required.
Constraint: vect = 'V'vect='V', 'U''U' or 'N''N'.
2:     uplo – string (length ≥ 1)
Indicates whether the upper or lower triangular part of AA is stored.
uplo = 'U'uplo='U'
The upper triangular part of AA is stored.
uplo = 'L'uplo='L'
The lower triangular part of AA is stored.
Constraint: uplo = 'U'uplo='U' or 'L''L'.
3:     kd – int64int32nag_int scalar
If uplo = 'U'uplo='U', the number of superdiagonals, kdkd, of the matrix AA.
If uplo = 'L'uplo='L', the number of subdiagonals, kdkd, of the matrix AA.
Constraint: kd0kd0.
4:     ab(ldab, : :) – complex array
The first dimension of the array ab must be at least max (1,kd + 1)max(1,kd+1)
The second dimension of the array must be at least max (1,n)max(1,n)
The upper or lower triangle of the nn by nn Hermitian band matrix AA.
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).
5:     q(ldq, : :) – complex array
The first dimension, ldq, of the array q must satisfy
  • if vect = 'V'vect='V' or 'U''U', ldq max (1,n) ldq max(1,n) ;
  • if vect = 'N'vect='N', ldq1ldq1.
The second dimension of the array must be at least max (1,n)max(1,n) if vect = 'V'vect='V' or 'U''U' and at least 11 if vect = 'N'vect='N'
If vect = 'U'vect='U', q must contain the matrix formed in a previous stage of the reduction (for example, the reduction of a banded Hermitian-definite generalized eigenproblem); otherwise q need not be set.

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The first dimension of the array ab and the second dimension of the array ab. (An error is raised if these dimensions are not equal.)
nn, the order of the matrix AA.
Constraint: n0n0.

Input Parameters Omitted from the MATLAB Interface

ldab ldq work

Output Parameters

1:     ab(ldab, : :) – complex array
The first dimension of the array ab will be max (1,kd + 1)max(1,kd+1)
The second dimension of the array will be max (1,n)max(1,n)
ldab max (1,kd + 1) ldab max(1,kd+1) .
ab stores values generated during the reduction to tridiagonal form.
The first superdiagonal or subdiagonal and the diagonal of the tridiagonal matrix TT are returned in ab using the same storage format as described above.
2:     d(n) – double array
The diagonal elements of the tridiagonal matrix TT.
3:     e(n1n-1) – double array
The off-diagonal elements of the tridiagonal matrix TT.
4:     q(ldq, : :) – complex array
The first dimension, ldq, of the array q will be
  • if vect = 'V'vect='V' or 'U''U', ldq max (1,n) ldq max(1,n) ;
  • if vect = 'N'vect='N', ldq1ldq1.
The second dimension of the array will be max (1,n)max(1,n) if vect = 'V'vect='V' or 'U''U' and at least 11 if vect = 'N'vect='N'
If vect = 'V'vect='V' or 'U''U', the nn by nn matrix QQ.
If vect = 'N'vect='N', q is not referenced.
5:     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: vect, 2: uplo, 3: n, 4: kd, 5: ab, 6: ldab, 7: d, 8: e, 9: q, 10: ldq, 11: work, 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.

Accuracy

The computed tridiagonal matrix TT is exactly similar to a nearby matrix (A + E)(A+E), where
E2 c (n) ε A2 ,
E2 c (n) ε A2 ,
c(n)c(n) is a modestly increasing function of nn, and εε is the machine precision.
The elements of TT themselves may be sensitive to small perturbations in AA or to rounding errors in the computation, but this does not affect the stability of the eigenvalues and eigenvectors.
The computed matrix QQ differs from an exactly unitary matrix by a matrix EE such that
E2 = O(ε) ,
E2 = O(ε) ,
where εε is the machine precision.

Further Comments

The total number of real floating point operations is approximately 20n2k20n2k if vect = 'N'vect='N' with 10n3(k1) / k10n3(k-1)/k additional operations if vect = 'V'vect='V'.
The real analogue of this function is nag_lapack_dsbtrd (f08he).

Example

function nag_lapack_zhbtrd_example
vect = 'V';
uplo = 'L';
kd = int64(2);
ab = [complex(-3.13),  -1.91 + 0i,  -2.87 + 0i,  0.5 + 0i;
      1.94 + 2.1i,  -0.82 + 0.89i,  -2.1 + 0.16i,  0 + 0i;
      -3.4 - 0.25i,  -0.67 - 0.34i,  0 + 0i,  0 + 0i];
q = complex(zeros(4, 4));
[abOut, d, e, qOut, info] = nag_lapack_zhbtrd(vect, uplo, kd, ab, q)
 

abOut =

  -3.1300 + 0.0000i  -1.2853 + 0.0000i  -0.9962 + 0.0000i  -1.9985 + 0.0000i
   4.4493 + 0.0000i   1.7002 + 0.0000i   2.5144 + 0.0000i   0.0000 + 0.0000i
  -3.4000 - 0.2500i   0.6614 - 1.4067i   0.0000 + 0.0000i   0.0000 + 0.0000i


d =

   -3.1300
   -1.2853
   -0.9962
   -1.9985


e =

    4.4493
    1.7002
    2.5144


qOut =

   1.0000 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.0000 + 0.0000i   0.4360 + 0.4720i   0.1789 + 0.2537i  -0.6192 - 0.3275i
   0.0000 + 0.0000i  -0.7642 - 0.0562i   0.2549 + 0.0530i  -0.5669 + 0.1539i
   0.0000 + 0.0000i   0.0000 + 0.0000i   0.8717 - 0.2757i   0.2891 - 0.2839i


info =

                    0


function f08hs_example
vect = 'V';
uplo = 'L';
kd = int64(2);
ab = [complex(-3.13),  -1.91 + 0i,  -2.87 + 0i,  0.5 + 0i;
      1.94 + 2.1i,  -0.82 + 0.89i,  -2.1 + 0.16i,  0 + 0i;
      -3.4 - 0.25i,  -0.67 - 0.34i,  0 + 0i,  0 + 0i];
q = complex(zeros(4, 4));
[abOut, d, e, qOut, info] = f08hs(vect, uplo, kd, ab, q)
 

abOut =

  -3.1300 + 0.0000i  -1.2853 + 0.0000i  -0.9962 + 0.0000i  -1.9985 + 0.0000i
   4.4493 + 0.0000i   1.7002 + 0.0000i   2.5144 + 0.0000i   0.0000 + 0.0000i
  -3.4000 - 0.2500i   0.6614 - 1.4067i   0.0000 + 0.0000i   0.0000 + 0.0000i


d =

   -3.1300
   -1.2853
   -0.9962
   -1.9985


e =

    4.4493
    1.7002
    2.5144


qOut =

   1.0000 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.0000i   0.0000 + 0.0000i
   0.0000 + 0.0000i   0.4360 + 0.4720i   0.1789 + 0.2537i  -0.6192 - 0.3275i
   0.0000 + 0.0000i  -0.7642 - 0.0562i   0.2549 + 0.0530i  -0.5669 + 0.1539i
   0.0000 + 0.0000i   0.0000 + 0.0000i   0.8717 - 0.2757i   0.2891 - 0.2839i


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