mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-05 02:22:21 +03:00
get ready to use Mempool with seen position
This commit is contained in:
parent
2cdbad5f2d
commit
654f2616e6
@ -65,8 +65,8 @@ std::ostream& operator<<(std::ostream &out, const CubeEdge &obj)
|
||||
bool
|
||||
CubeEdge::SeenPosition(const size_t x, const size_t y, SeenPositions &seenPositions) const
|
||||
{
|
||||
std::pair<const CubeEdge*, int> val(this, (x<<16) + y);
|
||||
boost::unordered_set< std::pair<const CubeEdge*, int> >::iterator iter = seenPositions.find(val);
|
||||
SeenPositionItem val(this, (x<<16) + y);
|
||||
boost::unordered_set<SeenPositionItem>::iterator iter = seenPositions.find(val);
|
||||
return (iter != seenPositions.end());
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ CubeEdge::SetSeenPosition(const size_t x, const size_t y, SeenPositions &seenPos
|
||||
//UTIL_THROW_IF2(x >= (1<<17), "Error");
|
||||
//UTIL_THROW_IF2(y >= (1<<17), "Error");
|
||||
|
||||
std::pair<const CubeEdge*, int> val(this, (x<<16) + y);
|
||||
SeenPositionItem val(this, (x<<16) + y);
|
||||
seenPositions.insert(val);
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,11 @@ public:
|
||||
typedef std::priority_queue<QueueItem*,
|
||||
std::vector<QueueItem*>,
|
||||
QueueItemOrderer> Queue;
|
||||
typedef boost::unordered_set< std::pair<const CubeEdge*, int> > SeenPositions;
|
||||
|
||||
typedef std::pair<const CubeEdge*, int> SeenPositionItem;
|
||||
typedef boost::unordered_set<SeenPositionItem,
|
||||
boost::hash<SeenPositionItem>,
|
||||
std::equal_to<SeenPositionItem> > SeenPositions;
|
||||
|
||||
const Hypotheses &hypos;
|
||||
const InputPath &path;
|
||||
|
Loading…
Reference in New Issue
Block a user