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_dsptri (f07pj)

 Contents

    1  Purpose
    2  Syntax
    7  Accuracy
    9  Example

Purpose

nag_lapack_dsptri (f07pj) computes the inverse of a real symmetric indefinite matrix A, where A has been factorized by nag_lapack_dsptrf (f07pd), using packed storage.

Syntax

[ap, info] = f07pj(uplo, ap, ipiv, 'n', n)
[ap, info] = nag_lapack_dsptri(uplo, ap, ipiv, 'n', n)

Description

nag_lapack_dsptri (f07pj) is used to compute the inverse of a real symmetric indefinite matrix A, the function must be preceded by a call to nag_lapack_dsptrf (f07pd), which computes the Bunch–Kaufman factorization of A, using packed storage.
If uplo='U', A=PUDUTPT and A-1 is computed by solving UTPTXPU=D-1.
If uplo='L', A=PLDLTPT and A-1 is computed by solving LTPTXPL=D-1.

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:     ap: – double array
The dimension of the array ap must be at least max1,n×n+1/2
The factorization of A stored in packed form, as returned by nag_lapack_dsptrf (f07pd).
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_dsptrf (f07pd).

Optional Input Parameters

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

Output Parameters

1:     ap: – double array
The dimension of the array ap will be max1,n×n+1/2
The factorization stores the n by n matrix A-1.
More precisely,
  • if uplo='U', the upper triangle of A-1 must be stored with element Aij in api+jj-1/2 for ij;
  • if uplo='L', the lower triangle of A-1 must be stored with element Aij in api+2n-jj-1/2 for ij.
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_zhptri (f07pw) for Hermitian matrices and nag_lapack_zsptri (f07qw) 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, stored in packed form, and must first be factorized by nag_lapack_dsptrf (f07pd).
function f07pj_example


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

% Indefinite matrix A (lower triangular part stored in packed format)
uplo = 'L';
n = int64(4);
ap = [2.07;   3.87;   4.20;   -1.15;
             -0.21;   1.87;    0.63;
                      1.15;    2.06;
                              -1.81];

% Factorize
[apf, ipiv, info] = f07pd( ...
                           uplo, n, ap);

% Invert
[ainv, info] = f07pj( ...
                      uplo, apf, ipiv);

[ifail] = x04cc( ...
                 uplo, 'Non-unit', n, ainv, 'Inverse');


f07pj 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