LMMC binary real type and arithmetic spelling.
double lmmc_real_t
Public and internal LMMC real type.
lmmc_status_t lmmc_rng_long_jump(lmmc_rng_t *rng)
将 RNG 状态前进 2^192 步(xoshiro256** long_jump 多项式)。
lmmc_status_t lmmc_rng_jump(lmmc_rng_t *rng)
将 RNG 状态前进 2^128 步(xoshiro256** jump 多项式)。
lmmc_status_t lmmc_rng_student_t(lmmc_rng_t *rng, lmmc_real_t df, lmmc_real_t *out)
生成 Student-t 分布样本 t(df)。
lmmc_status_t lmmc_rng_normal(lmmc_rng_t *rng, lmmc_real_t mean, lmmc_real_t stddev, lmmc_real_t *out_value)
生成正态分布 样本。
lmmc_status_t lmmc_rng_clone(const lmmc_rng_t *src, lmmc_rng_t **out_rng)
深拷贝 RNG 状态。
lmmc_status_t lmmc_rng_chi_squared(lmmc_rng_t *rng, lmmc_real_t df, lmmc_real_t *out)
生成卡方分布样本 Chi-squared(df)。
lmmc_status_t lmmc_rng_poisson(lmmc_rng_t *rng, lmmc_real_t lambda, size_t *out)
生成 Poisson 分布样本 。
lmmc_status_t lmmc_rng_exponential(lmmc_rng_t *rng, lmmc_real_t rate, lmmc_real_t *out_value)
生成参数为 rate 的指数分布样本。
lmmc_status_t lmmc_rng_int_uniform(lmmc_rng_t *rng, int64_t lo, int64_t hi, int64_t *out)
在 [lo, hi] 闭区间内生成无偏均匀整数分布样本。
lmmc_status_t lmmc_rng_create(lmmc_rng_t **out_rng)
创建随机数发生器实例。
lmmc_status_t lmmc_rng_f(lmmc_rng_t *rng, lmmc_real_t df1, lmmc_real_t df2, lmmc_real_t *out)
生成 F 分布样本 F(df1, df2)。
lmmc_status_t lmmc_rng_uniform(lmmc_rng_t *rng, lmmc_real_t a, lmmc_real_t b, lmmc_real_t *out_value)
实数分布参数的公共约束。
lmmc_status_t lmmc_rng_gamma(lmmc_rng_t *rng, lmmc_real_t shape, lmmc_real_t scale, lmmc_real_t *out)
生成 Gamma 分布样本 。
lmmc_status_t lmmc_rng_binomial(lmmc_rng_t *rng, size_t n, lmmc_real_t p, size_t *out)
生成二项分布样本 Binomial(n, p)。
lmmc_status_t lmmc_rng_shuffle(lmmc_rng_t *rng, void *array, size_t count, size_t elem_size)
Fisher-Yates 洗牌:就地随机重排 array 中的 count 个元素。 每次 Fisher-Yates 选择均使用无偏的拒绝采样。
lmmc_status_t lmmc_rng_fill_uniform(lmmc_rng_t *rng, lmmc_real_t a, lmmc_real_t b, lmmc_real_t *array, size_t count)
批量填充均匀分布样本到 array 。
uint64_t lmmc_rng_next_u64(lmmc_rng_t *rng)
直接获取下一个 64 位均匀整数。
void lmmc_rng_destroy(lmmc_rng_t *rng)
销毁发生器,释放内部分配的所有内存。
lmmc_status_t lmmc_rng_beta(lmmc_rng_t *rng, lmmc_real_t alpha, lmmc_real_t beta_param, lmmc_real_t *out)
生成 Beta 分布样本 Beta(alpha, beta)。
lmmc_status_t lmmc_rng_seed(lmmc_rng_t *rng, uint64_t seed)
重新设定种子。
lmmc_status_t
LMMC 库统一返回的状态码.