mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-04 14:14:09 +00:00
add random::result, random::next
This commit is contained in:
parent
3879666b02
commit
769e18178a
23 changed files with 191 additions and 136 deletions
|
@ -18,7 +18,7 @@
|
|||
#include <sprout/utility/pair/pair.hpp>
|
||||
#include <sprout/algorithm/fixed/results.hpp>
|
||||
#include <sprout/algorithm/fixed/swap_element.hpp>
|
||||
#include <sprout/generator/functions.hpp>
|
||||
#include <sprout/random/result.hpp>
|
||||
#include <sprout/workaround/detail/uniform_int_distribution.hpp>
|
||||
|
||||
namespace sprout {
|
||||
|
@ -27,14 +27,14 @@ namespace sprout {
|
|||
template<typename Random>
|
||||
inline SPROUT_CONSTEXPR sprout::array<std::ptrdiff_t, 2>
|
||||
make_random_swap_indexes_2(Random const& rnd, std::ptrdiff_t i0) {
|
||||
return sprout::array<std::ptrdiff_t, 2>{{i0, sprout::generators::generated_value(rnd)}};
|
||||
return sprout::array<std::ptrdiff_t, 2>{{i0, sprout::random::result(rnd)}};
|
||||
}
|
||||
template<typename Random>
|
||||
inline SPROUT_CONSTEXPR sprout::array<std::ptrdiff_t, 2>
|
||||
make_random_swap_indexes_1(Random const& rnd) {
|
||||
return sprout::fixed::detail::make_random_swap_indexes_2(
|
||||
sprout::generators::next_generator(rnd)(),
|
||||
sprout::generators::generated_value(rnd)
|
||||
sprout::random::next(rnd)(),
|
||||
sprout::random::result(rnd)
|
||||
);
|
||||
}
|
||||
template<typename UniformRandomNumberGenerator>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue