KmlBlockBandedMatrixSubstitude
KML_LAPACK的自定义接口,用于对分块大小为5的块状条带矩阵的分解结果进行回代。此接口不包含pivoting,因此需要保证矩阵为对角占优。
接口定义
void KmlBlockBandedMatrixSubstitude_(int *n, double *a, double *x, int *batchSize, int *info);
参数
参数名 |
类型 |
描述 |
输入/输出 |
|---|---|---|---|
n |
整数型 |
矩阵大小,至少为20,且为5的倍数 |
输入 |
a |
双精度浮点型 |
矩阵A的元素 |
输入/输出 |
x |
双精度浮点型 |
作为输入时为右端项,输出时为解向量。 |
输入/输出 |
batchSize |
整数型 |
batch大小,0<batchSize<=8。 |
输入 |
info |
整数型 |
|
输入/输出 |
示例
int n = 25; int batchSize = 8; int blockSize = 25; int info = 0; double *a = (double *)malloc(sizeof(double) * blockSize * batchSize * n); double *x = (double *)malloc(sizeof(double) * n * batchSize); double *exact_x = (double *)malloc(sizeof(double) * n * batchSize); /* 填充数据 */ KmlBlockBandedMatrixSolve_(&n, aa, xx, &batchSize, &info); double *rhs = (double *)malloc(sizeof(double) * n * batchSize); /* 填充新的右端项 */ KmlBlockBandedMatrixSubstitude_(&n, aa, rhs, &batchSize, &info);
父主题: 其他函数