?pptri
计算压缩存储的对称正定矩阵的逆矩阵。
接口定义
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);
参数
参数名 |
类型 |
描述 |
输入/输出 |
---|---|---|---|
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); } 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
父主题: 矩阵求逆函数