diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2016-10-05 17:15:47 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2016-10-05 17:32:56 +0300 |
commit | 041b13eb19f364b79809a7efa08c4552d41d4e75 (patch) | |
tree | 44d8c9f2bd7a182ccd2591bf0deeba91fd07ff80 /moses/ScoreComponentCollection.h | |
parent | 2eea4dd5e0e369a43300298190c4b860c17d19ad (diff) |
compiles but segfault
Diffstat (limited to 'moses/ScoreComponentCollection.h')
-rw-r--r-- | moses/ScoreComponentCollection.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/moses/ScoreComponentCollection.h b/moses/ScoreComponentCollection.h index 1305e9c16..0ab57a73a 100644 --- a/moses/ScoreComponentCollection.h +++ b/moses/ScoreComponentCollection.h @@ -247,6 +247,15 @@ public: } } + void PlusEquals(const FeatureFunction* sp, float scores[]) + { + size_t numScores = sp->GetNumScoreComponents(); + size_t offset = sp->GetIndex(); + for (size_t i = 0; i < numScores; ++i) { + m_scores[i + offset] += scores[i]; + } + } + //! Special version PlusEquals(ScoreProducer, vector<float>) //! to add the score from a single ScoreProducer that produces //! a single value |