Commit Graph

10 Commits

Author SHA1 Message Date
Ulrich Germann
9826599cb0 Enforce const-ness of command line arguments; bug fix in mosesserver.cpp. 2015-11-11 01:08:05 +00:00
Hieu Hoang
efdb8566b1 delete ChangeSource(). Not used 2015-06-02 21:00:32 +04:00
Hieu Hoang
cc8c6b7b10 beautify 2015-05-02 11:45:24 +01:00
Ulrich Germann
0d72cdd72c Merge branch 'master' of https://github.com/moses-smt/mosesdecoder into mmt-dev
Conflicts:
	moses/Syntax/F2S/Manager-inl.h
	moses/TranslationModel/UG/mmsapt.cpp
2015-04-26 02:12:16 +01:00
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
Ulrich Germann
9dc75bfd8a Managers and feature functions now have access to the entire TranslationTask, not just the InputType. 2015-03-26 18:25:54 +00:00
Ulrich Germann
8ca11d941d 1. Lifetime of tasks in ThreadPool is now managed via shared pointers.
2. Code cleanup in IOWrapper and a bit elsewhere.
2015-03-21 16:12:52 +00:00
Hieu Hoang
05ead45e71 beautify 2015-01-14 11:07:42 +00:00
Marcin Junczys-Dowmunt
c2b6da0134 small changes 2015-01-08 16:45:40 +01:00
Marcin Junczys-Dowmunt
558f0411c9 added skeleton for vwtrainer 2015-01-08 14:54:47 +01:00