mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2025-07-12 14:54:10 +00:00
sprout/random/additive_combine.hpp 追加
sprout/random/additive_combine.hpp 追加
This commit is contained in:
parent
01a0ce4380
commit
ae589d7fc0
6 changed files with 301 additions and 20 deletions
|
@ -4,7 +4,6 @@
|
|||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <limits>
|
||||
#include <utility>
|
||||
#include <ios>
|
||||
#include <istream>
|
||||
#include <type_traits>
|
||||
|
@ -141,20 +140,11 @@ namespace sprout {
|
|||
shuffle_order_engine& rhs
|
||||
)
|
||||
{
|
||||
using std::swap;
|
||||
base_type rng;
|
||||
sprout::array<result_type, k> v;
|
||||
result_type y;
|
||||
lhs >> rng;
|
||||
lhs >> rhs.rng_;
|
||||
for (std::size_t i = 0; i < k; ++i) {
|
||||
lhs >> std::ws >> v[i];
|
||||
}
|
||||
lhs >> std::ws >> y;
|
||||
if (lhs) {
|
||||
swap(rhs.rng_, rng);
|
||||
swap(rhs.v_, v);
|
||||
swap(rhs.y_, y);
|
||||
lhs >> std::ws >> rhs.v_[i];
|
||||
}
|
||||
lhs >> std::ws >> rhs.y_;
|
||||
return lhs;
|
||||
}
|
||||
template<typename Elem, typename Traits>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue