KmlScadssSYMSet?I?
Set a value associated with a handle.
Interface Definition
C interfaces:
int KmlScadssSymSetSII(KmlScaSolverTask **pHandle, enum KML_SOLVER_PARAM param, int *value, int nvalue);
int KmlScadssSymSetDII(KmlScaSolverTask **pHandle, enum KML_SOLVER_PARAM param, int *value, int nvalue);
int KmlScadssSymSetCII(KmlScaSolverTask **pHandle, enum KML_SOLVER_PARAM param, int *value, int nvalue);
int KmlScadssSymSetZII(KmlScaSolverTask **pHandle, enum KML_SOLVER_PARAM param, int *value, int nvalue);
int KmlScadssSymSetDID(KmlScaSolverTask **pHandle, enum KML_SOLVER_PARAM param, double *value, int nvalue);
int KmlScadssSymSetZID(KmlScaSolverTask **pHandle, enum KML_SOLVER_PARAM param, double *value, int nvalue);
int KmlScadssSymSetSIS(KmlScaSolverTask **pHandle, enum KML_SOLVER_PARAM param, float *value, int nvalue);
int KmlScadssSymSetCIS(KmlScaSolverTask **pHandle, enum KML_SOLVER_PARAM param, float *value, int nvalue);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
pHandle |
KmlScaSolverTask |
Solver handle. pHandle cannot be a null pointer. |
Input |
param |
enum KML_SOLVER_PARAM |
|
Input |
value |
int * |
Array containing parameters related to direct solution methods. |
Output |
nvalue |
int |
Number of elements in the value array. |
Input |
Return Value
Return Value |
Type |
Description |
|---|---|---|
KMLSS_NO_ERROR |
int |
The execution is successful. |
KMLSS_NULL_ARGUMENT |
int |
The pHandle pointer is null. |
KMLSS_BAD_HANDLE |
int |
The pHandle format is converted incorrectly. |
KMLSS_BAD_DATA_SIZE |
int |
The KMLSS_FILL_IN array length (nvalue) is incorrectly set. |
KMLSS_INTERNAL_ERROR |
int |
A null pointer is returned for internal data, and KMLSS_FILL_IN fails to be obtained. |
KMLSS_BAD_SELECTOR |
int |
The input value of KML_SOLVER_PARAM is not supported currently or does not exist during the solving process. |
Dependencies
#include "kml_scadss.h"
Examples
C interface:
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 = KmlScadssSymInitDI(&matrix_handle, n, a, ja, ia, MPI_COMM_WORLD);
ierr = KmlScadssSymSetDII(&matrix_handle, KMLSS_REFINEMENT_MAX_STEPS, &max_refinement_steps , 1);
ierr = KmlScadssSymAnalyzeDI(&matrix_handle);
ierr = KmlScadssSymFactorizeDI(&matrix_handle);
int nrhs = 1;
int ldx=n, ldb=n;
ierr = KmlScadssSymSolveDI(&matrix_handle, nrhs, x, ldx, b, ldb);