8 #ifndef SIG_UTIL_SHUFFLE_HPP
9 #define SIG_UTIL_SHUFFLE_HPP
11 #include "../sigutil.hpp"
12 #include "../tools/random.hpp"
33 std::random_shuffle(
std::begin(container),
std::end(container), [&](std::ptrdiff_t
max){
return static_cast<std::ptrdiff_t
>(myrand() *
max); });
43 template <
class C,
class It,
class... Its>
47 std::unordered_map<uint, typename It::value_type>
map;
49 for (uint i=0; i<loop; ++i, ++iter){
52 for (uint i = 0; i < loop; ++i, ++ori_iter){
75 template <
class... Cs>
78 uint size =
min(containers.size()...);
C make_unique_numbers(uint n, int min, int max, bool debug)
重複の無い一様分布の整数乱数を生成
auto end(C &&c) -> std::move_iterator< typename RC::iterator >
void shuffle(C &container)
コンテナの要素をシャッフル
void shuffle_impl(uint loop, C const &seq)
初期化時に指定した範囲の一様分布乱数を発生させるクラス
auto map(F &&func, C &&list)
1引数高階関数
auto begin(C &&c) -> std::move_iterator< typename RC::iterator >