Rate This Document
Findability
Accuracy
Completeness
Readability

KmlBlockBandedMatrixSubstitude

This is a custom KML_LAPACK interface that performs back substitution using the factorization result of a block-banded matrix with a block size of 5. This interface does not include pivoting, so the matrix must be diagonally dominant.

Interface Definition

void KmlBlockBandedMatrixSubstitude_(int *n, double *a, double *x, int *batchSize, int *info);

Parameters

Parameter

Type

Description

Input/Output

n

Integer

Matrix size. It must be at least 20 and a multiple of 5.

Input

a

Double-precision floating-point

Elements of matrix A.

Input/Output

x

Double-precision floating-point

When used as an input, it is the RHS. When used as an output, it is the solution vector.

Input/Output

batchSize

Integer

Batch size, where 0 < batchSize ≤ 8.

Input

info

Integer

  • info = 0: successful exit.
  • info < 0: The value of the (−info)-th parameter is invalid.

Input/Output

Examples

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);
/* Fill in data */
KmlBlockBandedMatrixSolve_(&n, aa, xx, &batchSize, &info);
double *rhs = (double *)malloc(sizeof(double) * n * batchSize);
/* Fill in the new RHS */
KmlBlockBandedMatrixSubstitude_(&n, aa, rhs, &batchSize, &info);