Rate This Document
Findability
Accuracy
Completeness
Readability

?pptri

Compute the inverse matrix of a symmetric positive definite matrix stored in packed format.

Interface Definition

C interface:

void spptri_(const char *UPLO, const int *N, const float *AP, int *INFO);

void dpptri_(const char *UPLO, const int *N, const double *AP, int *INFO);

void cpptri_(const char *UPLO, const int *N, const float _Complex *AP, int *INFO);

void zpptri_(const char *UPLO, const int *N, const double _Complex *AP, int *INFO);

Fortran interface:

SPPTRI(UPLO, N, AP, INFO);

DPPTRI(UPLO, N, AP, INFO);

CPPTRI(UPLO, N, AP, INFO);

ZPPTRI(UPLO, N, AP, INFO);

Parameters

Parameter

Type

Description

Input/Output

UPLO

Character

  • 'U': saves the upper triangular matrix of A.
  • 'L': saves the lower triangular matrix of A.

Input

N

Integer

Number of dimensions of matrix A, n ≥ 0.

Input

AP

  • A single-precision floating-point array for spptri
  • A double-precision floating-point array for dpptri
  • A single-precision complex array for cpptri
  • A double-precision complex array for zpptri
  • Before this function is called, if UPLO='U', the U part of the Cholesky factorization result of matrix A is saved in packed format; if UPLO='L', the L part of the Cholesky factorization result of matrix A is saved in packed format.
  • Saves the inverse of matrix A after this function is called.

Input, output

INFO

Integer

Execution result:

  • 0: The execution is successful.
  • Smaller than 0: The value of the -info-th parameter is invalid.
  • Greater than 0: The info-th element on the diagonal of U is 0, and the matrix cannot be inverted.

Output

Dependency

#include "klapack.h"

Examples

C interface:

const char uplo = 'U';
const int n = 4;
double ap[] = {231.8009,33.9545,162.2902,9.4143,6.6684,100.322,11.1156,53.2033,71.5384,106.5638};
int info = 0;
dpptrf_(&uplo, &n, ap, &info);
if (info != 0) {
    printf("ERROR, info = %d\n", info);
}

dpptri_(&uplo, &n, ap, &info);
if (info != 0) {
    printf("ERROR, info = %d\n", info);
}

/* 
* Output: 
*   ap: 0.004478    -0.001104    0.008634    -0.000781    0.004837    0.021837    0.000608    -0.007443    -0.016993    0.024444
*/

Fortran interface:

CHARACTER::uplo = "U"
PARAMETER (n = 4)  
INTEGER :: info = 0 
REAL(8) :: ap(n*(n+1)/2) 
  
DATA ap / 231.8009,33.9545,162.2902,9.4143,6.6684,100.322,11.1156,53.2033,71.5384,106.5638 / 

 EXTERNAL DPPTRF,DPPTRI
 CALL DPPTRF(uplo, n, ap, info)
 CALL DPPTRI(uplo, n, ap, info)
* 
* Output: 
*   ap: 0.004478    -0.001104    0.008634    -0.000781    0.004837    0.021837    0.000608    -0.007443    -0.016993    0.024444