Optimize RNG use in std::sample selection sampling
authorEelis van der Weegen <eelis@eelis.net>
Fri, 21 Oct 2016 15:55:07 +0000 (15:55 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 21 Oct 2016 15:55:07 +0000 (16:55 +0100)
commit9d8ff2f63be0ec81f2d90da84ec8cd8e800dbfd4
tree49752c9df56fb28a1125efdb671cd7dd99f1aa2a
parent58f309637224d1f83a0649f66ae961df7a96a980
Optimize RNG use in std::sample selection sampling

2016-10-21  Eelis van der Weegen  <eelis@eelis.net>

* include/bits/stl_algo.h (__gen_two_uniform_ints): Move logic out
of shuffle into new function.
(shuffle): Call __gen_two_uniform_ints.
(__sample<ForwardIterator, OutputIterator, Cat, Size, URBG>): Use
__gen_two_uniform_ints and perform two samples at a time.

From-SVN: r241414
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_algo.h