KmlScadss(SPD/HPD)Clean?I
Release the internal data structure.
Interface Definition
C interfaces:
int KmlScadssSpdCleanSI(KmlScaSolverTask **pHandle);
int KmlScadssSpdCleanDI(KmlScaSolverTask **pHandle);
int KmlScadssHpdCleanCI(KmlScaSolverTask **pHandle);
int KmlScadssHpdCleanZI(KmlScaSolverTask **pHandle);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
pHandle |
KmlScasolverTask ** |
Solver handle, which is a variable passed from a previous step. |
Input/Output |
Return Value
Return Value |
Type |
Description |
|---|---|---|
KMLSS_NO_ERROR |
int |
The execution is successful. |
KMLSS_NULL_ARGUMENT |
int |
Invalid parameter. |
KMLSS_BAD_HANDLE |
int |
The format of pHandle is incorrect. |
Dependencies
#include "kml_scadss.h"
Examples
C interface:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | MPI_Init(NULL, NULL); int size, rank; MPI_Comm_size(MPI_COMM_WORLD, &size);// Obtain the total number of processes. MPI_Comm_rank(MPI_COMM_WORLD, &rank);// Obtain the current process rank. int n = 8; int ia[9] = {0, 3, 7, 9, 11, 13, 15, 16, 17}; int ja[17] = {0, 3, 4, 1, 2, 3, 5, 2, 7, 3, 6, 4, 5, 5, 7, 6, 7}; double a[17] = {1.0, 1.0, 2.0, 9.0, 2.0, 1.0, -3.0, 3.0, 2.0, 9.0, -5.0, 6.0, 1.0, 4.0, 1.0, 7.0, 2.0}; double b[8] = {4.0, 9.0, 7.0, 6.0, 9.0, 3.0, 2.0, 5.0}; double x[8]; KmlScasolverTask* matrix_handle = NULL; int ierr = KmlScadssSpdInitDI(&matrix_handle, n, a, ja, ia, MPI_COMM_WORLD); ierr = KmlScadssSpdAnalyzeDI(&matrix_handle); ierr = KmlScadssSpdFactorizeDI(&matrix_handle); int nrhs = 1; int ldx=n, ldb=n; ierr = KmlScadssSpdSolveDI(&matrix_handle, nrhs, x, ldx, b, ldb); ierr = KmlScadssSpdCleanDI(&matrix_handle); if (ierr != 0) { printf("\nERROR in KmlScadssSpdCleanDI: %d", ierr); } |
Parent topic: SCADSS-LLT/LLH (DEPRECATED)