|
LAMMP 4.2.0
Lamina High-Precision Arithmetic Library
|
#include "../../../include/lammp/mprand.h"#include "../../../include/lammp/impl/rand_state.h"#include "../../../include/lammp/impl/tmp_alloc.h"
mprand.c 的引用(Include)关系图:结构体 | |
| struct | lmmp_global_rng_t |
| Copyright (C) 2026 HJimmyK(Jericho Knox) 更多... | |
| struct | lmmp_strong_rng_t |
宏定义 | |
| #define | GLOBAL_RNG_INIT_SEED_TYPE 1 |
| #define | GLOBAL_RNG_INIT_STATE 10451216379200822465ULL |
类型定义 | |
| typedef struct lmmp_strong_rng_t | lmmp_strong_rng_t |
函数 | |
| void | lmmp_global_rng_init_ (int seed, int seed_type) |
| Copyright (C) 2026 HJimmyK(Jericho Knox) | |
| mp_size_t | lmmp_random_ (mp_ptr restrict dst, mp_size_t n) |
| mp_size_t | lmmp_seed_random_ (mp_ptr restrict dst, mp_size_t n, mp_limb_t seed, int seed_type) |
| mp_size_t | lmmp_strong_random_ (mp_ptr restrict dst, mp_size_t n, lmmp_strong_rng_t *rng) |
| void | lmmp_strong_rng_extern_ (lmmp_strong_rng_t *rng, mp_size_t k) |
| 将rng内部状态拓展至k维度 | |
| void | lmmp_strong_rng_free_ (lmmp_strong_rng_t *rng) |
| 销毁强随机数生成器 | |
| lmmp_strong_rng_t * | lmmp_strong_rng_init_ (mp_size_t k, int seed) |
| 创建k维度强随机数生成器 | |
变量 | |
| static _Thread_local lmmp_global_rng_t | lmmp_global_rng = { 10451216379200822465ULL , 1 } |
| struct lmmp_global_rng_t |
Copyright (C) 2026 HJimmyK(Jericho Knox)
This file is part of LAMMP.
LAMMP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed WITHOUT ANY WARRANTY.
lmmp_global_rng_t 的协作图:| 成员变量 | ||
|---|---|---|
| int | seed_type | |
| mp_limb_t | state | |
| struct lmmp_strong_rng_t |
| void lmmp_global_rng_init_ | ( | int | seed, |
| int | seed_type | ||
| ) |
Copyright (C) 2026 HJimmyK(Jericho Knox)
This file is part of LAMMP.
LAMMP is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed WITHOUT ANY WARRANTY.
See https://www.gnu.org/licenses/.
初始化全局随机数生成器
| seed | 种子 |
| seed_type | 随机数发生器类型(0:pcg64_128,1:xoshiro256++) |
引用了 lmmp_global_rng, lmmp_seed_generator(), n, lmmp_global_rng_t::seed_type , 以及 lmmp_global_rng_t::state.
函数调用图:引用了 lmmp_global_rng, lmmp_seed_generator(), lmmp_seed_random_(), n, rotl(), lmmp_global_rng_t::seed_type , 以及 lmmp_global_rng_t::state.
函数调用图:引用了 lmmp_pcg64_128_random(), lmmp_pcg64_128_srandom(), lmmp_xoshiro256pp_random(), lmmp_xoshiro256pp_srandom() , 以及 n.
被这些函数引用 lmmp_random_().
函数调用图:
这是这个函数的调用关系图:| mp_size_t lmmp_strong_random_ | ( | mp_ptr restrict | dst, |
| mp_size_t | n, | ||
| lmmp_strong_rng_t * | rng | ||
| ) |
引用了 lmmp_param_assert, n , 以及 pcg64_le_seq_next().
函数调用图:| void lmmp_strong_rng_extern_ | ( | lmmp_strong_rng_t * | rng, |
| mp_size_t | k | ||
| ) |
将rng内部状态拓展至k维度
| rng | 强随机数生成器指针 |
| k | 随机数长度(单位:limb) |
引用了 k, lmmp_param_assert, lmmp_realloc(), lmmp_seed_generator(), n, pcg64_le_seq_init() , 以及 rotl().
函数调用图:| void lmmp_strong_rng_free_ | ( | lmmp_strong_rng_t * | rng | ) |
| lmmp_strong_rng_t * lmmp_strong_rng_init_ | ( | mp_size_t | k, |
| int | seed | ||
| ) |
创建k维度强随机数生成器
| k | 随机数长度(单位:limb) |
| seed | 种子 |
引用了 ALLOC_TYPE, pcg64_le_seq_t::k, k, lmmp_alloc(), lmmp_param_assert, lmmp_seed_generator(), n, pcg64_le_seq_init(), rotl() , 以及 lmmp_strong_rng_t::stream.
函数调用图:
|
static |
被这些函数引用 lmmp_global_rng_init_() , 以及 lmmp_random_().