struct_spmat.h 1021 B

123456789101112131415161718192021222324252627
  1. /**
  2. * @file struct_spmat.h
  3. * @brief 定义稀疏矩阵(sparse matrix)结构体。我们将函数原型与结构体定义拆分为两个文件,用来提高工程代码质量。
  4. * This is the definition of sparse matrix structure. We split function prototypes and struct definition into two files for better code engineering.
  5. * @version 0.1
  6. * @date 2021-09-17
  7. *
  8. * @copyright Copyright (c) 2021
  9. *
  10. */
  11. #ifndef __STRUCT_SPMAT_H__
  12. #define __STRUCT_SPMAT_H__
  13. #include "csocp_config.h"
  14. /** 稀疏矩阵数据结构 Data structure for sparse matrices */
  15. struct c_spmat_s {
  16. c_int nCol; /**< 列数 Number of columns */
  17. c_int nRow; /**< 行数 Number of rows */
  18. c_int nElem; /**< 非零元素数量 Number of nonzeros */
  19. c_int *colBeg; /**< CSC矩阵的begin指针 Begin pointer of column-wise matrix */
  20. c_int *colIdx; /**< CSC矩阵的index指针 Index pointer of column-wise matrix */
  21. c_real *colElem; /**< CSC矩阵的element指针 Element pointer of column-wise matrix */
  22. };
  23. #endif