Moses, the machine translation system
Go to file
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
biconcor Unify tokenize() into util, and unit-test it. 2015-04-22 09:59:05 +07:00
contrib Add cross-platform randomizer module. 2015-04-23 23:46:04 +07:00
cruise-control changes for cruise control 2013-05-10 16:34:57 +01:00
defer delete External FF. FF framework changes too fast to be able to keep this up-to-date 2015-03-31 19:45:59 +04:00
doc Replaced content by pointer to online documentation. 2014-08-04 17:20:33 +01:00
jam-files Check for MinGW using __MINGW32__, not MINGW. 2015-03-23 22:35:03 +07:00
lm Less error-like complaint when substituting fallback discounts / Matthias Huck 2015-03-31 21:51:38 -04:00
mert Add cross-platform randomizer module. 2015-04-23 23:46:04 +07:00
mingw windows gui code 2014-01-24 11:12:03 +00:00
misc Modernize "C" includes in misc. 2015-03-28 20:18:39 +07:00
moses Add cross-platform randomizer module. 2015-04-23 23:46:04 +07:00
moses-cmd Add cross-platform randomizer module. 2015-04-23 23:46:04 +07:00
OnDiskPt delete typedefs for UINT32 and UINT64. MSVC now has uint32_t and uint64_t /Ken 2015-03-25 00:55:39 +00:00
phrase-extract Remove conflicting definition of isNonTerminal. 2015-04-22 10:43:15 +07:00
regression-testing run-test-{extract|mert|misc|scorer}.perl now log the command line executed for the specific test. 2015-02-09 23:00:04 +00:00
scripts use ignore-unless /Philipp Koehn 2015-04-22 23:02:57 +04:00
search Modernize "C" includes in search. 2015-03-28 19:48:20 +07:00
symal create file stream and delete it at the end if user has specified a file for input & output 2015-04-16 00:50:54 +04:00
util Add cross-platform randomizer module. 2015-04-23 23:46:04 +07:00
vw Using boost for prefix/suffix checks /Jeroen Vermeulen 2015-02-05 16:23:47 +00:00
.gitignore Update .gitignore. 2014-11-14 14:28:33 +00:00
.gitmodules Arrow pipeline submodules now use https protocol. 2013-07-24 11:52:14 +01:00
bjam Fix cd error when running bjam from non-top 2013-03-19 11:17:17 +00:00
BUILD-INSTRUCTIONS.txt test 2014-12-22 15:55:27 +05:30
Jamroot delete External FF. FF framework changes too fast to be able to keep this up-to-date 2015-03-31 19:45:59 +04:00