mosesdecoder/moses/TranslationModel/UG/generic
Jeroen Vermeulen 38d790cac0 Add cross-platform randomizer module.
The code uses two mechanisms for generating random numbers: srand()/rand(),
which is not thread-safe, and srandom()/random(), which is POSIX-specific.

Here I add a util/random.cc module that centralizes these calls, and unifies
some common usage patterns.  If the implementation is not good enough, we can
now change it in a single place.

To keep things simple, this uses the portable srand()/rand() but protects them
with a lock to avoid concurrency problems.

The hard part was to keep the regression tests passing: they rely on fixed
sequences of random numbers, so a small code change could break them very
thoroughly.  Util::rand(), for wide types like size_t, calls std::rand() not
once but twice.  This behaviour was generalized into utils::wide_rand() and
friends.
2015-04-23 23:46:04 +07:00
..
file_io Using boost for prefix/suffix checks /Jeroen Vermeulen 2015-02-05 16:23:47 +00:00
program_options Major overhaul of Mmsapt. Reorganization of old and addition of new features in phrase tables. Many critical bug fixes. 2014-07-09 02:41:28 +01:00
sampling Add cross-platform randomizer module. 2015-04-23 23:46:04 +07:00
sorting move Uli's new pt into it's own folder. Comment out bjam compile. Doesn't work on MacOSX yet 2013-09-26 12:16:03 +01:00
stringdist Initial check-in. 2014-09-08 09:26:08 +01:00
threading Initial check-in. 2014-03-24 12:33:17 +00:00
Jamfile Added fakelib stringdist. 2014-09-08 09:26:08 +01:00