?hptrf
Compute the LDL* or U*DU factorization of a packed Hermitian matrix.
Interface Definition
C interface:
void chptrf_(const char *uplo, const int *n, float _Complex *ap, int *ipiv, int *info);
void zhptrf_(const char *uplo, const int *n, double _Complex *ap, int *ipiv, int *info);
Fortran interface:
CHPTRF(UPLO, N, AP, IPIV, INFO);
ZHPTRF(UPLO, N, AP, IPIV, INFO);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
UPLO |
Character |
|
Input |
N |
Integer |
Number of dimensions in matrix A, N ≥ 0. |
Input |
AP |
|
|
Input/Output |
IPIV |
Integer |
Permutation array of size N, defining the block structure of diagonal matrix D and the associated pivoting details.
|
Output |
INFO |
Integer |
|
Output |
Dependencies
#include "klapack.h"
Examples
C interface:
const char uplo = 'U';
const int n = 4;
double ap[] = {0.521739, 0.043478, 0.304348, 0.130435, 0.304348, 0.043478, 0.652174, 0.086957, 0.521739, 0.086957};
double ipiv[4];
int info = 0;
zhptrf_(&uplo, &n, ap, ipiv, &info);
if (info != 0) {
printf("ERROR, info = %d\n", info);
}
/*
* Output:
* ap: -0.129534 1.024339 0.302185 -0.492537 -0.044777 -0.728261 1.250000 0.083333 0.250000 0.521739
* ipiv: 1 2 1 1
*/
Fortran interface:
CHARACTER::uplo = "U" PARAMETER (n = 4) INTEGER :: info = 0 REAL(8) :: ap(n*(n+1)/2) INTEGER :: ipiv(n) DATA ap / 0.521739, 0.043478, 0.304348, 0.130435, 0.304348, 0.043478, 0.652174, 0.086957, 0.521739, 0.086957 / EXTERNAL ZHPTRF CALL ZHPTRF(uplo, n, ap, ipiv, info); * * Output: * ap: -0.129534 1.024339 0.302185 -0.492537 -0.044777 -0.728261 1.250000 0.083333 0.250000 0.521739 * ipiv: 1 2 1 1
Parent topic: Matrix Decomposition Functions