Moses::SquareMatrix Class Reference

A square array of floats to store future costs. More...

#include <SquareMatrix.h>

List of all members.

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 &copy)

Protected Attributes

const size_t m_size
float * m_array

Friends

std::ostream & operator<< (std::ostream &out, const SquareMatrix &matrix)


Detailed Description

A square array of floats to store future costs.

Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Here is the call graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Returns length of the square: typically the sentence length

References m_size.

Referenced by Moses::operator<<().

Here is the caller graph for this function:

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

Here is the caller graph for this function:

Moses::SquareMatrix::TO_STRING (  ) 


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const SquareMatrix matrix 
) [friend]


Member Data Documentation

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


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

Generated on Wed Sep 8 20:05:17 2010 for Moses by  doxygen 1.5.9