LMMC
Lamina Mathematic core
载入中...
搜索中...
未找到
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
10extern "C" {
11#endif
12
31
50
71
74 lmmc_real_t alpha, const lmmc_sparse_mat_t* a,
75 lmmc_real_t beta, const lmmc_sparse_mat_t* b,
77);
78
82 lmmc_real_t alpha
83);
84
87 const lmmc_sparse_mat_t* a,
88 lmmc_real_t* out_norm
89);
90
93 const lmmc_sparse_mat_t* a,
94 lmmc_vec_t* out_diag
95);
96
107 const lmmc_vec_t* x, lmmc_vec_t* y);
108
109#ifdef __cplusplus
110}
111#endif
112
113#endif
double lmmc_real_t
Public and internal LMMC real type.
行优先存储的稠密矩阵。
一维稠密向量。
lmmc_status_t lmmc_sparse_scale(lmmc_sparse_mat_t *a, lmmc_real_t alpha)
就地标量缩放: 。
lmmc_status_t lmmc_sparse_diag(const lmmc_sparse_mat_t *a, lmmc_vec_t *out_diag)
提取主对角线为稠密向量.要求 a->rows == a->cols 。
lmmc_status_t lmmc_sparse_norm_fro(const lmmc_sparse_mat_t *a, lmmc_real_t *out_norm)
用缩放平方和计算稀疏矩阵的 Frobenius 范数。
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。
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 同维同格式。
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。
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(结果为稠密矩阵)。
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 。
通用稀疏矩阵(CSR / CSC 共用同一结构)。
对称半存储 CSR 格式矩阵。
LMMC 通用状态码定义.
lmmc_status_t
LMMC 库统一返回的状态码.