LMMP 4.3.0
Lamina High-Precision Arithmetic Library
载入中...
搜索中...
未找到
strong_lucas.c 文件参考
#include "prime_pool.h"
strong_lucas.c 的引用(Include)关系图:

浏览该文件的源代码.

函数

static double bench_is_strong_lucas (mp_size_t n, PrimePool kind, const bench_options *o)
 Copyright (C) 2026 HJimmyK (Jericho Knox)
int main (void)
static void run_strong_lucas (void)

函数说明

◆ bench_is_strong_lucas()

double bench_is_strong_lucas ( mp_size_t n,
PrimePool kind,
const bench_options * o )
static

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

在文件 strong_lucas.c 第 25 行定义.

25 {
26 int cnt = pool_cnt(n);
27 mp_ptr a = pool_n(n, cnt, 0x51ce77ac02ull + n, kind);
28 size_t idx = 0;
29 double us;
30 BENCH_MEASURE(us, o, bench_sink += (mp_limb_t)lmmp_is_strong_lucas_(a + n * (idx++ % cnt), n););
31 lmmp_free(a);
32 return us;
33}
mp_limb_t * mp_ptr
定义 lmmp.h:96
void lmmp_free(void *ptr)
内存释放函数(调用lmmp_heap_free_fn)
uint64_t mp_limb_t
定义 lmmp.h:92
#define n
int lmmp_is_strong_lucas_(mp_srcptr np, mp_size_t nn)
强 Lucas-Selfridge 测试(大于 128 位)
#define BENCH_MEASURE(result, options,...)
定义 perf.h:93

引用了 bench_is_strong_lucas(), BENCH_MEASURE, lmmp_free(), lmmp_is_strong_lucas_() , 以及 n.

被这些函数引用 bench_is_strong_lucas() , 以及 run_strong_lucas().

函数调用图:
这是这个函数的调用关系图:

◆ main()

int main ( void )

在文件 strong_lucas.c 第 43 行定义.

43 {
44 setvbuf(stdout, NULL, _IONBF, 0);
46 puts("[numth/prime/strong_lucas]");
49 return 0;
50}
void lmmp_global_init(void)
全局初始化函数(线程局部的)
void lmmp_global_deinit(void)
全局释放函数(线程局部的)
static void run_strong_lucas(void)

引用了 lmmp_global_deinit(), lmmp_global_init(), main() , 以及 run_strong_lucas().

函数调用图:

◆ run_strong_lucas()

void run_strong_lucas ( void )
static

在文件 strong_lucas.c 第 35 行定义.

35 {
36 const mp_size_t SZ[] = {3, 8, 16, 32, 64, 200};
37 for (size_t i = 0; i < ARRAY_SIZE(SZ); ++i) {
38 mp_size_t n = SZ[i];
39 report_n("strong_lucas coprime", n, bench_is_strong_lucas(n, PRIME_POOL_COPRIME, &bench_default), 0);
40 }
41}
uint64_t mp_size_t
定义 lmmp.h:93
#define ARRAY_SIZE(a)
Copyright (C) 2026 HJimmyK (Jericho Knox)
定义 perf.h:40
@ PRIME_POOL_COPRIME
static double bench_is_strong_lucas(mp_size_t n, PrimePool kind, const bench_options *o)
Copyright (C) 2026 HJimmyK (Jericho Knox)

引用了 ARRAY_SIZE, bench_is_strong_lucas(), n, PRIME_POOL_COPRIME , 以及 run_strong_lucas().

被这些函数引用 main() , 以及 run_strong_lucas().

函数调用图:
这是这个函数的调用关系图: