KmlDssSolve
To perform back substitution on a matrix, you need to call KmlDssFactorize to factorize the matrix first.
Interface Definition
C interface:
int KmlDssSolve(KmlDssSolver *solver, const KmlSolverMatrix *b, KmlSolverMatrix *x, const KmlDssSolveOption *option);
Parameters
|
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
|
solver |
KmlDssSolver * |
Solver handle created by KmlDssInit. |
Input |
|
b |
KmlSolverMatrix * |
Pointer to the RHS vector structure, which is essentially a matrix and is created by the KmlSolverMatrixCreate function. The pointer cannot be null. |
Input |
|
x |
KmlSolverMatrix * |
Pointer to the solution space structure, which is essentially a matrix and is created by the KmlSolverMatrixCreate function. The input cannot be a null pointer, and the output is a numerical array containing the solved x. |
Output |
|
option |
KmlDssSolveOption * |
Configuration in the factorization phase, which cannot be a null pointer. For details, see Table 1. |
Input |
|
Field |
Type |
Description |
|---|---|---|
|
fieldMask |
uint64_t |
Mask that determines to which fields the configuration is applied. If a bit is set to 1, its corresponding field uses a specified value. If a bit is set to 0, its corresponding field uses the default value. See the individual field description for configurable mask bits. |
|
stage |
KmlDssSolveStage |
Back substitution phase. The options are as follows:
Mask bit: KMLDSS_SOLVE_OPTION_SOLVE_STAGE |
|
refineMethod |
KmlDssRefineMethod |
Iterative refinement method, including:
Mask bit: KMLDSS_SOLVE_OPTION_REFINE_METHOD |
|
refineMaxSteps |
int32_t |
Maximum number of iterative refinement steps, including:
Mask bit: KMLDSS_SOLVE_OPTION_REFINE_MAX_STEP |
|
refineTolerance |
double |
Residual threshold for iterative refinement, including the following values:
Mask bit: KMLDSS_SOLVE_OPTION_REFINE_TOLERANCE If any of the following conditions is met, iteration refinement is terminated immediately:
|
Return Value
|
Return Value |
Type |
Description |
|---|---|---|
|
KMLSS_NO_ERROR |
int |
Normal execution. |
|
KMLSS_INTERNAL_ERROR |
int |
Internal error. |
|
KMLSS_NULL_ARGUMENT |
int |
A null argument exists in {solver, b, x, option}. |
Dependencies
#include "kml_dss.h"


