Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Huck <huck@i6.informatik.rwth-aachen.de>2015-04-23 20:14:40 +0300
committerMatthias Huck <huck@i6.informatik.rwth-aachen.de>2015-04-23 20:14:40 +0300
commitbbcc8bf23bf922ccc9375c4cc8ec309c360da6a9 (patch)
tree687efcf6b5ff489207cdf781f8b2556c7df29eac /moses/Manager.cpp
parentf24f31f965abd3b3e02b48f7aaaf17a8003a4b8f (diff)
parent38d790cac0f21de9ff8951dce0bb5d522ad46c0d (diff)
Merge branch 'master' of https://github.com/moses-smt/mosesdecoder
Diffstat (limited to 'moses/Manager.cpp')
-rw-r--r--moses/Manager.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/moses/Manager.cpp b/moses/Manager.cpp
index c46183b11..78e66b472 100644
--- a/moses/Manager.cpp
+++ b/moses/Manager.cpp
@@ -54,6 +54,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#endif
#include "util/exception.hh"
+#include "util/random.hh"
using namespace std;
@@ -418,7 +419,7 @@ void Manager::CalcLatticeSamples(size_t count, TrellisPathList &ret) const
//cerr << endl;
//draw the sample
- float frandom = log((float)rand()/RAND_MAX);
+ const float frandom = log(util::rand_incl(0.0f, 1.0f));
size_t position = 1;
float sum = candidateScores[0];
for (; position < candidateScores.size() && sum < frandom; ++position) {