|
LMMP 4.3.0
Lamina High-Precision Arithmetic Library
|
函数 | |
| mp_size_t | lmmp_gcdext_2_ (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) |
| Copyright (C) 2026 HJimmyK (Jericho Knox) | |
| mp_size_t lmmp_gcdext_2_ | ( | 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 ) |
Copyright (C) 2026 HJimmyK (Jericho Knox)
扩展欧几里得(任意长度对双 limb):g = gcd([up,un],[vp,2]),s*u + t*v = g
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
Copyright (C) 2026 HJimmyK (Jericho Knox)
| dstg | 结果指针(长度至少为 2 个limb) |
| dsts | u 的贝祖系数幅度(长度至少为 2 个limb,s==0 时写 0) |
| sn | 输出 s 的带符号 limb 长度 |
| dstt | v 的贝祖系数幅度(长度至少为 un 个limb,可为 NULL) |
| tn | 输出 t 的带符号 limb 长度(dstt==NULL 时忽略) |
| up | 第一个无符号整数指针 |
| un | 第一个无符号整数的 limb 长度 |
| vp | 第二个无符号整数指针(长度为 2) |
在文件 gcdext_2.c 第 40 行定义.
引用了 BALLOC_TYPE, lmmp_add_(), lmmp_copy, lmmp_debug_assert, lmmp_div_(), lmmp_gcdext_2_(), lmmp_gcdext_lehmer_(), lmmp_mod_2_(), lmmp_mul_(), lmmp_param_assert, lmmp_sub_(), TEMP_B_DECL, TEMP_B_FREE , 以及 xn.
被这些函数引用 lmmp_gcdext_(), lmmp_gcdext_2_() , 以及 TEST_CASE().