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_zgtcon (f07cu)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_lapack_zgtcon (f07cu) estimates the reciprocal condition number of a complex n  by n  tridiagonal matrix A , using the LU  factorization returned by nag_lapack_zgttrf (f07cr).

Syntax

[rcond, info] = f07cu(norm_p, dl, d, du, du2, ipiv, anorm, 'n', n)
[rcond, info] = nag_lapack_zgtcon(norm_p, dl, d, du, du2, ipiv, anorm, 'n', n)

Description

nag_lapack_zgtcon (f07cu) should be preceded by a call to nag_lapack_zgttrf (f07cr), which uses Gaussian elimination with partial pivoting and row interchanges to factorize the matrix A  as
A=PLU ,  
where P  is a permutation matrix, L  is unit lower triangular with at most one nonzero subdiagonal element in each column, and U  is an upper triangular band matrix, with two superdiagonals. nag_lapack_zgtcon (f07cu) then utilizes the factorization to estimate either A-11  or A-1 , from which the estimate of the reciprocal of the condition number of A , 1/κA  is computed as either
1 / κ1 A = 1 / A1 A-11  
or
1 / κ A = 1 / A A-1 .  
1/κA  is returned, rather than κA , since when A  is singular κA  is infinite.
Note that κA=κ1AT .

References

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

Parameters

Compulsory Input Parameters

1:     norm_p – string (length ≥ 1)
Specifies the norm to be used to estimate κA.
norm_p='1' or 'O'
Estimate κ1A.
norm_p='I'
Estimate κA.
Constraint: norm_p='1', 'O' or 'I'.
2:     dl: – complex array
The dimension of the array dl must be at least max1,n-1
Must contain the n-1 multipliers that define the matrix L of the LU factorization of A.
3:     d: – complex array
The dimension of the array d must be at least max1,n
Must contain the n diagonal elements of the upper triangular matrix U from the LU factorization of A.
4:     du: – complex array
The dimension of the array du must be at least max1,n-1
Must contain the n-1 elements of the first superdiagonal of U.
5:     du2: – complex array
The dimension of the array du2 must be at least max1,n-2
Must contain the n-2 elements of the second superdiagonal of U.
6:     ipiv: int64int32nag_int array
The dimension of the array ipiv must be at least max1,n
Must contain the n pivot indices that define the permutation matrix P. At the ith step, row i of the matrix was interchanged with row ipivi, and ipivi must always be either i or i+1, ipivi=i indicating that a row interchange was not performed.
7:     anorm – double scalar
If norm_p='1' or 'O', the 1-norm of the original matrix A.
If norm_p='I', the -norm of the original matrix A.
anorm must be computed either before calling nag_lapack_zgttrf (f07cr) or else from a copy of the original matrix A (see Example).
Constraint: anorm0.0.

Optional Input Parameters

1:     n int64int32nag_int scalar
Default: the dimension of the arrays d, ipiv.
n, the order of the matrix A.
Constraint: n0.

Output Parameters

1:     rcond – double scalar
Contains an estimate of the reciprocal condition number.
2:     info int64int32nag_int scalar
info=0 unless the function detects an error (see Error Indicators and Warnings).

Error Indicators and Warnings

   info<0
If info=-i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated.

Accuracy

In practice the condition number estimator is very reliable, but it can underestimate the true condition number; see Section 15.3 of Higham (2002) for further details.

Further Comments

The condition number estimation typically requires between four and five solves and never more than eleven solves, following the factorization. The total number of floating-point operations required to perform a solve is proportional to n .
The real analogue of this function is nag_lapack_dgtcon (f07cg).

Example

This example estimates the condition number in the 1-norm of the tridiagonal matrix A  given by
A = -1.3+1.3i 2.0-1.0i 0.0i+0.0 0.0i+0.0 0.0i+0.0 1.0-2.0i -1.3+1.3i 2.0+1.0i 0.0i+0.0 0.0i+0.0 0.0i+0.0 1.0+1.0i -1.3+3.3i -1.0+1.0i 0.0i+0.0 0.0i+0.0 0.0i+0.0 2.0-3.0i -0.3+4.3i 1.0-1.0i 0.0i+0.0 0.0i+0.0 0.0i+0.0 1.0+1.0i -3.3+1.3i .  
function f07cu_example


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

% Tridiagonal matrix stored by diagonals
du = [              2   - 1i     2   + 1i    -1   + 1i     1   - 1i  ];
d  = [-1.3 + 1.3i  -1.3 + 1.3i  -1.3 + 3.3i  -0.3 + 4.3i  -3.3 + 1.3i];
dl = [ 1   - 2i     1   + 1i     2   - 3i     1   + 1i               ];

% Factorize.
[dlf, df, duf, du2, ipiv, info] = ...
  f07cr(dl, d, du);

% 1-norm of A (construct column preserving matrix)
a = [0+0i du; d; dl 0+0i];
anorm = norm(a,1);

% Estimate condition number 
norm_p = '1-norm';
[rcond, info] = f07cu( ...
                       norm_p, dlf, df, duf, du2, ipiv, anorm);

fprintf('Estimate of condition number = %10.2e\n', 1/rcond);


f07cu example results

Estimate of condition number =   1.84e+02

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