diff options
author | hieu <hieu@UNKNOWN.Home> | 2017-09-26 14:53:49 +0300 |
---|---|---|
committer | hieu <hieu@UNKNOWN.Home> | 2017-09-26 14:53:49 +0300 |
commit | c276ffbe01befa233fdef3910b6fa40e7d486977 (patch) | |
tree | ce9b15ac744e49b0fb18ad353a2d2cd169570785 | |
parent | 65c75ff0739ee2f88fc423ec1ad074e1b9b4a9b8 (diff) |
Revert "use std::unordered_set instead of boost::unordered_set for all instances in moses2. To avoid confusion"
This reverts commit 65c75ff0739ee2f88fc423ec1ad074e1b9b4a9b8.
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 <unordered_set> +#include <boost/unordered_set.hpp> #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<int> a(pool); - std::unordered_set<int, boost::hash<int>, std::equal_to<int>, Moses2::MemPoolAllocator<int> > s(a); + boost::unordered_set<int, boost::hash<int>, std::equal_to<int>, Moses2::MemPoolAllocator<int> > 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 <boost/functional/hash.hpp> #include <cstddef> #include <string> #include <sstream> 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 <boost/pool/pool_alloc.hpp> #include <boost/unordered_map.hpp> -#include <unordered_set> +#include <boost/unordered_set.hpp> #include <vector> #include <queue> #include "../../legacy/Range.h" @@ -70,7 +70,7 @@ public: std::vector<QueueItem*, MemPoolAllocator<QueueItem*> >, QueueItemOrderer> Queue; typedef std::pair<const CubeEdge*, int> SeenPositionItem; - typedef std::unordered_set<SeenPositionItem, boost::hash<SeenPositionItem>, + typedef boost::unordered_set<SeenPositionItem, boost::hash<SeenPositionItem>, std::equal_to<SeenPositionItem>, MemPoolAllocator<SeenPositionItem> > 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<const Bitmap*> uniqueBM; + boost::unordered_set<const Bitmap*> 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 <boost/unordered_map.hpp> +#include <boost/unordered_set.hpp> #include <deque> #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 <boost/foreach.hpp> #include <boost/functional/hash.hpp> -#include <unordered_set> +#include <boost/unordered_set.hpp> #include <vector> #include <sstream> #include "Manager.h" @@ -218,7 +218,7 @@ std::string Manager::OutputNBest() { arcLists.Sort(); - std::unordered_set<size_t> distinctHypos; + boost::unordered_set<size_t> distinctHypos; TrellisPaths<TrellisPath> 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 <boost/unordered_set.hpp> #include <deque> #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 <vector> #include <queue> -#include <unordered_set> +#include <boost/unordered_set.hpp> #include "../HypothesisColl.h" #include "../Vector.h" #include "Hypothesis.h" @@ -60,7 +60,7 @@ public: protected: - typedef std::unordered_set<const SeenPosition*, + typedef boost::unordered_set<const SeenPosition*, UnorderedComparer<SeenPosition>, UnorderedComparer<SeenPosition> > 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 <unordered_set> +#include <boost/unordered_set.hpp> #include "NBest.h" namespace Moses2 @@ -18,7 +18,7 @@ class NBests { public: Contenders contenders; - std::unordered_set<size_t> distinctHypos; + boost::unordered_set<size_t> 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 <boost/pool/pool_alloc.hpp> #include <boost/unordered_map.hpp> +#include <boost/unordered_set.hpp> #include <vector> #include <queue> #include "../../legacy/Range.h" @@ -71,7 +72,7 @@ public: QueueItemOrderer> Queue; typedef std::pair<const CubeEdge*, int> SeenPositionItem; - typedef std::unordered_set<SeenPositionItem, + typedef boost::unordered_set<SeenPositionItem, boost::hash<SeenPositionItem>, std::equal_to<SeenPositionItem> > 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<const Bitmap*> uniqueBM; + boost::unordered_set<const Bitmap*> 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 <boost/unordered_map.hpp> +#include <boost/unordered_set.hpp> #include <deque> #include "../Hypothesis.h" #include "../../TypeDef.h" @@ -26,7 +27,7 @@ typedef Vector<const Hypothesis*> Hypotheses; class MiniStack { public: - typedef std::unordered_set<const Hypothesis*, + typedef boost::unordered_set<const Hypothesis*, UnorderedComparer<Hypothesis>, UnorderedComparer<Hypothesis> > _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 <boost/pool/pool_alloc.hpp> #include <boost/unordered_map.hpp> +#include <boost/unordered_set.hpp> #include <vector> #include <queue> #include "../../legacy/Range.h" @@ -71,7 +72,7 @@ public: QueueItemOrderer> Queue; typedef std::pair<const CubeEdge*, int> SeenPositionItem; - typedef std::unordered_set<SeenPositionItem, + typedef boost::unordered_set<SeenPositionItem, boost::hash<SeenPositionItem>, std::equal_to<SeenPositionItem> > 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<const Bitmap*> uniqueBM; + boost::unordered_set<const Bitmap*> 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 <boost/unordered_map.hpp> +#include <boost/unordered_set.hpp> #include <deque> #include "../Hypothesis.h" #include "../../TypeDef.h" @@ -28,7 +29,7 @@ typedef Vector<const Hypothesis*> Hypotheses; class Stack { protected: - typedef std::unordered_set<const Hypothesis*, + typedef boost::unordered_set<const Hypothesis*, UnorderedComparer<Hypothesis>, UnorderedComparer<Hypothesis> > _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 <boost/pool/pool_alloc.hpp> #include <boost/unordered_map.hpp> +#include <boost/unordered_set.hpp> #include <vector> #include <queue> #include "../../legacy/Range.h" @@ -71,7 +72,7 @@ public: QueueItemOrderer> Queue; typedef std::pair<const CubeEdge*, int> SeenPositionItem; - typedef std::unordered_set<SeenPositionItem, + typedef boost::unordered_set<SeenPositionItem, boost::hash<SeenPositionItem>, std::equal_to<SeenPositionItem> > 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 <boost/pool/pool_alloc.hpp> #include <boost/unordered_map.hpp> +#include <boost/unordered_set.hpp> #include <vector> #include <queue> #include "../../legacy/Range.h" @@ -71,7 +72,7 @@ public: QueueItemOrderer> Queue; typedef std::pair<const CubeEdge*, int> SeenPositionItem; - typedef std::unordered_set<SeenPositionItem, + typedef boost::unordered_set<SeenPositionItem, boost::hash<SeenPositionItem>, std::equal_to<SeenPositionItem> > 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 <boost/unordered_set.hpp> #include <boost/unordered_map.hpp> #include <set> #include <stack> 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 <unordered_set> +#include <boost/unordered_set.hpp> #include <functional> #include <string> @@ -82,7 +82,7 @@ class FactorCollection return left.in.GetString() == right.in.GetString(); } }; - typedef std::unordered_set<FactorFriend, HashFactor, EqualsFactor> Set; + typedef boost::unordered_set<FactorFriend, HashFactor, EqualsFactor> Set; Set m_set; Set m_setNonTerminal; |