From b03d01f22df3c5e27014bf32748baacc10c7d360 Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Thu, 13 Oct 2011 23:50:28 +0200
Subject: fixed approx bleu
---
dtrain/score.h | 42 ++++++++++++++++++++----------------------
1 file changed, 20 insertions(+), 22 deletions(-)
(limited to 'dtrain/score.h')
diff --git a/dtrain/score.h b/dtrain/score.h
index 9af56ef9..85cd0317 100644
--- a/dtrain/score.h
+++ b/dtrain/score.h
@@ -17,7 +17,7 @@ struct NgramCounts
NgramCounts(const unsigned N) : N_(N) { Zero(); }
- void
+ inline void
operator+=(const NgramCounts& rhs)
{
assert(N_ == rhs.N_);
@@ -27,7 +27,7 @@ struct NgramCounts
}
}
- const NgramCounts
+ inline const NgramCounts
operator+(const NgramCounts &other) const
{
NgramCounts result = *this;
@@ -35,8 +35,8 @@ struct NgramCounts
return result;
}
- void
- Add(unsigned count, unsigned ref_count, unsigned i)
+ inline void
+ Add(const unsigned count, const unsigned ref_count, const unsigned i)
{
assert(i < N_);
if (count > ref_count) {
@@ -47,7 +47,7 @@ struct NgramCounts
sum[i] += count;
}
- void
+ inline void
Zero()
{
unsigned i;
@@ -57,7 +57,7 @@ struct NgramCounts
}
}
- void
+ inline void
Print()
{
for (unsigned i = 0; i < N_; i++) {
@@ -106,38 +106,36 @@ make_ngram_counts(const vector