#include <WordsBitmap.h>
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 ©) | |
| 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) |
Definition at line 40 of file WordsBitmap.h.
| 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.

| 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.

| Moses::WordsBitmap::WordsBitmap | ( | const WordsBitmap & | copy | ) | [inline] |
deep copy
Definition at line 80 of file WordsBitmap.h.
References GetValue(), m_bitmap, and m_size.

| Moses::WordsBitmap::~WordsBitmap | ( | ) | [inline] |
| 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().


| 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().

| 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().

| 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().

| int Moses::WordsBitmap::GetFutureCosts | ( | int | lastPos | ) | const |
| 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().


| 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().


| 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.
| 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().

| size_t Moses::WordsBitmap::GetNumWordsCovered | ( | ) | const [inline] |
count of words translated
Definition at line 91 of file WordsBitmap.h.
References m_bitmap, and m_size.
Referenced by Moses::SentenceStats::AddRecombination(), ascendingCoverageCmp(), Moses::BackwardsEdge::BackwardsEdge(), calcNgramExpectations(), Moses::SearchCubePruning::CreateForwardTodos(), Moses::SearchNormal::ExpandHypothesis(), IsComplete(), and Moses::OutputSearchNode().

| 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().

| 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().

| void Moses::WordsBitmap::Initialize | ( | std::vector< bool > | vector | ) | [inline, protected] |
| 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().

| 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().


| bool Moses::WordsBitmap::operator< | ( | const WordsBitmap & | compare | ) | const [inline] |
Definition at line 181 of file WordsBitmap.h.
References Compare().

| 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().


| 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] |
set value at a particular position
Definition at line 140 of file WordsBitmap.h.
References m_bitmap.
Referenced by Moses::SearchCubePruning::CreateForwardTodos(), Moses::HierarchicalReorderingForwardState::Expand(), Moses::HierarchicalReorderingForwardState::HierarchicalReorderingForwardState(), and Moses::Hypothesis::Hypothesis().

| Moses::WordsBitmap::TO_STRING | ( | ) |
| std::ostream& operator<< | ( | std::ostream & | out, | |
| const WordsBitmap & | wordsBitmap | |||
| ) | [friend] |
Definition at line 250 of file WordsBitmap.h.
bool* Moses::WordsBitmap::m_bitmap [protected] |
ticks of words that have been done
Definition at line 45 of file WordsBitmap.h.
Referenced by Compare(), GetEdgeToTheLeftOf(), GetEdgeToTheRightOf(), GetFirstGapPos(), GetFutureCosts(), GetLastGapPos(), GetLastPos(), GetNumWordsCovered(), GetValue(), Initialize(), Overlap(), SetValue(), WordsBitmap(), and ~WordsBitmap().
const size_t Moses::WordsBitmap::m_size [protected] |
number of words in sentence
Definition at line 44 of file WordsBitmap.h.
Referenced by GetEdgeToTheRightOf(), GetFirstGapPos(), GetFutureCosts(), GetID(), GetIDPlus(), GetLastGapPos(), GetLastPos(), GetNumWordsCovered(), GetSize(), Initialize(), Moses::operator<<(), and WordsBitmap().
1.5.9