KmlSolverMatrixCreate
创建矩阵操作句柄。
 创建矩阵时是浅拷贝,用户需要保证在KmlSolverMatrixDestroy前不释放通过参数store指定的内存。
接口定义
C Interface:
int KmlSolverMatrixCreate(KmlSolverMatrix **pMatrix, const KmlSolverMatrixStore *store, const KmlSolverMatrixOption *matOption);
参数
参数名  | 
类型  | 
描述  | 
输入/输出  | 
|---|---|---|---|
pMatrix  | 
KmlSolverMatrix **  | 
矩阵句柄,pMatrix不可为空指针。  | 
输入/输出  | 
store  | 
KmlSolverMatrixStore *  | 
矩阵格式信息结构体,不可为空指针,具体内容如表1所示。  | 
输入  | 
matOption  | 
KmlSolverMatrixOption *  | 
矩阵配置选项,不可为空指针,具体内容如表2所示。  | 
输入  | 
字段名  | 
类型  | 
描述  | 
|---|---|---|
valueType  | 
KmlSolverValueType  | 
矩阵数值类型,有如下值。 
  | 
indexType  | 
KmlSolverIndexType  | 
矩阵坐标索引类型。 
  | 
nRow  | 
int64_t  | 
矩阵行数。  | 
nCol  | 
int64_t  | 
矩阵列数。  | 
format  | 
KmlSolverMatrixStoreFormat  | 
矩阵存储格式,有如下值。 
  | 
csr  | 
KmlSolverMatrixStoreCSR 该类型字段描述如表3所示。  | 
format为KMLSS_MATRIX_STORE_CSR、KMLSS_MATRIX_STORE_CSR_L或KMLSS_MATRIX_STORE_CSR_U时,该字段有效。  | 
csc  | 
KmlSolverMatrixStoreCSC 该类型字段描述如表4所示。  | 
format为KMLSS_MATRIX_STORE_CSC、KMLSS_MATRIX_STORE_CSC_L或KMLSS_MATRIX_STORE_CSC_U时,该字段有效。  | 
coo  | 
KmlSolverMatrixStoreCOO 该类型字段描述如表5所示。  | 
format为KMLSS_MATRIX_STORE_COO、KMLSS_MATRIX_STORE_COO_L或KMLSS_MATRIX_STORE_COO_U时,该字段有效。  | 
dense  | 
KmlSolverMatrixStoreDense 该类型字段描述如表6所示。  | 
format为KMLSS_MATRIX_STORE_DENSE_ROW_MAJOR或KMLSS_MATRIX_STORE_DENSE_COL_MAJOR时,该字段有效。  | 
字段名  | 
类型  | 
描述  | 
|---|---|---|
fieldMask  | 
uint64_t  | 
配置生效的字段掩码。非0的位代表配置对应字段指定的值,0的位代表使用默认值,可配置的掩码位见具体字段的说明。  | 
type  | 
KmlSolverMatrixType  | 
指定矩阵类型,有如下值。 
 掩码位:KMLSS_MATRIX_OPTION_TYPE  | 
字段名  | 
类型  | 
描述  | 
|---|---|---|
value  | 
void *  | 
非零元数值数组,大小为非零元个数。  | 
rowOffset  | 
void *  | 
行偏移数组,大小为行数加1。  | 
colIndex  | 
void *  | 
列坐标数组,大小为非零元个数,需按升序排列。  | 
字段名  | 
类型  | 
描述  | 
|---|---|---|
value  | 
void *  | 
非零元数值数组,大小为非零元个数。  | 
rowIndex  | 
void *  | 
行坐标数组,大小为非零元个数,需按升序排列。  | 
colOffset  | 
void *  | 
列偏移数组,大小为行数加1。  | 
返回值
返回值  | 
类型  | 
描述  | 
|---|---|---|
KMLSS_NO_ERROR  | 
int  | 
正常执行。  | 
KMLSS_INTERNAL_ERROR  | 
int  | 
内部错误。  | 
KMLSS_NULL_ARGUMENT  | 
int  | 
pMatrix,store,matOption存在空参数。  | 
依赖
#include "kml_solver.h"