mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
don't use bitmap& for bitmap container. Seems to slow down for single thread
This commit is contained in:
parent
814b917c9b
commit
b4bffedfcd
@ -277,9 +277,11 @@ BackwardsEdge::PushSuccessors(const size_t x, const size_t y)
|
||||
// BitmapContainer Code
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
BitmapContainer::BitmapContainer(HypothesisStackCubePruning &stack
|
||||
, bool deterministic)
|
||||
: m_stack(stack)
|
||||
BitmapContainer::BitmapContainer(const WordsBitmap &bitmap
|
||||
, HypothesisStackCubePruning &stack
|
||||
, bool deterministic)
|
||||
: m_bitmap(bitmap)
|
||||
, m_stack(stack)
|
||||
, m_deterministic(deterministic)
|
||||
, m_numStackInsertions(0)
|
||||
{
|
||||
|
@ -202,7 +202,7 @@ public:
|
||||
class BitmapContainer
|
||||
{
|
||||
private:
|
||||
const WordsBitmap *m_bitmap;
|
||||
const WordsBitmap m_bitmap;
|
||||
HypothesisStackCubePruning &m_stack;
|
||||
HypothesisSet m_hypotheses;
|
||||
BackwardsEdgeSet m_edges;
|
||||
@ -214,7 +214,8 @@ private:
|
||||
BitmapContainer();
|
||||
BitmapContainer(const BitmapContainer &);
|
||||
public:
|
||||
BitmapContainer(HypothesisStackCubePruning &stack
|
||||
BitmapContainer(const WordsBitmap &bitmap
|
||||
, HypothesisStackCubePruning &stack
|
||||
, bool deterministic_sort = false);
|
||||
|
||||
// The destructor will also delete all the edges that are
|
||||
@ -229,11 +230,7 @@ public:
|
||||
|
||||
const WordsBitmap &GetWordsBitmap() const
|
||||
{
|
||||
return *m_bitmap;
|
||||
}
|
||||
void SetWordsBitmap(const WordsBitmap &bitmap)
|
||||
{
|
||||
m_bitmap = &bitmap;
|
||||
return m_bitmap;
|
||||
}
|
||||
|
||||
const HypothesisSet &GetHypotheses() const;
|
||||
|
@ -299,14 +299,8 @@ BitmapContainer *HypothesisStackCubePruning::AddBitmapContainer(const WordsBitma
|
||||
|
||||
BitmapContainer *bmContainer;
|
||||
if (iter == m_bitmapAccessor.end()) {
|
||||
bmContainer = new BitmapContainer(stack, m_deterministic);
|
||||
_BMType::value_type element(bitmap, bmContainer);
|
||||
pair<_BMType::iterator,bool> retPair = m_bitmapAccessor.insert(element);
|
||||
|
||||
_BMType::iterator &iterRetPair = retPair.first;
|
||||
const WordsBitmap &storedBitmap = iterRetPair->first;
|
||||
|
||||
bmContainer->SetWordsBitmap(storedBitmap);
|
||||
bmContainer = new BitmapContainer(bitmap, stack, m_deterministic);
|
||||
m_bitmapAccessor[bitmap] = bmContainer;
|
||||
} else {
|
||||
bmContainer = iter->second;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user