LMMC
Lamina Mathematic core
Toggle main menu visibility
载入中...
搜索中...
未找到
dense_arithmetic.h
浏览该文件的文档.
1
2
#ifndef LMMC_DENSE_ARITHMETIC_H
3
#define LMMC_DENSE_ARITHMETIC_H
4
5
#include "
lmmc/dense_types.h
"
6
#include "
lmmc/status.h
"
7
8
#ifdef __cplusplus
9
extern
"C"
{
10
#endif
11
35
lmmc_status_t
lmmc_mat_gemm
(
lmmc_real_t
alpha,
const
lmmc_mat_t
* A,
int
transA,
36
const
lmmc_mat_t
* B,
int
transB,
lmmc_real_t
beta,
lmmc_mat_t
* C);
37
58
lmmc_status_t
lmmc_mat_gemv
(
lmmc_real_t
alpha,
const
lmmc_mat_t
* A,
int
transA,
59
const
lmmc_vec_t
* x,
lmmc_real_t
beta,
lmmc_vec_t
* y);
60
75
lmmc_status_t
lmmc_mat_mul
(
const
lmmc_mat_t
* a,
const
lmmc_mat_t
* b,
lmmc_mat_t
* c);
76
89
lmmc_status_t
lmmc_mat_norm_fro
(
const
lmmc_mat_t
* a,
lmmc_real_t
* out_norm);
90
103
lmmc_status_t
lmmc_vec_dot
(
const
lmmc_vec_t
* a,
const
lmmc_vec_t
* b,
lmmc_real_t
* out_dot);
104
119
lmmc_status_t
lmmc_mat_vec_mul
(
const
lmmc_mat_t
* a,
const
lmmc_vec_t
* x,
lmmc_vec_t
* y);
120
132
lmmc_status_t
lmmc_vec_norm2
(
const
lmmc_vec_t
* x,
lmmc_real_t
* out_norm);
133
144
lmmc_status_t
lmmc_vec_norm_inf
(
const
lmmc_vec_t
* x,
lmmc_real_t
* out_norm);
145
158
lmmc_status_t
lmmc_vec_scale
(
lmmc_vec_t
* x,
lmmc_real_t
alpha);
159
176
lmmc_status_t
lmmc_vec_axpy
(
lmmc_real_t
alpha,
const
lmmc_vec_t
* x,
lmmc_vec_t
* y);
177
188
lmmc_status_t
lmmc_vec_asum
(
const
lmmc_vec_t
* x,
lmmc_real_t
* out_asum);
189
202
lmmc_status_t
lmmc_vec_iamax
(
const
lmmc_vec_t
* x,
size_t
* out_idx);
203
220
lmmc_status_t
lmmc_mat_add
(
const
lmmc_mat_t
* a,
const
lmmc_mat_t
* b,
lmmc_mat_t
* c);
221
235
lmmc_status_t
lmmc_mat_sub
(
const
lmmc_mat_t
* a,
const
lmmc_mat_t
* b,
lmmc_mat_t
* c);
236
249
lmmc_status_t
lmmc_mat_scale
(
lmmc_mat_t
* a,
lmmc_real_t
alpha);
250
263
lmmc_status_t
lmmc_mat_trace
(
const
lmmc_mat_t
* a,
lmmc_real_t
* out_trace);
264
277
lmmc_status_t
lmmc_mat_norm1
(
const
lmmc_mat_t
* a,
lmmc_real_t
* out_norm);
278
291
lmmc_status_t
lmmc_mat_norm_inf
(
const
lmmc_mat_t
* a,
lmmc_real_t
* out_norm);
292
314
lmmc_status_t
lmmc_vec_cross
(
const
lmmc_vec_t
* a,
const
lmmc_vec_t
* b,
lmmc_vec_t
* c);
315
316
#ifdef __cplusplus
317
}
318
#endif
319
320
#endif
lmmc_real_t
double lmmc_real_t
Public and internal LMMC real type.
定义
config.h:28
lmmc_vec_cross
lmmc_status_t lmmc_vec_cross(const lmmc_vec_t *a, const lmmc_vec_t *b, lmmc_vec_t *c)
计算三维向量叉积: 。
定义
dense_elementwise.c:286
lmmc_mat_scale
lmmc_status_t lmmc_mat_scale(lmmc_mat_t *a, lmmc_real_t alpha)
就地矩阵标量乘: 。
定义
dense_arithmetic.c:183
lmmc_vec_dot
lmmc_status_t lmmc_vec_dot(const lmmc_vec_t *a, const lmmc_vec_t *b, lmmc_real_t *out_dot)
计算两个等长向量的内积: 。
定义
dense_products.c:228
lmmc_mat_gemv
lmmc_status_t lmmc_mat_gemv(lmmc_real_t alpha, const lmmc_mat_t *A, int transA, const lmmc_vec_t *x, lmmc_real_t beta, lmmc_vec_t *y)
通用矩阵-向量乘法(GEMV): 。
定义
dense_products.c:256
lmmc_mat_gemm
lmmc_status_t lmmc_mat_gemm(lmmc_real_t alpha, const lmmc_mat_t *A, int transA, const lmmc_mat_t *B, int transB, lmmc_real_t beta, lmmc_mat_t *C)
通用矩阵-矩阵乘法(GEMM): 。
定义
dense_products.c:185
lmmc_vec_iamax
lmmc_status_t lmmc_vec_iamax(const lmmc_vec_t *x, size_t *out_idx)
返回绝对值最大元素的下标。
定义
dense_arithmetic.c:106
lmmc_mat_norm_fro
lmmc_status_t lmmc_mat_norm_fro(const lmmc_mat_t *a, lmmc_real_t *out_norm)
计算矩阵的 Frobenius 范数: 。
定义
dense_arithmetic.c:14
lmmc_vec_asum
lmmc_status_t lmmc_vec_asum(const lmmc_vec_t *x, lmmc_real_t *out_asum)
计算向量元素绝对值之和(L1 范数): 。
定义
dense_arithmetic.c:83
lmmc_mat_sub
lmmc_status_t lmmc_mat_sub(const lmmc_mat_t *a, const lmmc_mat_t *b, lmmc_mat_t *c)
同维矩阵逐元素减法:c = a - b。
定义
dense_arithmetic.c:157
lmmc_mat_add
lmmc_status_t lmmc_mat_add(const lmmc_mat_t *a, const lmmc_mat_t *b, lmmc_mat_t *c)
同维矩阵逐元素加法:c = a + b。
定义
dense_arithmetic.c:131
lmmc_vec_axpy
lmmc_status_t lmmc_vec_axpy(lmmc_real_t alpha, const lmmc_vec_t *x, lmmc_vec_t *y)
向量 AXPY 运算: 。
定义
dense_products.c:287
lmmc_mat_vec_mul
lmmc_status_t lmmc_mat_vec_mul(const lmmc_mat_t *a, const lmmc_vec_t *x, lmmc_vec_t *y)
计算矩阵与向量的乘积:y = A * x。
定义
dense_products.c:283
lmmc_vec_scale
lmmc_status_t lmmc_vec_scale(lmmc_vec_t *x, lmmc_real_t alpha)
就地向量缩放: 。
定义
dense_arithmetic.c:67
lmmc_mat_norm1
lmmc_status_t lmmc_mat_norm1(const lmmc_mat_t *a, lmmc_real_t *out_norm)
计算矩阵的 1-范数(最大绝对列和): 。
定义
dense_arithmetic.c:245
lmmc_mat_mul
lmmc_status_t lmmc_mat_mul(const lmmc_mat_t *a, const lmmc_mat_t *b, lmmc_mat_t *c)
计算矩阵乘积:c = a * b。
定义
dense_products.c:224
lmmc_mat_norm_inf
lmmc_status_t lmmc_mat_norm_inf(const lmmc_mat_t *a, lmmc_real_t *out_norm)
计算矩阵的无穷范数(最大绝对行和): 。
定义
dense_arithmetic.c:283
lmmc_vec_norm2
lmmc_status_t lmmc_vec_norm2(const lmmc_vec_t *x, lmmc_real_t *out_norm)
计算向量的欧几里得(L2)范数: 。 采用缩放平方和累加;最终结果超出 binary64 范围时可为无穷。
定义
dense_arithmetic.c:32
lmmc_vec_norm_inf
lmmc_status_t lmmc_vec_norm_inf(const lmmc_vec_t *x, lmmc_real_t *out_norm)
计算向量的无穷范数: 。
定义
dense_arithmetic.c:47
lmmc_mat_trace
lmmc_status_t lmmc_mat_trace(const lmmc_mat_t *a, lmmc_real_t *out_trace)
计算方阵的迹: 。
定义
dense_arithmetic.c:222
dense_types.h
lmmc_mat_t
行优先存储的稠密矩阵。
定义
dense_types.h:18
lmmc_vec_t
一维稠密向量。
定义
dense_types.h:31
status.h
LMMC 通用状态码定义.
lmmc_status_t
lmmc_status_t
LMMC 库统一返回的状态码.
定义
status.h:22
lmmc
dense_arithmetic.h
生成于
, 为 LMMC使用
1.18.0