#include <SquareMatrix.h>
Public Member Functions | |
SquareMatrix (size_t size) | |
~SquareMatrix () | |
void | InitTriangle (float val) |
size_t | GetSize () const |
float | GetScore (size_t startPos, size_t endPos) const |
void | SetScore (size_t startPos, size_t endPos, float value) |
float | CalcEstimatedScore (Bitmap const &) const |
float | CalcEstimatedScore (Bitmap 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::CalcEstimatedScore | ( | Bitmap 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 87 of file SquareMatrix.cpp.
References Moses::Bitmap::GetFirstGapPos(), Moses::Bitmap::GetLastPos(), GetScore(), Moses::Bitmap::GetSize(), Moses::Bitmap::GetValue(), and NOT_FOUND.
float Moses::SquareMatrix::CalcEstimatedScore | ( | Bitmap const & | bitmap | ) | const |
Calculate future score estimate for a given coverage bitmap
/param bitmap coverage bitmap
Definition at line 48 of file SquareMatrix.cpp.
References GetScore(), Moses::Bitmap::GetSize(), and Moses::Bitmap::GetValue().
Referenced by Moses::SearchNormal::ExpandAllHypotheses(), and Moses::BackwardsEdge::Initialize().
float Moses::SquareMatrix::GetScore | ( | size_t | startPos, | |
size_t | endPos | |||
) | const [inline] |
Get 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::CalcEstimatedScore(), CalcEstimatedScore(), and Moses::operator<<().
size_t Moses::SquareMatrix::GetSize | ( | ) | const [inline] |
Returns length of the square: typically the sentence length
Definition at line 57 of file SquareMatrix.h.
References m_size.
Referenced by Moses::operator<<().
void Moses::SquareMatrix::InitTriangle | ( | float | val | ) |
Definition at line 33 of file SquareMatrix.cpp.
References m_size, and SetScore().
Referenced by Moses::TranslationOptionCollection::CalcEstimatedScore().
void Moses::SquareMatrix::SetScore | ( | size_t | startPos, | |
size_t | endPos, | |||
float | value | |||
) | [inline] |
Set a future cost score for a span
Definition at line 65 of file SquareMatrix.h.
References m_array, and m_size.
Referenced by Moses::TranslationOptionCollection::CalcEstimatedScore(), and InitTriangle().
Moses::SquareMatrix::TO_STRING | ( | ) |
std::ostream& operator<< | ( | std::ostream & | out, | |
const SquareMatrix & | matrix | |||
) | [friend] |
Definition at line 74 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(), InitTriangle(), and SetScore().