8 #ifndef TRSL_COMMON_HPP
9 #define TRSL_COMMON_HPP
19 #define TRSL_VERSION "0.2.2"
27 #define TRSL_VERSION_NR 100020200
38 T operator() (
const T& t)
44 template<
typename RandomAccessIterator,
typename RandomNumberGenerator>
45 void partial_random_shuffle(RandomAccessIterator first,
46 RandomAccessIterator middle,
47 RandomAccessIterator last,
48 RandomNumberGenerator &rg)
53 for (RandomAccessIterator i = first; i != middle; ++i)
55 std::iter_swap(i, i + rg(last - i));
70 #ifdef TRSL_USE_BSD_BETTER_RANDOM_GENERATOR
81 template<
typename Real>
84 #ifdef TRSL_USE_BSD_BETTER_RANDOM_GENERATOR
85 return (::random() / (RAND_MAX+Real(1.0)));
87 return (std::rand() / (RAND_MAX+Real(1.0)));
94 #endif // include guard