我要评分
获取效率
正确性
完整性
易理解

KmlScaissCsiSet?I?

Set parameters related to iterative solution.

Interface Definition

C interface:

int KmlScaissCsiSetSII(KmlScasolverTask **handle, enum KmlSolverParam param, const int *data, int nd);

int KmlScaissCsiSetSIS(KmlScasolverTask **handle, enum KmlSolverParam param, const float *data, int nd);

int KmlScaissCsiSetDII(KmlScasolverTask **handle, enum KmlSolverParam param, const int *data, int nd);

int KmlScaissCsiSetDID(KmlScasolverTask **handle, enum KmlSolverParam param, const double *data, int nd);

Parameters

Parameter

Type

Description

Input/Output

handle

KmlScasolverTask **

Solver handle, which is a variable passed from a previous step.

Input/Output

param

enum KmlSolverParam

  • KMLSS_THRESHOLD indicates the relative threshold for iteration residuals.
  • KMLSS_ABS_TOLERANCE indicates the absolute threshold for iteration residuals.
  • KMLSS_MAX_ITERATION_COUNT indicates the maximum number of iterations.
  • KMLSS_PRECONDITIONER_TYPE indicates the preconditioner type.
  • KMLSS_VECTOR_NORM_TYPE indicates the norm for computing the iteration residual.
  • KMLSS_MATRIX_FORMAT indicates the sparse storage format for diagonal blocks of a matrix.
  • KMLSS_OFFDIAG_MATRIX_FORMAT indicates the sparse storage format for non-diagonal blocks of a matrix.
  • KMLSS_SPECTRUM_BOUNDS indicates the array of the minimum and maximum eigenvalues.

Input

data

  • const int * in KmlScaissCsiSetSII
  • const float * in KmlScaissCsiSetSIS
  • const int * in KmlScaissCsiSetDII
  • const double * in KmlScaissCsiSetDID

Iterative solution-related parameter array (such as thresholds, maximum number of iterations, etc.).

Currently available norms for computation:

  • 1-NORM: KMLSS_L1
  • 2-NORM: KMLSS_L2

Currently available sparse matrix storage formats:

  • CSR format: KMLSS_CSR
  • ELLPACK format: KMLSS_ELL
  • COO format: KMLSS_COO
  • ELLPACK_COO hybrid format: KMLSS_SELLCOO

Available preconditioner types:

  • JACOBI preconditioner: KMLSS_JACOBI
  • Block JACOBI preconditioner: KMLSS_BJACOBI
  • AMG preconditioner: KMLSS_AMG

Input

nd

int

Number of elements in the data array.

Input

Return Value

Return Value

Type

Description

KMLSS_NO_ERROR

int

Normal execution.

KMLSS_DATA_SIZE

int

The value of nd is not 1.

KMLSS_NULL_ARGUMENT

int

A null argument exists in {handle, data}.

KMLSS_BAD_SELECTOR

int

param is invalid.

KMLSS_BAD_PRECONDITIONER

int

The selected preconditioner has not been implemented.

Dependencies

#include "kml_scaiss.h"

For details about the sample code, see Samples.