nag_lapack_dgtcon (f07cg) estimates the reciprocal condition number of a real
by
tridiagonal matrix
, using the
factorization returned by
nag_lapack_dgttrf (f07cd).
nag_lapack_dgtcon (f07cg) should be preceded by a call to
nag_lapack_dgttrf (f07cd), which uses Gaussian elimination with partial pivoting and row interchanges to factorize the matrix
as
where
is a permutation matrix,
is unit lower triangular with at most one nonzero subdiagonal element in each column, and
is an upper triangular band matrix, with two superdiagonals.
nag_lapack_dgtcon (f07cg) then utilizes the factorization to estimate either
or
, from which the estimate of the reciprocal of the condition number of
,
is computed as either
or
is returned, rather than
, since when
is singular
is infinite.
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.
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 .
The complex analogue of this function is
nag_lapack_zgtcon (f07cu).
This example estimates the condition number in the
-norm of the tridiagonal matrix
given by
function f07cg_example
fprintf('f07cg example results\n\n');
du = [ 2.1 -1.0 1.9 8.0];
d = [3.0 2.3 -5.0 -0.9 7.1];
dl = [3.4 3.6 7.0 -6.0 ];
n = numel(d);
[dlf, df, duf, du2f, ipiv, info] = ...
f07cd(dl, d, du);
a = [0 du; d; dl 0];
anorm = norm(a,1);
norm_p = '1-norm';
[rcond, info] = f07cg( ...
norm_p, dlf, df, duf, du2f, ipiv, anorm);
fprintf('Estimate of condition number = %10.2e\n', 1/rcond);