#include <SquareMatrix.h>
Public Member Functions | |
| SquareMatrix (size_t size) | |
| ~SquareMatrix () | |
| size_t | GetSize () const |
| float | GetScore (size_t startPos, size_t endPos) const |
| void | SetScore (size_t startPos, size_t endPos, float value) |
| float | CalcFutureScore (WordsBitmap const &) const |
| float | CalcFutureScore (WordsBitmap const &, size_t startPos, size_t endPos) const |
| TO_STRING () | |
Protected Member Functions | |
| SquareMatrix () | |
| SquareMatrix (const SquareMatrix ©) | |
Protected Attributes | |
| const size_t | m_size |
| float * | m_array |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const SquareMatrix &matrix) |
Definition at line 34 of file SquareMatrix.h.
| Moses::SquareMatrix::SquareMatrix | ( | ) | [protected] |
| Moses::SquareMatrix::SquareMatrix | ( | const SquareMatrix & | copy | ) | [protected] |
| Moses::SquareMatrix::SquareMatrix | ( | size_t | size | ) | [inline] |
| Moses::SquareMatrix::~SquareMatrix | ( | ) | [inline] |
| float Moses::SquareMatrix::CalcFutureScore | ( | WordsBitmap const & | bitmap, | |
| size_t | startPos, | |||
| size_t | endPos | |||
| ) | const |
Calculare future score estimate for a given coverage bitmap and an additional span that is also covered. This function is used to compute future score estimates for hypotheses that we may want build, but first want to check.
Note: this function is implemented a bit more complex than the basic one (w/o additional phrase) for speed reasons, which is probably overkill.
/param bitmap coverage bitmap /param startPos start of the span that is added to the coverage /param endPos end of the span that is added to the coverage
Definition at line 79 of file SquareMatrix.cpp.
References Moses::WordsBitmap::GetFirstGapPos(), Moses::WordsBitmap::GetLastPos(), GetScore(), Moses::WordsBitmap::GetSize(), Moses::WordsBitmap::GetValue(), and NOT_FOUND.

| float Moses::SquareMatrix::CalcFutureScore | ( | WordsBitmap const & | bitmap | ) | const |
Calculare future score estimate for a given coverage bitmap
/param bitmap coverage bitmap
Definition at line 40 of file SquareMatrix.cpp.
References GetScore(), Moses::WordsBitmap::GetSize(), and Moses::WordsBitmap::GetValue().
Referenced by Moses::Hypothesis::CalcExpectedScore(), Moses::Hypothesis::CalcScore(), and Moses::SearchNormal::ExpandAllHypotheses().


| float Moses::SquareMatrix::GetScore | ( | size_t | startPos, | |
| size_t | endPos | |||
| ) | const [inline] |
Get a future cost score for a span
Definition at line 57 of file SquareMatrix.h.
References m_array, and m_size.
Referenced by Moses::TranslationOptionCollection::CalcFutureScore(), CalcFutureScore(), and Moses::operator<<().

| size_t Moses::SquareMatrix::GetSize | ( | ) | const [inline] |
Returns length of the square: typically the sentence length
Definition at line 53 of file SquareMatrix.h.
References m_size.
Referenced by Moses::operator<<().

| void Moses::SquareMatrix::SetScore | ( | size_t | startPos, | |
| size_t | endPos, | |||
| float | value | |||
| ) | [inline] |
Set a future cost score for a span
Definition at line 61 of file SquareMatrix.h.
References m_array, and m_size.
Referenced by Moses::TranslationOptionCollection::CalcFutureScore().

| Moses::SquareMatrix::TO_STRING | ( | ) |
| std::ostream& operator<< | ( | std::ostream & | out, | |
| const SquareMatrix & | matrix | |||
| ) | [friend] |
Definition at line 70 of file SquareMatrix.h.
float* Moses::SquareMatrix::m_array [protected] |
two-dimensional array to store floats
Definition at line 39 of file SquareMatrix.h.
Referenced by GetScore(), SetScore(), SquareMatrix(), and ~SquareMatrix().
const size_t Moses::SquareMatrix::m_size [protected] |
length of the square (sentence length)
Definition at line 38 of file SquareMatrix.h.
Referenced by GetScore(), GetSize(), and SetScore().
1.5.9