PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_ztptri (f07uw)
Purpose
nag_lapack_ztptri (f07uw) computes the inverse of a complex triangular matrix, using packed storage.
Syntax
Description
nag_lapack_ztptri (f07uw) forms the inverse of a complex triangular matrix , using packed storage. Note that the inverse of an upper (lower) triangular matrix is also upper (lower) triangular.
References
Du Croz J J and Higham N J (1992) Stability of methods for matrix inversion IMA J. Numer. Anal. 12 1–19
Parameters
Compulsory Input Parameters
- 1:
– string (length ≥ 1)
-
Specifies whether
is upper or lower triangular.
- is upper triangular.
- is lower triangular.
Constraint:
or .
- 2:
– string (length ≥ 1)
-
Indicates whether
is a nonunit or unit triangular matrix.
- is a nonunit triangular matrix.
- is a unit triangular matrix; the diagonal elements are not referenced and are assumed to be .
Constraint:
or .
- 3:
– int64int32nag_int scalar
-
, the order of the matrix .
Constraint:
.
- 4:
– complex array
-
The dimension of the array
ap
must be at least
The
by
triangular matrix
, packed by columns.
More precisely,
- if , the upper triangle of must be stored with element in for ;
- if , the lower triangle of must be stored with element in for .
If , the diagonal elements of are assumed to be , and are not referenced; the same storage scheme is used whether or ‘U’.
Optional Input Parameters
None.
Output Parameters
- 1:
– complex array
-
The dimension of the array
ap will be
stores , using the same storage format as described above.
- 2:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
Error Indicators and Warnings
Cases prefixed with W are classified as warnings and
do not generate an error of type NAG:error_n. See nag_issue_warnings.
-
If , argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
- W
-
Element of the diagonal is exactly zero.
is singular its inverse cannot be computed.
Accuracy
The computed inverse
satisfies
where
is a modest linear function of
, and
is the
machine precision.
Note that a similar bound for cannot be guaranteed, although it is almost always satisfied.
The computed inverse satisfies the forward error bound
See
Du Croz and Higham (1992).
Further Comments
The total number of real floating-point operations is approximately .
The real analogue of this function is
nag_lapack_dtptri (f07uj).
Example
This example computes the inverse of the matrix
, where
using packed storage.
Open in the MATLAB editor:
f07uw_example
function f07uw_example
fprintf('f07uw example results\n\n');
n = int64(4);
ap = [ 4.78 + 4.56i; 2.00 - 0.30i; 2.89 - 1.34i; -1.89 + 1.15i;
-4.11 + 1.25i; 2.36 - 4.25i; 0.04 - 3.69i;
4.15 + 0.80i; -0.02 + 0.46i;
0.33 - 0.26i];
uplo = 'L';
diag = 'N';
[ainv, info] = f07uw(uplo, diag, n, ap);
[ifail] = x04dc( ...
uplo, 'Non-unit', n, ainv, 'Inverse');
f07uw example results
Inverse
1 2 3 4
1 0.1095
-0.1045
2 0.0582 -0.2227
-0.0411 -0.0677
3 0.0032 0.1538 0.2323
0.1905 -0.2192 -0.0448
4 0.7602 1.6184 0.1289 1.8697
0.2814 -1.4346 -0.2250 1.4731
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015