mosesdecoder/moses/TranslationModel/DynSAInclude
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
..
fdstream.h move DynSAInclude to TranslationModel/ 2012-11-27 16:16:30 +00:00
FileHandler.cpp Don't work around missing popen() in MinGW. 2015-04-22 11:24:32 +07:00
FileHandler.h replace CHECK with UTIL_THROW_IF in Moses 2013-11-20 18:18:02 +00:00
hash.h Add cross-platform randomizer module. 2015-04-23 23:46:04 +07:00
Jamfile move Score3Parser to TranslationModel/ 2012-11-27 17:09:23 +00:00
onlineRLM.h Fix some clang++ warnings. 2015-04-07 22:58:17 +07:00
params.cpp merged master into dynamic-models and solved conflicts 2014-12-13 12:52:47 +01:00
params.h delete includes for util/check.hh 2013-11-21 18:58:28 +00:00
perfectHash.h replace CHECK with UTIL_THROW_IF in Moses 2013-11-21 13:38:30 +00:00
quantizer.h beautify 2014-01-15 16:49:57 +01:00
RandLMCache.h beautify 2013-05-29 18:16:15 +01:00
RandLMFilter.h beautify 2014-01-15 16:49:57 +01:00
types.h moses windows build, with some TODO list 2013-12-18 20:15:39 +00:00
utils.h Add cross-platform randomizer module. 2015-04-23 23:46:04 +07:00
vocab.cpp beautify 2014-01-15 16:49:57 +01:00
vocab.h UTIL_THROW_IF -> UTIL_THROW_IF2 2013-11-22 20:27:46 +00:00