?pptrf
计算压缩存储的对称正定矩阵的LLT或UTU分解。
接口定义
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);
参数
参数名 |
类型 |
描述 |
输入/输出 |
---|---|---|---|
UPLO |
字符数 |
|
输入 |
N |
整数型 |
矩阵A的维数,N≥0。 |
输入 |
AP |
|
|
输入、输出 |
INFO |
整数型 |
|
输出 |
依赖
#include "klapack.h"
示例
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
父主题: 矩阵分解函数