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_zhptrd (f08gs)

Purpose

nag_lapack_zhptrd (f08gs) reduces a complex Hermitian matrix to tridiagonal form, using packed storage.

Syntax

[ap, d, e, tau, info] = f08gs(uplo, n, ap)
[ap, d, e, tau, info] = nag_lapack_zhptrd(uplo, n, ap)

Description

nag_lapack_zhptrd (f08gs) reduces a complex Hermitian matrix AA, held in packed storage, to real symmetric tridiagonal form TT by a unitary similarity transformation: A = QTQHA=QTQH.
The matrix QQ is not formed explicitly but is represented as a product of n1n-1 elementary reflectors (see the F08 Chapter Introduction for details). Functions are provided to work with QQ in this representation (see Section [Further Comments]).

References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

Parameters

Compulsory Input Parameters

1:     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'.
2:     n – int64int32nag_int scalar
nn, the order of the matrix AA.
Constraint: n0n0.
3:     ap( : :) – complex array
Note: the dimension of the array ap must be at least max (1,n × (n + 1) / 2)max(1,n×(n+1)/2).
The upper or lower triangle of the nn by nn Hermitian matrix AA, packed by columns.
More precisely,
  • if uplo = 'U'uplo='U', the upper triangle of AA must be stored with element AijAij in ap(i + j(j1) / 2)api+j(j-1)/2 for ijij;
  • if uplo = 'L'uplo='L', the lower triangle of AA must be stored with element AijAij in ap(i + (2nj)(j1) / 2)api+(2n-j)(j-1)/2 for ijij.

Optional Input Parameters

None.

Input Parameters Omitted from the MATLAB Interface

None.

Output Parameters

1:     ap( : :) – complex array
Note: the dimension of the array ap must be at least max (1,n × (n + 1) / 2)max(1,n×(n+1)/2).
ap stores the tridiagonal matrix TT and details of the unitary matrix QQ.
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:     tau(n1n-1) – complex array
Further details of the unitary matrix QQ.
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: uplo, 2: n, 3: ap, 4: d, 5: e, 6: tau, 7: info.

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.

Further Comments

The total number of real floating point operations is approximately (16/3) n3 163 n3 .
To form the unitary matrix QQ nag_lapack_zhptrd (f08gs) may be followed by a call to nag_lapack_zupgtr (f08gt):
[q, info] = f08gt(uplo, n, ap, tau);
To apply QQ to an nn by pp complex matrix CC nag_lapack_zhptrd (f08gs) may be followed by a call to nag_lapack_zupmtr (f08gu). For example,
[ap, c, info] = f08gu('Left', uplo, 'No Transpose', ap, tau, c);
forms the matrix product QCQC.
The real analogue of this function is nag_lapack_dsptrd (f08ge).

Example

function nag_lapack_zhptrd_example
uplo = 'L';
n = int64(4);
ap = [-2.28;
      1.78 + 2.03i;
      2.26 - 0.1i;
      -0.12 - 2.53i;
      -1.12 + 0i;
      0.01 - 0.43i;
      -1.07 - 0.86i;
      -0.37 + 0i;
      2.31 + 0.92i;
      -0.73 + 0i];
[apOut, d, e, tau, info] = nag_lapack_zhptrd(uplo, n, ap)
 

apOut =

  -2.2800 + 0.0000i
  -4.3385 + 0.0000i
   0.3279 - 0.1251i
  -0.1413 - 0.3666i
  -0.1285 + 0.0000i
  -2.0226 + 0.0000i
  -0.3083 + 0.1763i
  -0.1666 + 0.0000i
  -1.8023 + 0.0000i
  -1.9249 + 0.0000i


d =

   -2.2800
   -0.1285
   -0.1666
   -1.9249


e =

   -4.3385
   -2.0226
   -1.8023


tau =

   1.4103 + 0.4679i
   1.3024 + 0.7853i
   1.0940 - 0.9956i


info =

                    0


function f08gs_example
uplo = 'L';
n = int64(4);
ap = [-2.28;
      1.78 + 2.03i;
      2.26 - 0.1i;
      -0.12 - 2.53i;
      -1.12 + 0i;
      0.01 - 0.43i;
      -1.07 - 0.86i;
      -0.37 + 0i;
      2.31 + 0.92i;
      -0.73 + 0i];
[apOut, d, e, tau, info] = f08gs(uplo, n, ap)
 

apOut =

  -2.2800 + 0.0000i
  -4.3385 + 0.0000i
   0.3279 - 0.1251i
  -0.1413 - 0.3666i
  -0.1285 + 0.0000i
  -2.0226 + 0.0000i
  -0.3083 + 0.1763i
  -0.1666 + 0.0000i
  -1.8023 + 0.0000i
  -1.9249 + 0.0000i


d =

   -2.2800
   -0.1285
   -0.1666
   -1.9249


e =

   -4.3385
   -2.0226
   -1.8023


tau =

   1.4103 + 0.4679i
   1.3024 + 0.7853i
   1.0940 - 0.9956i


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