| 1 |
/* SPDX-License-Identifier: BSL-1.0 OR BSD-3-Clause */ |
| 2 |
|
| 3 |
#ifndef MPT_RANDOM_DEFAULT_ENGINES_HPP |
| 4 |
#define MPT_RANDOM_DEFAULT_ENGINES_HPP |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
#include "mpt/base/detect.hpp" |
| 9 |
#include "mpt/base/integer.hpp" |
| 10 |
#include "mpt/base/namespace.hpp" |
| 11 |
#include "mpt/random/engine.hpp" |
| 12 |
#include "mpt/random/engine_lcg.hpp" |
| 13 |
|
| 14 |
#include <random> |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
namespace mpt { |
| 19 |
inline namespace MPT_INLINE_NS { |
| 20 |
|
| 21 |
|
| 22 |
using deterministic_fast_engine = mpt::lcg_msvc; |
| 23 |
using deterministic_good_engine = mpt::lcg_musl; |
| 24 |
|
| 25 |
// We cannot use std::minstd_rand here because it has not a power-of-2 sized |
| 26 |
// output domain which we rely upon. |
| 27 |
using fast_engine = mpt::lcg_msvc; // about 3 ALU operations, ~32bit of state, suited for inner loops |
| 28 |
using good_engine = std::ranlux48; |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
} // namespace MPT_INLINE_NS |
| 33 |
} // namespace mpt |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
#endif // MPT_RANDOM_DEFAULT_ENGINES_HPP |