#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) |
| Moses::SquareMatrix::SquareMatrix | ( | ) | [protected] |
| Moses::SquareMatrix::SquareMatrix | ( | const SquareMatrix & | copy | ) | [protected] |
| Moses::SquareMatrix::SquareMatrix | ( | size_t | size | ) | [inline] |
References m_array.
| Moses::SquareMatrix::~SquareMatrix | ( | ) | [inline] |
References m_array.
| 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
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
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
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
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
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] |
float* Moses::SquareMatrix::m_array [protected] |
two-dimensional array to store floats
Referenced by GetScore(), SetScore(), SquareMatrix(), and ~SquareMatrix().
const size_t Moses::SquareMatrix::m_size [protected] |
length of the square (sentence length)
Referenced by GetScore(), GetSize(), and SetScore().
1.5.9