|
LMMC
Lamina Mathematic core
|
对称稀疏(SymCSR)格式:由 CSR 构建、对称 SpMV 与销毁。 更多...
#include "memory_bridge.h"#include "internal.h"#include "sparse_internal.h"#include "lmmc/sparse.h"函数 | |
| lmmc_status_t | lmmc_sparse_sym_csr_from_csr (const lmmc_sparse_mat_t *full, lmmc_sparse_sym_half_t half, lmmc_sparse_sym_csr_t *out) |
| 从完整 CSR 矩阵提取对称半存储。 | |
| lmmc_status_t | lmmc_sparse_sym_spmv (const lmmc_sparse_sym_csr_t *A, const lmmc_vec_t *x, lmmc_vec_t *y) |
对称半存储 SpMV:y = A * x 。 | |
| void | lmmc_sparse_sym_csr_destroy (lmmc_sparse_sym_csr_t *s) |
| 销毁对称半存储 CSR 矩阵,按所有权释放底层缓冲区。 | |
对称稀疏(SymCSR)格式:由 CSR 构建、对称 SpMV 与销毁。
在文件 sparse_symmetric.c 中定义.
| lmmc_status_t lmmc_sparse_sym_csr_from_csr | ( | const lmmc_sparse_mat_t * | full, |
| lmmc_sparse_sym_half_t | half, | ||
| lmmc_sparse_sym_csr_t * | out ) |
从完整 CSR 矩阵提取对称半存储。
| [in] | full | 输入完整 CSR 方阵。 |
| [in] | half | 选择上三角或下三角。 |
| [out] | out | 输出对称半存储 CSR 矩阵。 |
在文件 sparse_symmetric.c 第 89 行定义.
引用了 lmmc_sparse_sym_csr_t::col_idx, lmmc_sparse_mat_t::cols, lmmc_sparse_mat_t::format, lmmc_sparse_sym_csr_t::half, lmmc_memory_alloc(), lmmc_memory_free(), LMMC_SPARSE_CSR, lmmc_sparse_sym_csr_from_csr(), LMMC_STATUS_ALLOCATION_FAILED, LMMC_STATUS_INVALID_ARGUMENT, LMMC_STATUS_OK, lmmc_sparse_sym_csr_t::n, lmmc_sparse_sym_csr_t::nnz, lmmc_sparse_sym_csr_t::owns_data, lmmc_sparse_sym_csr_t::row_ptr, lmmc_sparse_mat_t::rows , 以及 lmmc_sparse_sym_csr_t::values.
被这些函数引用 lmmc_sparse_sym_csr_from_csr().
| lmmc_status_t lmmc_sparse_sym_spmv | ( | const lmmc_sparse_sym_csr_t * | A, |
| const lmmc_vec_t * | x, | ||
| lmmc_vec_t * | y ) |
对称半存储 SpMV:y = A * x 。
利用对称性,仅存储半三角但计算完整矩阵-向量乘积。
| [in] | A | 对称半存储 CSR 矩阵。 |
| [in] | x | 输入向量,长度为 A->n 。 |
| [out] | y | 输出向量,长度为 A->n 。 |
在文件 sparse_symmetric.c 第 172 行定义.
引用了 lmmc_sparse_sym_csr_t::col_idx, lmmc_vec_t::data, LMMC_REAL_CLEAR, LMMC_REAL_INIT, LMMC_REAL_SET_D, lmmc_sparse_sym_spmv(), LMMC_STATUS_DIMENSION_MISMATCH, LMMC_STATUS_INVALID_ARGUMENT, LMMC_STATUS_OK, lmmc_sparse_sym_csr_t::n, lmmc_sparse_sym_csr_t::nnz, lmmc_sparse_sym_csr_t::row_ptr, lmmc_vec_t::size , 以及 lmmc_sparse_sym_csr_t::values.
被这些函数引用 lmmc_sparse_sym_spmv().
| void lmmc_sparse_sym_csr_destroy | ( | lmmc_sparse_sym_csr_t * | s | ) |
销毁对称半存储 CSR 矩阵,按所有权释放底层缓冲区。
在文件 sparse_symmetric.c 第 211 行定义.
引用了 lmmc_sparse_sym_csr_t::col_idx, lmmc_memory_free(), lmmc_sparse_sym_csr_destroy(), lmmc_sparse_sym_csr_t::n, lmmc_sparse_sym_csr_t::nnz, lmmc_sparse_sym_csr_t::owns_data, lmmc_sparse_sym_csr_t::row_ptr , 以及 lmmc_sparse_sym_csr_t::values.
被这些函数引用 lmmc_sparse_sym_csr_destroy().