|
LMMP 4.3.0
Lamina High-Precision Arithmetic Library
|
结构体 | |
| struct | sco_t |
| Copyright (C) 2026 HJimmyK (Jericho Knox) 更多... | |
函数 | |
| static void | lc1_ (sco_t *dst, slong al, mp_srcptr x, mp_size_t xn, slong be, mp_srcptr y, mp_size_t yn) |
| dst = al*x + be*y(x,y 为非负幅度;al,be 为带符号标量,|al|,|be| < 2^63) | |
| mp_size_t | lmmp_gcdext_lehmer_ (mp_ptr dstg, mp_ptr dsts, mp_ssize_t *sn, mp_ptr dstt, mp_ssize_t *tn, mp_srcptr up, mp_size_t un, mp_srcptr vp, mp_size_t vn) |
| 扩展欧几里得(Lehmer 算法):g = gcd(u,v),s*u + t*v = g | |
| static int | mag_cmp_ (mp_srcptr x, mp_size_t xn, mp_srcptr y, mp_size_t yn) |
| static void | pool_free2_ (int ia, int ib, int *f1, int *f2) |
| struct sco_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
在文件 gcdext_lehmer.c 第 82 行定义.
| 成员变量 | ||
|---|---|---|
| mp_size_t | n | |
| int | neg | |
| mp_ptr | p | |
|
static |
dst = al*x + be*y(x,y 为非负幅度;al,be 为带符号标量,|al|,|be| < 2^63)
| dst | 输出槽(容量 >= max(xn,yn)+2;与 x,y 缓冲分离) |
在文件 gcdext_lehmer.c 第 104 行定义.
引用了 lc1_(), lmmp_add_1_(), lmmp_addmul_1_(), lmmp_debug_assert, lmmp_mul_1_(), lmmp_sub_1_(), lmmp_submul_1_(), LMMP_SWAP, lmmp_zero, sco_t::n, sco_t::neg, sco_t::p , 以及 xn.
被这些函数引用 lc1_() , 以及 lmmp_gcdext_lehmer_().
| mp_size_t lmmp_gcdext_lehmer_ | ( | mp_ptr | dstg, |
| mp_ptr | dsts, | ||
| mp_ssize_t * | sn, | ||
| mp_ptr | dstt, | ||
| mp_ssize_t * | tn, | ||
| mp_srcptr | up, | ||
| mp_size_t | un, | ||
| mp_srcptr | vp, | ||
| mp_size_t | vn ) |
扩展欧几里得(Lehmer 算法):g = gcd(u,v),s*u + t*v = g
| dstg | 结果指针(长度至少为 min(un,vn)) |
| dsts | u 的贝祖系数幅度(长度至少为 vn 个limb,s==0 时写 0) |
| sn | 输出 s 的带符号 limb 长度([1|-1|0]) |
| dstt | v 的贝祖系数幅度(长度至少为 un 个limb,可为 NULL 表示不需要) |
| tn | 输出 t 的带符号 limb 长度(dstt==NULL 时忽略,可为 NULL) |
| up | 第一个无符号整数指针 |
| un | 第一个无符号整数的 limb 长度 |
| vp | 第二个无符号整数指针 |
| vn | 第二个无符号整数的 limb 长度 |
在文件 gcdext_lehmer.c 第 209 行定义.
引用了 an, BALLOC_TYPE, bn, lc1_(), lmmp_cmp_(), lmmp_copy, lmmp_debug_assert, lmmp_div_(), lmmp_gcd_lehmer_extract_(), lmmp_gcd_lehmer_step_(), lmmp_gcdext_1_(), lmmp_gcdext_emit_(), lmmp_gcdext_lehmer_(), lmmp_gcdext_smag_(), lmmp_mul_(), lmmp_mul_1_(), lmmp_param_assert, lmmp_sub_(), LMMP_SWAP, lmmp_gcd_lehmer_t::m11, lmmp_gcd_lehmer_t::m12, lmmp_gcd_lehmer_t::m21, lmmp_gcd_lehmer_t::m22, mag_cmp_(), sco_t::n, sco_t::neg, sco_t::p, pool_free2_(), TEMP_B_DECL , 以及 TEMP_B_FREE.
被这些函数引用 lmmp_gcdext_(), lmmp_gcdext_2_(), lmmp_gcdext_hgcd_() , 以及 lmmp_gcdext_lehmer_().
在文件 gcdext_lehmer.c 第 88 行定义.
引用了 lmmp_cmp_(), mag_cmp_() , 以及 xn.
被这些函数引用 lmmp_gcdext_lehmer_() , 以及 mag_cmp_().
|
static |
在文件 gcdext_lehmer.c 第 194 行定义.
引用了 pool_free2_().
被这些函数引用 lmmp_gcdext_lehmer_() , 以及 pool_free2_().