KmlScaissCgSetUserSpmv?I
Associate with the user-defined matrix-vector multiplication function. This interface must be used together with the matrix-free initialization interface.
Interface Definition
C interfaces:
int KmlScaissCgSetUserSpmvSI(KmlScasolverTask **handle, void *ustruct, int (*fptr)(void *ustruct, const float *x, float *y));
int KmlScaissCgSetUserSpmvDI(KmlScasolverTask **handle, void *ustruct, int (*fptr)(void *ustruct, const double *x, double *y));
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
handle |
KmlScasolverTask ** |
Solver handle, which is a variable passed from a previous step. |
Input/Output |
ustruct |
void * |
Pointer to user data. This parameter is transferred as the first parameter each time the preconditioner is called. |
Input |
(*fptr) |
int |
Pointer to the user-defined function that performs the matrix-vector multiplication. The matrix-vector multiplication function multiplies the matrix by the input vector x and stores the result in the output vector y. |
Input |
Return Value
Return Value |
Type |
Description |
|---|---|---|
KMLSS_NO_ERROR |
int |
The execution is successful. |
KMLSS_DATA_SIZE |
int |
The value of nd is not 1. |
KMLSS_NULL_ARGUMENT |
int |
A null parameter exists in {handle, data}. |