From 381c3f64d8a8d397a4d6488c80e241a919682307 Mon Sep 17 00:00:00 2001 From: mliska Date: Tue, 21 Oct 2014 11:44:31 +0200 Subject: [PATCH] std::unordered_set replaces std::set for m_seenPosition. --- moses/BitmapContainer.cpp | 2 +- moses/BitmapContainer.h | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/moses/BitmapContainer.cpp b/moses/BitmapContainer.cpp index 061a5953f..fd6fc1cd0 100644 --- a/moses/BitmapContainer.cpp +++ b/moses/BitmapContainer.cpp @@ -223,7 +223,7 @@ Hypothesis *BackwardsEdge::CreateHypothesis(const Hypothesis &hypothesis, const bool BackwardsEdge::SeenPosition(const size_t x, const size_t y) { - std::set< int >::iterator iter = m_seenPosition.find((x<<16) + y); + boost::unordered_set< int >::iterator iter = m_seenPosition.find((x<<16) + y); return (iter != m_seenPosition.end()); } diff --git a/moses/BitmapContainer.h b/moses/BitmapContainer.h index 51f1659ef..500059081 100644 --- a/moses/BitmapContainer.h +++ b/moses/BitmapContainer.h @@ -33,6 +33,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include "TypeDef.h" #include "WordsBitmap.h" +#include + namespace Moses { @@ -165,7 +167,7 @@ private: const SquareMatrix &m_futurescore; std::vector< const Hypothesis* > m_hypotheses; - std::set< int > m_seenPosition; + boost::unordered_set< int > m_seenPosition; // We don't want to instantiate "empty" objects. BackwardsEdge();