#include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <span>
#include <type_traits>
#include <utility>
#include <vector>
#include "clustering/ndarray.h"
Go to the source code of this file.
|
| std::uint64_t | clustering::math::advanceState (pcg64 &rng) noexcept |
| | Advance a pcg64 one step and return the 64-bit XSL-RR output.
|
| std::uint64_t | clustering::math::advanceState (xoshiro256ss &rng) noexcept |
| | Advance a xoshiro256ss one step and return the 64-bit output.
|
| template<class Rng> |
| std::uint32_t | clustering::math::randUniformU32 (Rng &rng) noexcept |
| | Draw a 32-bit unsigned integer uniformly at random from the full u32 range.
|
| template<class Rng> |
| std::uint64_t | clustering::math::randUniformU64 (Rng &rng) noexcept |
| | Draw a 64-bit unsigned integer uniformly at random from the full u64 range.
|
| template<class T, class Rng> |
| T | clustering::math::randUnit (Rng &rng) noexcept |
| | Draw a uniform variate in the half-open unit interval [0, 1).
|
| template<class T, Layout L, class Rng> |
| std::size_t | clustering::math::weightedCategorical (const NDArray< T, 1, L > &weights, Rng &rng) noexcept |
| | Sample one category index proportionally to non-negative weights.
|
| template<class T, Layout L, class Rng> |
| void | clustering::math::aExpjReservoir (const NDArray< T, 1, L > &weights, std::size_t k, Rng &rng, std::span< std::size_t > outIdx) noexcept |
| | Efraimidis-Spirakis weighted reservoir sampling (A-Exp variant, log-key form).
|