LMMC
Lamina Mathematic core
Toggle main menu visibility
载入中...
搜索中...
未找到
sparse_arithmetic.h
浏览该文件的文档.
1
2
#ifndef LMMC_SPARSE_ARITHMETIC_H
3
#define LMMC_SPARSE_ARITHMETIC_H
4
5
#include "
lmmc/sparse_types.h
"
6
#include "
lmmc/dense_types.h
"
7
#include "
lmmc/status.h
"
8
9
#ifdef __cplusplus
10
extern
"C"
{
11
#endif
12
30
lmmc_status_t
lmmc_sparse_mat_vec_mul
(
const
lmmc_sparse_mat_t
* sparse,
const
lmmc_vec_t
* x,
lmmc_vec_t
* y);
31
49
lmmc_status_t
lmmc_sparse_mat_mat_mul_dense
(
const
lmmc_sparse_mat_t
* sparse,
const
lmmc_mat_t
* b,
lmmc_mat_t
* c);
50
70
lmmc_status_t
lmmc_sparse_mat_mat_mul_sparse
(
const
lmmc_sparse_mat_t
* a,
const
lmmc_sparse_mat_t
* b,
lmmc_sparse_mat_t
* c);
71
73
lmmc_status_t
lmmc_sparse_add
(
74
lmmc_real_t
alpha,
const
lmmc_sparse_mat_t
* a,
75
lmmc_real_t
beta,
const
lmmc_sparse_mat_t
* b,
76
lmmc_sparse_mat_t
* out_c
77
);
78
80
lmmc_status_t
lmmc_sparse_scale
(
81
lmmc_sparse_mat_t
* a,
82
lmmc_real_t
alpha
83
);
84
86
lmmc_status_t
lmmc_sparse_norm_fro
(
87
const
lmmc_sparse_mat_t
* a,
88
lmmc_real_t
* out_norm
89
);
90
92
lmmc_status_t
lmmc_sparse_diag
(
93
const
lmmc_sparse_mat_t
* a,
94
lmmc_vec_t
* out_diag
95
);
96
106
lmmc_status_t
lmmc_sparse_sym_spmv
(
const
lmmc_sparse_sym_csr_t
* A,
107
const
lmmc_vec_t
* x,
lmmc_vec_t
* y);
108
109
#ifdef __cplusplus
110
}
111
#endif
112
113
#endif
lmmc_real_t
double lmmc_real_t
Public and internal LMMC real type.
定义
config.h:28
dense_types.h
lmmc_mat_t
行优先存储的稠密矩阵。
定义
dense_types.h:18
lmmc_vec_t
一维稠密向量。
定义
dense_types.h:31
lmmc_sparse_scale
lmmc_status_t lmmc_sparse_scale(lmmc_sparse_mat_t *a, lmmc_real_t alpha)
就地标量缩放: 。
定义
sparse_arithmetic.c:226
lmmc_sparse_diag
lmmc_status_t lmmc_sparse_diag(const lmmc_sparse_mat_t *a, lmmc_vec_t *out_diag)
提取主对角线为稠密向量.要求 a->rows == a->cols 。
定义
sparse_arithmetic.c:274
lmmc_sparse_norm_fro
lmmc_status_t lmmc_sparse_norm_fro(const lmmc_sparse_mat_t *a, lmmc_real_t *out_norm)
用缩放平方和计算稀疏矩阵的 Frobenius 范数。
定义
sparse_arithmetic.c:251
lmmc_sparse_mat_mat_mul_sparse
lmmc_status_t lmmc_sparse_mat_mat_mul_sparse(const lmmc_sparse_mat_t *a, const lmmc_sparse_mat_t *b, lmmc_sparse_mat_t *c)
稀疏矩阵-稀疏矩阵乘法(SpGEMM):C = A * B。
定义
sparse_products.c:310
lmmc_sparse_add
lmmc_status_t lmmc_sparse_add(lmmc_real_t alpha, const lmmc_sparse_mat_t *a, lmmc_real_t beta, const lmmc_sparse_mat_t *b, lmmc_sparse_mat_t *out_c)
计算 C = alpha * A + beta * B .要求 a 与 b 同维同格式。
定义
sparse_arithmetic.c:132
lmmc_sparse_mat_vec_mul
lmmc_status_t lmmc_sparse_mat_vec_mul(const lmmc_sparse_mat_t *sparse, const lmmc_vec_t *x, lmmc_vec_t *y)
稀疏矩阵-稠密向量乘法:y = A * x。
定义
sparse_products.c:13
lmmc_sparse_mat_mat_mul_dense
lmmc_status_t lmmc_sparse_mat_mat_mul_dense(const lmmc_sparse_mat_t *sparse, const lmmc_mat_t *b, lmmc_mat_t *c)
稀疏矩阵 x 稠密矩阵:C = A * B(结果为稠密矩阵)。
定义
sparse_products.c:220
lmmc_sparse_sym_spmv
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 。
定义
sparse_symmetric.c:172
sparse_types.h
lmmc_sparse_mat_t
通用稀疏矩阵(CSR / CSC 共用同一结构)。
定义
sparse_types.h:34
lmmc_sparse_sym_csr_t
对称半存储 CSR 格式矩阵。
定义
sparse_types.h:114
status.h
LMMC 通用状态码定义.
lmmc_status_t
lmmc_status_t
LMMC 库统一返回的状态码.
定义
status.h:22
lmmc
sparse_arithmetic.h
生成于
, 为 LMMC使用
1.18.0