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_dsytri (f07mj)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_lapack_dsytri (f07mj) computes the inverse of a real symmetric indefinite matrix A, where A has been factorized by nag_lapack_dsytrf (f07md).

Syntax

[a, info] = f07mj(uplo, a, ipiv, 'n', n)
[a, info] = nag_lapack_dsytri(uplo, a, ipiv, 'n', n)

Description

nag_lapack_dsytri (f07mj) is used to compute the inverse of a real symmetric indefinite matrix A, the function must be preceded by a call to nag_lapack_dsytrf (f07md), which computes the Bunch–Kaufman factorization of A.
If uplo='U', A=PUDUTPT and A-1 is computed by solving UTPTXPU=D-1 for X.
If uplo='L', A=PLDLTPT and A-1 is computed by solving LTPTXPL=D-1 for X.

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:     uplo – string (length ≥ 1)
Specifies how A has been factorized.
uplo='U'
A=PUDUTPT, where U is upper triangular.
uplo='L'
A=PLDLTPT, where L is lower triangular.
Constraint: uplo='U' or 'L'.
2:     alda: – double array
The first dimension of the array a must be at least max1,n.
The second dimension of the array a must be at least max1,n.
Details of the factorization of A, as returned by nag_lapack_dsytrf (f07md).
3:     ipiv: int64int32nag_int array
The dimension of the array ipiv must be at least max1,n
Details of the interchanges and the block structure of D, as returned by nag_lapack_dsytrf (f07md).

Optional Input Parameters

1:     n int64int32nag_int scalar
Default: the first dimension of the array a and the second dimension of the arrays a, ipiv.
n, the order of the matrix A.
Constraint: n0.

Output Parameters

1:     alda: – double array
The first dimension of the array a will be max1,n.
The second dimension of the array a will be max1,n.
The factorization stores the n by n symmetric matrix A-1.
If uplo='U', the upper triangle of A-1 is stored in the upper triangular part of the array.
If uplo='L', the lower triangle of A-1 is stored in the lower triangular part of the array.
2:     info int64int32nag_int scalar
info=0 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.

   info<0
If info=-i, argument i had an illegal value. An explanatory message is output, and execution of the program is terminated.
W  info>0
Element _ of the diagonal is exactly zero. D is singular and the inverse of A cannot be computed.

Accuracy

The computed inverse X satisfies a bound of the form cn is a modest linear function of n, and ε is the machine precision

Further Comments

The total number of floating-point operations is approximately 23n3.
The complex analogues of this function are nag_lapack_zhetri (f07mw) for Hermitian matrices and nag_lapack_zsytri (f07nw) for symmetric matrices.

Example

This example computes the inverse of the matrix A, where
A= 2.07 3.87 4.20 -1.15 3.87 -0.21 1.87 0.63 4.20 1.87 1.15 2.06 -1.15 0.63 2.06 -1.81 .  
Here A is symmetric indefinite and must first be factorized by nag_lapack_dsytrf (f07md).
function f07mj_example


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

% Indefinite matrix A (lower triangular part stored)
uplo = 'L';
a = [ 2.07,  0,    0,     0; 
      3.87, -0.21, 0,     0;
      4.20,  1.87, 1.15,  0;
     -1.15,  0.63, 2.06, -1.81];

% Factorize
[af, ipiv, info] = f07md( ...
                          uplo, a);

% Invert
[ainv, info] = f07mj( ...
                      uplo, af, ipiv);

[ifail] = x04ca( ...
                 uplo, 'N', ainv, 'Inverse');


f07mj example results

 Inverse
             1          2          3          4
 1      0.7485
 2      0.5221    -0.1605
 3     -1.0058    -0.3131     1.3501
 4     -1.4386    -0.7440     2.0667     2.4547

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