?pptrf
Compute the LLT or UTU factorization of a symmetric positive definite matrix in packed storage.
Interface Definition
C interface:
void spptrf_(const char *uplo, const int *n, float *ap, int *info);
void dpptrf_(const char *uplo, const int *n, double *ap, int *info);
void cpptrf_(const char *uplo, const int *n, float _Complex *ap, int *info);
void zpptrf_(const char *uplo, const int *n, double _Complex *ap, int *info);
Fortran interface:
SPPTRF(UPLO, N, AP, INFO);
DPPTRF(UPLO, N, AP, INFO);
CPPTRF(UPLO, N, AP, INFO);
ZPPTRF(UPLO, N, AP, INFO);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
UPLO |
Character |
|
Input |
N |
Integer |
Number of dimensions in matrix A, N ≥ 0. |
Input |
AP |
|
|
Input, output |
INFO |
Integer |
|
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);
}
/*
* Output:
* ap: 15.225009 2.230179 12.542587 0.618344 0.421714 9.988083 0.730088 4.111996 6.943561 6.396031
*/
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 CALL DPPTRF(uplo, n, ap, info); * * Output: * ap: 15.225009 2.230179 12.542587 0.618344 0.421714 9.988083 0.730088 4.111996 6.943561 6.396031
Parent topic: Matrix Decomposition Functions