| 38 | // size - 1 samples are used. |
| 39 | template <class Iter, class Random> |
| 40 | static inline void RandomShuffle(Iter first, Iter last, Random& uniform) { |
| 41 | if (first == last) return; |
| 42 | const auto stop = last - 1; |
| 43 | for (auto i = first; i != stop; ++i) { |
| 44 | using std::iter_swap; |
| 45 | iter_swap(i, i + uniform(last - i)); |
| 46 | } |
| 47 | } |
| 48 | |
| 49 | template <class IntT, class InT, class OutT, class Random> |
| 50 | static void IndexedShuffle(const int64 size, const InT& input_mat, |
no outgoing calls
no test coverage detected