LMMP 4.3.0
Lamina High-Precision Arithmetic Library
载入中...
搜索中...
未找到
mat22_mul.h 文件参考
#include "lmmp/lmmpn.h"
mat22_mul.h 的引用(Include)关系图:
此图展示该文件被哪些文件直接或间接地引用了:

浏览该文件的源代码.

结构体

struct  lmmp_mat22_t
 Copyright (C) 2026 HJimmyK (Jericho Knox) 更多...

函数

void lmmp_mat22_mul_ (lmmp_mat22_t *dst, const lmmp_mat22_t *a, const lmmp_mat22_t *b, mp_ptr tp)
 计算 D <- A*B(2x2 非负矩阵乘法)
void lmmp_mat22_sqr_ (lmmp_mat22_t *dst, const lmmp_mat22_t *a, mp_ptr tp)
 计算 D <- A*A(2x2 非负矩阵平方)

结构体说明

◆ lmmp_mat22_t

struct lmmp_mat22_t

Copyright (C) 2026 HJimmyK (Jericho Knox)

This file is part of LMMP.

LMMP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library. If not, see https://www.gnu.org/licenses/.

SPDX-License-Identifier: LGPL-3.0-or-later

在文件 mat22_mul.h 第 44 行定义.

lmmp_mat22_t 的协作图:
成员变量
mp_size_t n[2][2]
mp_ptr p[2][2]

函数说明

◆ lmmp_mat22_mul_()

void lmmp_mat22_mul_ ( lmmp_mat22_t * dst,
const lmmp_mat22_t * a,
const lmmp_mat22_t * b,
mp_ptr tp )

计算 D <- A*B(2x2 非负矩阵乘法)

参数
dst结果矩阵,各个元素结果写入 dst->p 中的数组,对应实际长度被写入到 dst->n 中
a左矩阵(元素长度为 a->n[i][j],可与 dst 别名,即支持 D <- D*B)
b右矩阵(元素长度为 b->n[i][j],不可与 dst 别名)
tp临时空间(8*(mx(a)+mx(b))+16 个limb)
警告
dst!=NULL, a!=NULL, b!=NULL, tp!=NULL, sep(dst,b), eqsep(dst,a), dst 各元素缓冲容量至少为 mx(a)+mx(b)+4

在文件 mat22_mul.c 第 496 行定义.

496 {
497 lmmp_param_assert(dst != NULL && a != NULL && b != NULL && tp != NULL);
499 mat22_mul_strassen_(dst, a, b, tp);
500 } else {
501 mat22_mul_basecase_(dst, a, b, tp);
502 }
503}
#define lmmp_param_assert(x)
定义 lmmp.h:509
static int mat22_all_big_(const lmmp_mat22_t *x, mp_size_t th)
static void mat22_mul_strassen_(lmmp_mat22_t *dst, const lmmp_mat22_t *a, const lmmp_mat22_t *b, mp_ptr tp)
计算 D <- A*B(2x2 非负矩阵 Winograd-Strassen 乘法,7 次大数乘)
static void mat22_mul_basecase_(lmmp_mat22_t *dst, const lmmp_mat22_t *a, const lmmp_mat22_t *b, mp_ptr tp)
计算 D <- A*B(2x2 非负矩阵朴素乘法)
#define tp
#define MAT22_MUL_STRASSEN_THRESHOLD

引用了 lmmp_mat22_mul_(), lmmp_param_assert, mat22_all_big_(), mat22_mul_basecase_(), mat22_mul_strassen_(), MAT22_MUL_STRASSEN_THRESHOLD , 以及 tp.

被这些函数引用 lmmp_hgcd_matrix_mul_() , 以及 lmmp_mat22_mul_().

函数调用图:
这是这个函数的调用关系图:

◆ lmmp_mat22_sqr_()

void lmmp_mat22_sqr_ ( lmmp_mat22_t * dst,
const lmmp_mat22_t * a,
mp_ptr tp )

计算 D <- A*A(2x2 非负矩阵平方)

参数
dst结果矩阵,各个元素结果写入 dst->p 中的数组,对应实际长度被写入到 dst->n 中
a源矩阵(元素长度为 a->n[i][j],可与 dst 别名)
tp临时空间(15*mx(a)+14 个limb)
警告
dst!=NULL, a!=NULL, tp!=NULL, eqsep(dst,a), dst 元素缓冲容量 >= 2*mx(a)+4

在文件 mat22_mul.c 第 505 行定义.

505 {
506 lmmp_param_assert(dst != NULL && a != NULL && tp != NULL);
508 mat22_sqr_strassen_(dst, a, tp);
509 } else {
510 mat22_sqr_basecase_(dst, a, tp);
511 }
512}
static void mat22_sqr_strassen_(lmmp_mat22_t *dst, const lmmp_mat22_t *a, mp_ptr tp)
计算 D <- A*A(2x2 非负矩阵 Winograd-Strassen 平方,7 次大数乘中 4 次为平方)
static void mat22_sqr_basecase_(lmmp_mat22_t *dst, const lmmp_mat22_t *a, mp_ptr tp)
计算 D <- A*A(2x2 非负矩阵朴素平方,5 次大数乘)
#define MAT22_SQR_STRASSEN_THRESHOLD

引用了 lmmp_mat22_sqr_(), lmmp_param_assert, mat22_all_big_(), mat22_sqr_basecase_(), mat22_sqr_strassen_(), MAT22_SQR_STRASSEN_THRESHOLD , 以及 tp.

被这些函数引用 lmmp_mat22_sqr_().

函数调用图:
这是这个函数的调用关系图: