|
LMMP 4.3.0
Lamina High-Precision Arithmetic Library
|
结构体 | |
| struct | lehmer_stack_t |
| Copyright (C) 2026 HJimmyK (Jericho Knox) 更多... | |
宏定义 | |
| #define | A (M->m11) |
| #define | an un |
| #define | an (*an) |
| #define | B (M->m12) |
| #define | bn vn |
| #define | bn (*bn) |
| #define | C (M->m21) |
| #define | D (M->m22) |
函数 | |
| mp_size_t | lmmp_gcd_lehmer_ (mp_ptr dst, mp_srcptr up, mp_size_t un, mp_srcptr vp, mp_size_t vn) |
| 计算两个无符号整数的最大公约数(Lehmer算法) | |
| static bool | lmmp_lehmer_mul_ (mp_ptr a, mp_size_t *an, mp_ptr b, mp_size_t *bn, lmmp_gcd_lehmer_t *M, lehmer_stack_t *ms) |
| / a \ = / A B \ * / a \ \ b / \ C D / \ b / | |
| static mp_size_t | lmmp_lehmer_sub_mag_ (mp_ptr dst, mp_srcptr x, mp_size_t xn, mp_srcptr y, mp_size_t yn) |
| dst = |x - y|(大数减法取绝对值),返回归一化长度 | |
| struct lehmer_stack_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
在文件 gcd_lehmer.c 第 30 行定义.
| 成员变量 | ||
|---|---|---|
| mp_size_t | mn | |
| mp_ptr | mp | |
| mp_size_t | nn | |
| mp_ptr | np | |
| mp_size_t | tn | |
| mp_ptr | tp | |
| #define A (M->m11) |
| #define an un |
| #define an (*an) |
被这些函数引用 check_floor(), lmmp_gcd_hgcd_(), lmmp_gcd_lehmer_(), lmmp_gcd_mul_(), lmmp_gcdext_lehmer_(), lmmp_hgcd_apply_mod_(), lmmp_hgcd_step_(), lmmp_lehmer_mul_(), lmmp_sqr_toom4_(), mod_eq(), mod_is_diff(), mod_is_product(), mod_is_sum(), mpn_cmp(), mpn_eq(), mrs_mul_core_(), mrs_sqr_core_(), nthroot_cmp_ext_(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE() , 以及 TEST_CASE().
| #define B (M->m12) |
| #define bn vn |
| #define bn (*bn) |
被这些函数引用 ipn_notrial_i_(), lmmp_arith_seqprod_(), lmmp_bninv_(), lmmp_gcd_hgcd_(), lmmp_gcd_lehmer_(), lmmp_gcd_mul_(), lmmp_gcdext_lehmer_(), lmmp_hgcd_apply_mod_(), lmmp_hgcd_step_(), lmmp_lehmer_mul_(), mod_eq(), mod_is_diff(), mod_is_product(), mod_is_sum(), mpn_cmp(), mpn_eq(), mrs_mul_core_(), nthroot_cmp_ext_(), nthroot_pow_trunc_(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE() , 以及 TEST_CASE().
| #define C (M->m21) |
| #define D (M->m22) |
计算两个无符号整数的最大公约数(Lehmer算法)
| dst | 结果指针(长度至少为 min(un,vn)) |
| up | 第一个无符号整数指针 |
| un | 第一个无符号整数的 limb 长度 |
| vp | 第二个无符号整数指针 |
| vn | 第二个无符号整数的 limb 长度 |
在文件 gcd_lehmer.c 第 159 行定义.
引用了 an, BALLOC_TYPE, bn, lmmp_cmp_(), lmmp_copy, lmmp_div_(), lmmp_gcd_11_(), lmmp_gcd_1_(), lmmp_gcd_lehmer_(), lmmp_gcd_lehmer_extract_(), lmmp_gcd_lehmer_step_(), lmmp_lehmer_mul_(), lmmp_param_assert, LMMP_SWAP, lmmp_gcd_lehmer_t::m21, lehmer_stack_t::mp, lehmer_stack_t::np, TEMP_B_DECL, TEMP_B_FREE , 以及 lehmer_stack_t::tp.
被这些函数引用 bench_gcd_lehmer(), lmmp_divexact_(), lmmp_gcd_(), lmmp_gcd_hgcd_(), lmmp_gcd_lehmer_(), run_gcdext_pair(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE() , 以及 TEST_CASE().
|
static |
/ a \ = / A B \ * / a \ \ b / \ C D / \ b /
在文件 gcd_lehmer.c 第 74 行定义.
引用了 A, an, B, bn, C, D, lmmp_copy, lmmp_debug_assert, lmmp_lehmer_mul_(), lmmp_lehmer_sub_mag_(), lmmp_mul_1_(), lehmer_stack_t::mn, lehmer_stack_t::mp, lehmer_stack_t::nn, lehmer_stack_t::np, lehmer_stack_t::tn , 以及 lehmer_stack_t::tp.
被这些函数引用 lmmp_gcd_lehmer_() , 以及 lmmp_lehmer_mul_().
|
static |
dst = |x - y|(大数减法取绝对值),返回归一化长度
在文件 gcd_lehmer.c 第 43 行定义.
引用了 lmmp_cmp_(), lmmp_lehmer_sub_mag_(), lmmp_sub_() , 以及 xn.
被这些函数引用 lmmp_lehmer_mul_() , 以及 lmmp_lehmer_sub_mag_().