|
LMMP 4.3.0
Lamina High-Precision Arithmetic Library
|
#include <math.h>#include "numth/ele_mul.h"#include "impl/inlines.h"#include "impl/longlong.h"#include "mparam.h"#include "impl/prime_table.h"#include "lmmp/numth.h"结构体 | |
| struct | bino_choose_t |
宏定义 | |
| #define | div_1(dst, rn, v) |
| #define | mul_1(dst, rn, v) |
函数 | |
| static uint | count_factors (fac_ptr fac, uint nfactors, uint n, uint r, uint nr, uint p) |
| static uint | factor_size_int (mp_size_t rn, uint n) |
| static ushort | factor_size_short (mp_size_t rn) |
| mp_size_t | lmmp_nCr_ (mp_ptr restrict dst, mp_bitcnt_t bits, mp_size_t rn, uint n, uint r) |
| mp_size_t | lmmp_nCr_size_ (uint n, uint r, mp_bitcnt_t *restrict bits) |
| Copyright (C) 2026 HJimmyK (Jericho Knox) | |
| static mp_size_t | lmmp_odd_factorial_ (mp_ptr restrict dst, mp_size_t rn, uint n) |
| static mp_size_t | lmmp_odd_nCr_div_ (mp_ptr restrict dst, mp_size_t rn, bino_choose_t *restrict ctx) |
| mp_size_t | lmmp_odd_nCr_uint_ (mp_ptr restrict dst, mp_size_t rn, uint n, uint r) |
| mp_size_t | lmmp_odd_nCr_ushort_ (mp_ptr restrict dst, mp_size_t rn, uint n, uint r) |
| static mp_size_t | lmmp_odd_nPr_product_ (mp_ptr restrict dst, mp_size_t rn, uint n, uint r) |
| 使用累乘函数计算nPr(奇数部分) | |
| struct bino_choose_t |
| 成员变量 | ||
|---|---|---|
| mp_bitcnt_t | fac_bits | |
| mp_size_t | fac_n | |
| uint | n | |
| mp_bitcnt_t | nPr_bits | |
| mp_size_t | nPr_n | |
| uint | r | |
| #define div_1 | ( | dst, | |
| rn, | |||
| v ) |
被这些函数引用 lmmp_odd_nCr_uint_() , 以及 lmmp_odd_nCr_ushort_().
| #define mul_1 | ( | dst, | |
| rn, | |||
| v ) |
引用了 _udiv32by32_q_preinv, count_factors(), fac_t::f, fac_t::j, MP_ULONG_MAX , 以及 n.
引用了 factor_size_int(), lmmp_debug_assert, lmmp_prime_size_(), MP_UINT_MAX , 以及 n.
引用了 factor_size_short(), lmmp_debug_assert , 以及 MP_USHORT_MAX.
引用了 LIMB_BITS, lmmp_nCr_(), lmmp_odd_nCr_uint_(), lmmp_odd_nCr_ushort_(), lmmp_param_assert, lmmp_shl_(), lmmp_zero, n, NCR_SHORT_LIMIT , 以及 restrict.
| mp_size_t lmmp_nCr_size_ | ( | uint | n, |
| uint | r, | ||
| mp_bitcnt_t *restrict | bits ) |
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
引用了 LIMB_BITS, lmmp_limb_popcnt_, lmmp_nCr_size_(), lmmp_param_assert, lmmp_pow_1_size_(), MP_UINT_MAX, n, ODD_FACTORIAL_SIZE , 以及 restrict.
引用了 lmmp_odd_factorial_(), lmmp_odd_factorial_uint_(), lmmp_odd_nPr_ushort_(), n, NPR_SHORT_LIMIT , 以及 restrict.
被这些函数引用 lmmp_odd_factorial_() , 以及 lmmp_odd_nCr_div_().
|
static |
引用了 LIMB_BITS, lmmp_debug_assert, lmmp_divexact_(), lmmp_odd_factorial_(), lmmp_odd_nCr_div_(), lmmp_odd_nPr_product_(), lmmp_param_assert, restrict, TALLOC_TYPE, TEMP_DECL , 以及 TEMP_FREE.
被这些函数引用 lmmp_odd_nCr_div_() , 以及 lmmp_odd_nCr_uint_().
引用了 BALLOC_TYPE, BINOMIAL_DIV_B_THRESHOLD, BINOMIAL_DIV_K_THRESHOLD, BINOMIAL_RN_BASECASE_THRESHOLD, count_factors(), ctz_shr_u64, div_1, bino_choose_t::fac_bits, bino_choose_t::fac_n, factor_size_int(), prime_cache_t::is_end, lmmp_factorial_size_(), lmmp_factors_mul_(), lmmp_nPr_size_(), lmmp_odd_nCr_div_(), lmmp_odd_nCr_uint_(), lmmp_param_assert, lmmp_prime_cache_free_(), lmmp_prime_cache_init_(), lmmp_prime_cache_next_(), lmmp_prime_int_table_init_(), mul_1, bino_choose_t::n, n, bino_choose_t::nPr_bits, bino_choose_t::nPr_n, prime_cache_t::pp, bino_choose_t::r, restrict, prime_cache_t::size, t, TEMP_B_DECL , 以及 TEMP_B_FREE.
引用了 BINOMIAL_RN_BASECASE_THRESHOLD, count_factors(), ctz_shr_u64, div_1, factor_size_short(), lmmp_factors_mul_ushort_(), lmmp_odd_nCr_ushort_(), lmmp_odd_nPr_ushort_(), lmmp_param_assert, lmmp_prime_cnt16_(), MP_USHORT_MAX, mul_1, n, ODD_FACTORIAL_SIZE, prime_short_table, restrict, t, TALLOC_TYPE, TEMP_DECL , 以及 TEMP_FREE.
使用累乘函数计算nPr(奇数部分)
引用了 ctz_shr_u32, k, lmmp_copy, lmmp_elem_mul_ulong_(), lmmp_odd_nPr_product_(), MP_UINT_MAX, n, restrict, t, TALLOC_TYPE, TEMP_DECL, TEMP_FREE , 以及 tp.
被这些函数引用 lmmp_odd_nCr_div_(), lmmp_odd_nPr_product_(), lmmp_odd_nPr_product_(), lmmp_odd_nPr_uint_() , 以及 lmmp_odd_nPr_ushort_().