From c276ffbe01befa233fdef3910b6fa40e7d486977 Mon Sep 17 00:00:00 2001 From: hieu Date: Tue, 26 Sep 2017 12:53:49 +0100 Subject: Revert "use std::unordered_set instead of boost::unordered_set for all instances in moses2. To avoid confusion" This reverts commit 65c75ff0739ee2f88fc423ec1ad074e1b9b4a9b8. --- moses2/FF/StatefulFeatureFunction.h | 4 +++- moses2/FF/StatelessFeatureFunction.h | 4 +++- moses2/HypothesisColl.h | 1 + moses2/Main.cpp | 2 +- moses2/Phrase.h | 1 - moses2/PhraseBased/CubePruningMiniStack/Misc.h | 4 ++-- moses2/PhraseBased/CubePruningMiniStack/Search.cpp | 2 +- moses2/PhraseBased/CubePruningMiniStack/Stack.h | 1 + moses2/PhraseBased/Manager.cpp | 4 ++-- moses2/PhraseBased/Normal/Stack.h | 1 + moses2/SCFG/Misc.h | 4 ++-- moses2/SCFG/nbest/NBests.h | 4 ++-- moses2/defer/CubePruningBitmapStack/Misc.h | 3 ++- moses2/defer/CubePruningBitmapStack/Search.cpp | 2 +- moses2/defer/CubePruningBitmapStack/Stack.h | 3 ++- moses2/defer/CubePruningCardinalStack/Misc.h | 3 ++- moses2/defer/CubePruningCardinalStack/Search.cpp | 2 +- moses2/defer/CubePruningCardinalStack/Stack.h | 3 ++- moses2/defer/CubePruningPerBitmap/Misc.h | 3 ++- moses2/defer/CubePruningPerMiniStack/Misc.h | 3 ++- moses2/legacy/Bitmaps.h | 1 + moses2/legacy/FactorCollection.h | 4 ++-- 22 files changed, 36 insertions(+), 23 deletions(-) diff --git a/moses2/FF/StatefulFeatureFunction.h b/moses2/FF/StatefulFeatureFunction.h index c88eddead..7cb3eaae9 100644 --- a/moses2/FF/StatefulFeatureFunction.h +++ b/moses2/FF/StatefulFeatureFunction.h @@ -5,7 +5,8 @@ * Author: hieu */ -#pragma once +#ifndef STATEFULFEATUREFUNCTION_H_ +#define STATEFULFEATUREFUNCTION_H_ #include "FeatureFunction.h" #include "FFState.h" @@ -62,3 +63,4 @@ protected: } +#endif /* STATEFULFEATUREFUNCTION_H_ */ diff --git a/moses2/FF/StatelessFeatureFunction.h b/moses2/FF/StatelessFeatureFunction.h index 0ad0aaba4..249e4fdfe 100644 --- a/moses2/FF/StatelessFeatureFunction.h +++ b/moses2/FF/StatelessFeatureFunction.h @@ -5,7 +5,8 @@ * Author: hieu */ -#pragma once +#ifndef STATELESSFEATUREFUNCTION_H_ +#define STATELESSFEATUREFUNCTION_H_ #include "FeatureFunction.h" @@ -21,3 +22,4 @@ public: } +#endif /* STATELESSFEATUREFUNCTION_H_ */ diff --git a/moses2/HypothesisColl.h b/moses2/HypothesisColl.h index 0c89e8382..f00a2efb0 100644 --- a/moses2/HypothesisColl.h +++ b/moses2/HypothesisColl.h @@ -6,6 +6,7 @@ */ #pragma once #include +#include #include "HypothesisBase.h" #include "MemPoolAllocator.h" #include "Recycler.h" diff --git a/moses2/Main.cpp b/moses2/Main.cpp index dfdb9de3a..cf833760a 100644 --- a/moses2/Main.cpp +++ b/moses2/Main.cpp @@ -107,7 +107,7 @@ void Temp() Moses2::MemPool pool; Moses2::MemPoolAllocator a(pool); - std::unordered_set, std::equal_to, Moses2::MemPoolAllocator > s(a); + boost::unordered_set, std::equal_to, Moses2::MemPoolAllocator > s(a); s.insert(3); s.insert(4); s.insert(3); diff --git a/moses2/Phrase.h b/moses2/Phrase.h index a6f496184..100701483 100644 --- a/moses2/Phrase.h +++ b/moses2/Phrase.h @@ -7,7 +7,6 @@ #pragma once -#include #include #include #include diff --git a/moses2/PhraseBased/CubePruningMiniStack/Misc.h b/moses2/PhraseBased/CubePruningMiniStack/Misc.h index 8e746a83e..4fc576cba 100644 --- a/moses2/PhraseBased/CubePruningMiniStack/Misc.h +++ b/moses2/PhraseBased/CubePruningMiniStack/Misc.h @@ -7,7 +7,7 @@ #pragma once #include #include -#include +#include #include #include #include "../../legacy/Range.h" @@ -70,7 +70,7 @@ public: std::vector >, QueueItemOrderer> Queue; typedef std::pair SeenPositionItem; - typedef std::unordered_set, + typedef boost::unordered_set, std::equal_to, MemPoolAllocator > SeenPositions; const Hypotheses &hypos; diff --git a/moses2/PhraseBased/CubePruningMiniStack/Search.cpp b/moses2/PhraseBased/CubePruningMiniStack/Search.cpp index 785eff926..74103d211 100644 --- a/moses2/PhraseBased/CubePruningMiniStack/Search.cpp +++ b/moses2/PhraseBased/CubePruningMiniStack/Search.cpp @@ -110,7 +110,7 @@ void Search::Decode(size_t stackInd) /* cerr << "edges: "; - std::unordered_set uniqueBM; + boost::unordered_set uniqueBM; BOOST_FOREACH(CubeEdge *edge, edges) { uniqueBM.insert(&edge->newBitmap); //cerr << *edge << " "; diff --git a/moses2/PhraseBased/CubePruningMiniStack/Stack.h b/moses2/PhraseBased/CubePruningMiniStack/Stack.h index c3a14b222..abd564b3f 100644 --- a/moses2/PhraseBased/CubePruningMiniStack/Stack.h +++ b/moses2/PhraseBased/CubePruningMiniStack/Stack.h @@ -6,6 +6,7 @@ */ #pragma once #include +#include #include #include "../Hypothesis.h" #include "../../TypeDef.h" diff --git a/moses2/PhraseBased/Manager.cpp b/moses2/PhraseBased/Manager.cpp index 0a1f51dbd..28073d4f6 100644 --- a/moses2/PhraseBased/Manager.cpp +++ b/moses2/PhraseBased/Manager.cpp @@ -6,7 +6,7 @@ */ #include #include -#include +#include #include #include #include "Manager.h" @@ -218,7 +218,7 @@ std::string Manager::OutputNBest() { arcLists.Sort(); - std::unordered_set distinctHypos; + boost::unordered_set distinctHypos; TrellisPaths contenders; m_search->AddInitialTrellisPaths(contenders); diff --git a/moses2/PhraseBased/Normal/Stack.h b/moses2/PhraseBased/Normal/Stack.h index 62675a5c1..4ad707ce4 100644 --- a/moses2/PhraseBased/Normal/Stack.h +++ b/moses2/PhraseBased/Normal/Stack.h @@ -6,6 +6,7 @@ */ #pragma once +#include #include #include "../Hypothesis.h" #include "../../TypeDef.h" diff --git a/moses2/SCFG/Misc.h b/moses2/SCFG/Misc.h index 6eb107499..27b9df79a 100644 --- a/moses2/SCFG/Misc.h +++ b/moses2/SCFG/Misc.h @@ -7,7 +7,7 @@ #pragma once #include #include -#include +#include #include "../HypothesisColl.h" #include "../Vector.h" #include "Hypothesis.h" @@ -60,7 +60,7 @@ public: protected: - typedef std::unordered_set, UnorderedComparer > Coll; Coll m_coll; }; diff --git a/moses2/SCFG/nbest/NBests.h b/moses2/SCFG/nbest/NBests.h index 7cddec1be..97fe9a025 100644 --- a/moses2/SCFG/nbest/NBests.h +++ b/moses2/SCFG/nbest/NBests.h @@ -6,7 +6,7 @@ */ #pragma once -#include +#include #include "NBest.h" namespace Moses2 @@ -18,7 +18,7 @@ class NBests { public: Contenders contenders; - std::unordered_set distinctHypos; + boost::unordered_set distinctHypos; NBests(const SCFG::Manager &mgr, const ArcList &arcList, diff --git a/moses2/defer/CubePruningBitmapStack/Misc.h b/moses2/defer/CubePruningBitmapStack/Misc.h index e0acdcd1a..355f8f4c2 100644 --- a/moses2/defer/CubePruningBitmapStack/Misc.h +++ b/moses2/defer/CubePruningBitmapStack/Misc.h @@ -7,6 +7,7 @@ #pragma once #include #include +#include #include #include #include "../../legacy/Range.h" @@ -71,7 +72,7 @@ public: QueueItemOrderer> Queue; typedef std::pair SeenPositionItem; - typedef std::unordered_set, std::equal_to > SeenPositions; diff --git a/moses2/defer/CubePruningBitmapStack/Search.cpp b/moses2/defer/CubePruningBitmapStack/Search.cpp index 19e247796..8c06f1340 100644 --- a/moses2/defer/CubePruningBitmapStack/Search.cpp +++ b/moses2/defer/CubePruningBitmapStack/Search.cpp @@ -96,7 +96,7 @@ void Search::Decode(size_t stackInd) /* cerr << "edges: "; - std::unordered_set uniqueBM; + boost::unordered_set uniqueBM; BOOST_FOREACH(CubeEdge *edge, edges) { uniqueBM.insert(&edge->newBitmap); //cerr << *edge << " "; diff --git a/moses2/defer/CubePruningBitmapStack/Stack.h b/moses2/defer/CubePruningBitmapStack/Stack.h index b4d6ee1be..f052fab42 100644 --- a/moses2/defer/CubePruningBitmapStack/Stack.h +++ b/moses2/defer/CubePruningBitmapStack/Stack.h @@ -6,6 +6,7 @@ */ #pragma once #include +#include #include #include "../Hypothesis.h" #include "../../TypeDef.h" @@ -26,7 +27,7 @@ typedef Vector Hypotheses; class MiniStack { public: - typedef std::unordered_set, UnorderedComparer > _HCType; diff --git a/moses2/defer/CubePruningCardinalStack/Misc.h b/moses2/defer/CubePruningCardinalStack/Misc.h index d04c299d1..9f5d28f1e 100644 --- a/moses2/defer/CubePruningCardinalStack/Misc.h +++ b/moses2/defer/CubePruningCardinalStack/Misc.h @@ -7,6 +7,7 @@ #pragma once #include #include +#include #include #include #include "../../legacy/Range.h" @@ -71,7 +72,7 @@ public: QueueItemOrderer> Queue; typedef std::pair SeenPositionItem; - typedef std::unordered_set, std::equal_to > SeenPositions; diff --git a/moses2/defer/CubePruningCardinalStack/Search.cpp b/moses2/defer/CubePruningCardinalStack/Search.cpp index 6f72a53f8..23cae74eb 100644 --- a/moses2/defer/CubePruningCardinalStack/Search.cpp +++ b/moses2/defer/CubePruningCardinalStack/Search.cpp @@ -96,7 +96,7 @@ void Search::Decode(size_t stackInd) /* cerr << "edges: "; - std::unordered_set uniqueBM; + boost::unordered_set uniqueBM; BOOST_FOREACH(CubeEdge *edge, edges) { uniqueBM.insert(&edge->newBitmap); //cerr << *edge << " "; diff --git a/moses2/defer/CubePruningCardinalStack/Stack.h b/moses2/defer/CubePruningCardinalStack/Stack.h index 06ca54a57..94e987b7b 100644 --- a/moses2/defer/CubePruningCardinalStack/Stack.h +++ b/moses2/defer/CubePruningCardinalStack/Stack.h @@ -6,6 +6,7 @@ */ #pragma once #include +#include #include #include "../Hypothesis.h" #include "../../TypeDef.h" @@ -28,7 +29,7 @@ typedef Vector Hypotheses; class Stack { protected: - typedef std::unordered_set, UnorderedComparer > _HCType; diff --git a/moses2/defer/CubePruningPerBitmap/Misc.h b/moses2/defer/CubePruningPerBitmap/Misc.h index 6a17e66a3..3fa22f9a6 100644 --- a/moses2/defer/CubePruningPerBitmap/Misc.h +++ b/moses2/defer/CubePruningPerBitmap/Misc.h @@ -7,6 +7,7 @@ #pragma once #include #include +#include #include #include #include "../../legacy/Range.h" @@ -71,7 +72,7 @@ public: QueueItemOrderer> Queue; typedef std::pair SeenPositionItem; - typedef std::unordered_set, std::equal_to > SeenPositions; diff --git a/moses2/defer/CubePruningPerMiniStack/Misc.h b/moses2/defer/CubePruningPerMiniStack/Misc.h index 7b48e31bd..511fd42f5 100644 --- a/moses2/defer/CubePruningPerMiniStack/Misc.h +++ b/moses2/defer/CubePruningPerMiniStack/Misc.h @@ -7,6 +7,7 @@ #pragma once #include #include +#include #include #include #include "../../legacy/Range.h" @@ -71,7 +72,7 @@ public: QueueItemOrderer> Queue; typedef std::pair SeenPositionItem; - typedef std::unordered_set, std::equal_to > SeenPositions; diff --git a/moses2/legacy/Bitmaps.h b/moses2/legacy/Bitmaps.h index f07318f93..aa0ea8f82 100644 --- a/moses2/legacy/Bitmaps.h +++ b/moses2/legacy/Bitmaps.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include #include diff --git a/moses2/legacy/FactorCollection.h b/moses2/legacy/FactorCollection.h index fb6a646f4..1b29dee69 100644 --- a/moses2/legacy/FactorCollection.h +++ b/moses2/legacy/FactorCollection.h @@ -31,7 +31,7 @@ #endif #include "util/murmur_hash.hh" -#include +#include #include #include @@ -82,7 +82,7 @@ class FactorCollection return left.in.GetString() == right.in.GetString(); } }; - typedef std::unordered_set Set; + typedef boost::unordered_set Set; Set m_set; Set m_setNonTerminal; -- cgit v1.2.3