Moses::WordsBitmap Class Reference

#include <WordsBitmap.h>

List of all members.

Public Member Functions

 WordsBitmap (size_t size, std::vector< bool > initialize_vector)
 create WordsBitmap of length size and initialise with vector
 WordsBitmap (size_t size)
 create WordsBitmap of length size and initialise
 WordsBitmap (const WordsBitmap &copy)
 deep copy
 ~WordsBitmap ()
size_t GetNumWordsCovered () const
 count of words translated
size_t GetFirstGapPos () const
 position of 1st word not yet translated, or NOT_FOUND if everything already translated
size_t GetLastGapPos () const
 position of last word not yet translated, or NOT_FOUND if everything already translated
size_t GetLastPos () const
 position of last translated word
bool GetValue (size_t pos) const
 whether a word has been translated at a particular position
void SetValue (size_t pos, bool value)
 set value at a particular position
void SetValue (size_t startPos, size_t endPos, bool value)
 set value between 2 positions, inclusive
bool IsComplete () const
 whether every word has been translated
bool Overlap (const WordsRange &compare) const
 whether the wordrange overlaps with any translated word in this bitmap
size_t GetSize () const
 number of elements
int Compare (const WordsBitmap &compare) const
 transitive comparison of WordsBitmap
bool operator< (const WordsBitmap &compare) const
size_t GetEdgeToTheLeftOf (size_t l) const
size_t GetEdgeToTheRightOf (size_t r) const
int GetFutureCosts (int lastPos) const
 TODO - ??? no idea.
WordsBitmapID GetID () const
 converts bitmap into an integer ID: it consists of two parts: the first 16 bit are the pattern between the first gap and the last word-1, the second 16 bit are the number of filled positions. enforces a sentence length limit of 65535 and a max distortion of 16
WordsBitmapID GetIDPlus (size_t startPos, size_t endPos) const
 converts bitmap into an integer ID, with an additional span covered
 TO_STRING ()

Protected Member Functions

 WordsBitmap ()
void Initialize ()
 set all elements to false
void Initialize (std::vector< bool > vector)

Protected Attributes

const size_t m_size
bool * m_bitmap

Friends

std::ostream & operator<< (std::ostream &out, const WordsBitmap &wordsBitmap)


Detailed Description

vector of boolean used to represent whether a word has been translated or not

Definition at line 40 of file WordsBitmap.h.


Constructor & Destructor Documentation

Moses::WordsBitmap::WordsBitmap (  )  [protected]

Moses::WordsBitmap::WordsBitmap ( size_t  size,
std::vector< bool >  initialize_vector 
) [inline]

create WordsBitmap of length size and initialise with vector

Definition at line 68 of file WordsBitmap.h.

References Initialize(), and m_bitmap.

Here is the call graph for this function:

Moses::WordsBitmap::WordsBitmap ( size_t  size  )  [inline]

create WordsBitmap of length size and initialise

Definition at line 74 of file WordsBitmap.h.

References Initialize(), and m_bitmap.

Here is the call graph for this function:

Moses::WordsBitmap::WordsBitmap ( const WordsBitmap copy  )  [inline]

deep copy

Definition at line 80 of file WordsBitmap.h.

References GetValue(), m_bitmap, and m_size.

Here is the call graph for this function:

Moses::WordsBitmap::~WordsBitmap (  )  [inline]

Definition at line 87 of file WordsBitmap.h.

References m_bitmap.


Member Function Documentation

int Moses::WordsBitmap::Compare ( const WordsBitmap compare  )  const [inline]

transitive comparison of WordsBitmap

Definition at line 167 of file WordsBitmap.h.

References GetSize(), and m_bitmap.

Referenced by operator<(), and Moses::Hypothesis::RecombineCompare().

Here is the call graph for this function:

Here is the caller graph for this function:

size_t Moses::WordsBitmap::GetEdgeToTheLeftOf ( size_t  l  )  const [inline]

Definition at line 185 of file WordsBitmap.h.

References m_bitmap.

Referenced by Moses::SearchNormal::ProcessOneHypothesis().

Here is the caller graph for this function:

size_t Moses::WordsBitmap::GetEdgeToTheRightOf ( size_t  r  )  const [inline]

Definition at line 193 of file WordsBitmap.h.

References m_bitmap, and m_size.

Referenced by Moses::SearchNormal::ProcessOneHypothesis().

Here is the caller graph for this function:

size_t Moses::WordsBitmap::GetFirstGapPos (  )  const [inline]

position of 1st word not yet translated, or NOT_FOUND if everything already translated

Definition at line 101 of file WordsBitmap.h.

References m_bitmap, m_size, and NOT_FOUND.

Referenced by Moses::SquareMatrix::CalcFutureScore(), Moses::ReorderingConstraint::Check(), Moses::SearchCubePruning::CheckDistortion(), Moses::DistortionScoreProducer::Evaluate(), GetID(), GetIDPlus(), Moses::HypothesisScoreOrdererWithDistortion::operator()(), and Moses::SearchNormal::ProcessOneHypothesis().

Here is the caller graph for this function:

int Moses::WordsBitmap::GetFutureCosts ( int  lastPos  )  const

TODO - ??? no idea.

Definition at line 29 of file WordsBitmap.cpp.

References CHECK, m_bitmap, and m_size.

WordsBitmapID Moses::WordsBitmap::GetID (  )  const [inline]

converts bitmap into an integer ID: it consists of two parts: the first 16 bit are the pattern between the first gap and the last word-1, the second 16 bit are the number of filled positions. enforces a sentence length limit of 65535 and a max distortion of 16

Definition at line 206 of file WordsBitmap.h.

References CHECK, end, GetFirstGapPos(), GetLastPos(), GetValue(), m_size, and NOT_FOUND.

Referenced by Moses::HypothesisStackNormal::Add(), Moses::HypothesisStackNormal::GetWorstScoreForBitmap(), and Moses::HypothesisStackNormal::PruneToSize().

Here is the call graph for this function:

Here is the caller graph for this function:

WordsBitmapID Moses::WordsBitmap::GetIDPlus ( size_t  startPos,
size_t  endPos 
) const [inline]

converts bitmap into an integer ID, with an additional span covered

Definition at line 224 of file WordsBitmap.h.

References CHECK, end, GetFirstGapPos(), GetLastPos(), GetValue(), m_size, and NOT_FOUND.

Referenced by Moses::SearchNormal::ExpandHypothesis().

Here is the call graph for this function:

Here is the caller graph for this function:

size_t Moses::WordsBitmap::GetLastGapPos (  )  const [inline]

position of last word not yet translated, or NOT_FOUND if everything already translated

Definition at line 113 of file WordsBitmap.h.

References m_bitmap, m_size, and NOT_FOUND.

size_t Moses::WordsBitmap::GetLastPos (  )  const [inline]

position of last translated word

Definition at line 125 of file WordsBitmap.h.

References m_bitmap, m_size, and NOT_FOUND.

Referenced by Moses::SquareMatrix::CalcFutureScore(), Moses::ReorderingConstraint::Check(), GetID(), and GetIDPlus().

Here is the caller graph for this function:

size_t Moses::WordsBitmap::GetNumWordsCovered (  )  const [inline]

size_t Moses::WordsBitmap::GetSize (  )  const [inline]

number of elements

Definition at line 162 of file WordsBitmap.h.

References m_size.

Referenced by Moses::SquareMatrix::CalcFutureScore(), Compare(), and IsComplete().

Here is the caller graph for this function:

bool Moses::WordsBitmap::GetValue ( size_t  pos  )  const [inline]

whether a word has been translated at a particular position

Definition at line 136 of file WordsBitmap.h.

References m_bitmap.

Referenced by Moses::SquareMatrix::CalcFutureScore(), Moses::ReorderingConstraint::Check(), Moses::SearchCubePruning::CreateForwardTodos(), GetID(), GetIDPlus(), Moses::operator<<(), Moses::SearchNormal::ProcessOneHypothesis(), and WordsBitmap().

Here is the caller graph for this function:

void Moses::WordsBitmap::Initialize ( std::vector< bool >  vector  )  [inline, protected]

Definition at line 57 of file WordsBitmap.h.

References m_bitmap, and m_size.

void Moses::WordsBitmap::Initialize (  )  [inline, protected]

set all elements to false

Definition at line 50 of file WordsBitmap.h.

References m_bitmap, and m_size.

Referenced by WordsBitmap().

Here is the caller graph for this function:

bool Moses::WordsBitmap::IsComplete (  )  const [inline]

whether every word has been translated

Definition at line 150 of file WordsBitmap.h.

References GetNumWordsCovered(), and GetSize().

Referenced by calcNgramExpectations(), and Moses::Hypothesis::IsSourceCompleted().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Moses::WordsBitmap::operator< ( const WordsBitmap compare  )  const [inline]

Definition at line 181 of file WordsBitmap.h.

References Compare().

Here is the call graph for this function:

bool Moses::WordsBitmap::Overlap ( const WordsRange compare  )  const [inline]

whether the wordrange overlaps with any translated word in this bitmap

Definition at line 154 of file WordsBitmap.h.

References Moses::WordsRange::GetEndPos(), Moses::WordsRange::GetStartPos(), and m_bitmap.

Referenced by Moses::Hypothesis::Hypothesis(), Moses::TranslationOption::Overlap(), and Moses::SearchNormal::ProcessOneHypothesis().

Here is the call graph for this function:

Here is the caller graph for this function:

void Moses::WordsBitmap::SetValue ( size_t  startPos,
size_t  endPos,
bool  value 
) [inline]

set value between 2 positions, inclusive

Definition at line 144 of file WordsBitmap.h.

References m_bitmap.

void Moses::WordsBitmap::SetValue ( size_t  pos,
bool  value 
) [inline]

Moses::WordsBitmap::TO_STRING (  ) 


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const WordsBitmap wordsBitmap 
) [friend]

Definition at line 250 of file WordsBitmap.h.


Member Data Documentation

bool* Moses::WordsBitmap::m_bitmap [protected]

const size_t Moses::WordsBitmap::m_size [protected]


The documentation for this class was generated from the following files:

Generated on Wed Feb 8 22:04:10 2012 for Moses by  doxygen 1.5.9