16#include "../../../include/lammp/impl/ele_mul.h"
17#include "../../../include/lammp/impl/mparam.h"
19#define INSERTION_SORT_THRESHOLD 16
38 while (j >=
low &&
arr[j].nn > nn) {
121 while (
k < (2 *
n - 1)) {
124 if (
i <
n && (j >=
k ||
arr[
i].nn <=
arr[j].nn)) {
130 if (
i <
n && (j >=
k ||
arr[
i].nn <=
arr[j].nn)) {
147 if (
ht->root[
ridx].left == -1) {
160 n1 -=
dst[
n1 - 1] == 0 ? 1 : 0;
173 rn -=
dst[
rn - 1] == 0 ? 1 : 0;
185 n -=
dst[
n - 1] == 0 ? 1 : 0;
#define INSERTION_SORT_THRESHOLD
Copyright (C) 2026 HJimmyK(Jericho Knox)
mp_size_t lmmp_huff_tree_mul_(huff_tree *restrict ht, sint ridx, mp_ptr restrict dst, mp_ptr restrict tp)
sint lmmp_huff_tree_build_(huff_tree *restrict ht)
static void insertion_sort(huff_node arr[], sint low, sint high)
在闭区间 [low, high] 上进行插入排序
static void quicksort_rec(huff_node arr[], sint low, sint high)
递归的三路快速排序,对闭区间 [low, high] 排序
static sint median_of_three(const huff_node arr[], sint a, sint b, sint c)
返回 arr[a]、arr[b]、arr[c] 三个索引中对应值的中位数的索引
mp_size_t lmmp_elem_mul_ulong_(mp_ptr restrict dst, const ulongp restrict limbs, mp_size_t n, mp_ptr restrict tp)
static void swap_huff_node(huff_node *a, huff_node *b)
Copyright (C) 2026 HJimmyK(Jericho Knox)
#define lmmp_copy(dst, src, n)
#define lmmp_debug_assert(x)
const mp_limb_t * mp_srcptr
#define lmmp_param_assert(x)
void lmmp_mul_(mp_ptr dst, mp_srcptr numa, mp_size_t na, mp_srcptr numb, mp_size_t nb)
不等长大数乘法操作 [dst,na+nb] = [numa,na] * [numb,nb]
mp_limb_t lmmp_mul_1_(mp_ptr dst, mp_srcptr numa, mp_size_t na, mp_limb_t x)
大数乘以单limb操作 [dst,na] = [numa,na] * x
#define ELEM_MUL_BASECASE_THRESHOLD