Changeset 2fe861d in mainline
- Timestamp:
- 2018-07-05T21:41:22Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3f3514aa
- Parents:
- 1a617ac
- git-author:
- Dzejrou <dzejrou@…> (2018-05-02 15:44:18)
- git-committer:
- Dzejrou <dzejrou@…> (2018-07-05 21:41:22)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/cpp/include/impl/random.hpp
r1a617ac r2fe861d 117 117 : state_{} 118 118 { 119 seed(q); 120 } 121 122 void seed(result_type s = default_seed) 123 { 124 if (c % modulus_ == 0 && s == 0) 125 state_ = 0; 126 else 127 state_ = s; 128 } 129 130 template<class Seq> 131 void seed( 132 enable_if_t<aux::is_seed_sequence_v<Seq, result_type>, Seq&> q 133 ) 134 { 119 135 size_t k = static_cast<size_t>(aux::ceil(aux::log2(modulus_) / 32)); 120 136 auto arr = new result_type[k + 3]; … … 129 145 seed(s); 130 146 } 131 132 void seed(result_type s = default_seed)133 {134 if (c % modulus_ == 0 && s == 0)135 state_ = 0;136 else137 state_ = s;138 }139 140 template<class Seq>141 void seed(142 enable_if_t<aux::is_seed_sequence_v<Seq, result_type>, Seq&> q143 );144 147 145 148 result_type operator()()
Note:
See TracChangeset
for help on using the changeset viewer.