Moses::ScoreComponentCollection Class Reference

#include <ScoreComponentCollection.h>

Collaboration diagram for Moses::ScoreComponentCollection:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 ScoreComponentCollection ()
 Create a new score collection with all values set to 0.0.
 ScoreComponentCollection (const ScoreComponentCollection &rhs)
 Clone a score collection.
size_t size () const
const float & operator[] (size_t x) const
void ZeroAll ()
 Set all values to 0.0.
void PlusEquals (const ScoreComponentCollection &rhs)
 add the score in rhs
void MinusEquals (const ScoreComponentCollection &rhs)
 subtract the score in rhs
void PlusEquals (const ScoreProducer *sp, const std::vector< float > &scores)
void PlusEquals (const ScoreProducer *sp, const ScoreComponentCollection &scores)
void PlusEquals (const ScoreProducer *sp, float score)
void Assign (const ScoreProducer *sp, const std::vector< float > &scores)
void Assign (const ScoreComponentCollection &copy)
void Assign (const ScoreProducer *sp, float score)
float InnerProduct (const std::vector< float > &rhs) const
float PartialInnerProduct (const ScoreProducer *sp, const std::vector< float > &rhs) const
std::vector< float > GetScoresForProducer (const ScoreProducer *sp) const
 return a vector of all the scores associated with a certain ScoreProducer
float GetScoreForProducer (const ScoreProducer *sp) const
float GetWeightedScore () const
void ZeroAllLM (const LMList &lmList)
void PlusEqualsAllLM (const LMList &lmList, const ScoreComponentCollection &rhs)

Friends

class ScoreIndexManager
std::ostream & operator<< (std::ostream &os, const ScoreComponentCollection &rhs)


Detailed Description

Definition at line 55 of file ScoreComponentCollection.h.


Constructor & Destructor Documentation

Moses::ScoreComponentCollection::ScoreComponentCollection (  ) 

Create a new score collection with all values set to 0.0.

Definition at line 8 of file ScoreComponentCollection.cpp.

Moses::ScoreComponentCollection::ScoreComponentCollection ( const ScoreComponentCollection rhs  )  [inline]

Clone a score collection.

Definition at line 68 of file ScoreComponentCollection.h.


Member Function Documentation

void Moses::ScoreComponentCollection::Assign ( const ScoreProducer sp,
float  score 
) [inline]

Special version PlusEquals(ScoreProducer, vector<float>) to add the score from a single ScoreProducer that produces a single value

Definition at line 152 of file ScoreComponentCollection.h.

References CHECK, Moses::ScoreIndexManager::GetBeginIndex(), Moses::ScoreProducer::GetNumScoreComponents(), and Moses::ScoreProducer::GetScoreBookkeepingID().

Here is the call graph for this function:

void Moses::ScoreComponentCollection::Assign ( const ScoreComponentCollection copy  )  [inline]

Definition at line 145 of file ScoreComponentCollection.h.

void Moses::ScoreComponentCollection::Assign ( const ScoreProducer sp,
const std::vector< float > &  scores 
) [inline]

float Moses::ScoreComponentCollection::GetScoreForProducer ( const ScoreProducer sp  )  const [inline]

if a ScoreProducer produces a single score (for example, a language model score) this will return it. If not, this method will throw

Definition at line 185 of file ScoreComponentCollection.h.

References begin, CHECK, end, Moses::ScoreIndexManager::GetBeginIndex(), Moses::ScoreIndexManager::GetEndIndex(), and Moses::ScoreProducer::GetScoreBookkeepingID().

Referenced by Moses::OutputWordGraph().

Here is the call graph for this function:

Here is the caller graph for this function:

std::vector<float> Moses::ScoreComponentCollection::GetScoresForProducer ( const ScoreProducer sp  )  const [inline]

return a vector of all the scores associated with a certain ScoreProducer

Definition at line 171 of file ScoreComponentCollection.h.

References begin, end, Moses::ScoreIndexManager::GetBeginIndex(), Moses::ScoreIndexManager::GetEndIndex(), and Moses::ScoreProducer::GetScoreBookkeepingID().

Referenced by Moses::LanguageModelImplementation::EvaluateChart(), OutputNBest(), Moses::OutputWordGraph(), and PartialInnerProduct().

Here is the call graph for this function:

Here is the caller graph for this function:

float Moses::ScoreComponentCollection::GetWeightedScore (  )  const

Definition at line 13 of file ScoreComponentCollection.cpp.

References InnerProduct(), and Moses::StaticData::Instance().

Referenced by Moses::ChartHypothesis::CalcScore(), Moses::ChartTrellisPath::ChartTrellisPath(), and Moses::TargetPhrase::SetScore().

Here is the call graph for this function:

Here is the caller graph for this function:

float Moses::ScoreComponentCollection::InnerProduct ( const std::vector< float > &  rhs  )  const [inline]

Used to find the weighted total of scores. rhs should contain a vector of weights of the same length as the number of scores.

Definition at line 160 of file ScoreComponentCollection.h.

Referenced by Moses::Hypothesis::CalcExpectedScore(), Moses::Hypothesis::CalcRemainingScore(), Moses::TranslationOption::CalcScore(), Moses::Hypothesis::CalcScore(), doMBR(), and GetWeightedScore().

Here is the caller graph for this function:

void Moses::ScoreComponentCollection::MinusEquals ( const ScoreComponentCollection rhs  )  [inline]

subtract the score in rhs

Definition at line 96 of file ScoreComponentCollection.h.

References CHECK.

Referenced by Moses::ChartTrellisPath::ChartTrellisPath(), Moses::TrellisPath::InitScore(), and Moses::OutputSearchNode().

Here is the caller graph for this function:

const float& Moses::ScoreComponentCollection::operator[] ( size_t  x  )  const [inline]

Definition at line 76 of file ScoreComponentCollection.h.

float Moses::ScoreComponentCollection::PartialInnerProduct ( const ScoreProducer sp,
const std::vector< float > &  rhs 
) const [inline]

Definition at line 164 of file ScoreComponentCollection.h.

References CHECK, and GetScoresForProducer().

Here is the call graph for this function:

void Moses::ScoreComponentCollection::PlusEquals ( const ScoreProducer sp,
float  score 
) [inline]

Special version PlusEquals(ScoreProducer, vector<float>) to add the score from a single ScoreProducer that produces a single value

Definition at line 130 of file ScoreComponentCollection.h.

References CHECK, Moses::ScoreIndexManager::GetBeginIndex(), Moses::ScoreProducer::GetNumScoreComponents(), and Moses::ScoreProducer::GetScoreBookkeepingID().

Here is the call graph for this function:

void Moses::ScoreComponentCollection::PlusEquals ( const ScoreProducer sp,
const ScoreComponentCollection scores 
) [inline]

Add scores from a single ScoreProducer only The length of scores must be equal to the number of score components produced by sp

Definition at line 119 of file ScoreComponentCollection.h.

References end, Moses::ScoreIndexManager::GetBeginIndex(), Moses::ScoreIndexManager::GetEndIndex(), and Moses::ScoreProducer::GetScoreBookkeepingID().

Here is the call graph for this function:

void Moses::ScoreComponentCollection::PlusEquals ( const ScoreProducer sp,
const std::vector< float > &  scores 
) [inline]

Add scores from a single ScoreProducer only The length of scores must be equal to the number of score components produced by sp

Definition at line 107 of file ScoreComponentCollection.h.

References CHECK, Moses::ScoreIndexManager::GetBeginIndex(), Moses::ScoreProducer::GetNumScoreComponents(), and Moses::ScoreProducer::GetScoreBookkeepingID().

Here is the call graph for this function:

void Moses::ScoreComponentCollection::PlusEquals ( const ScoreComponentCollection rhs  )  [inline]

void Moses::ScoreComponentCollection::PlusEqualsAllLM ( const LMList lmList,
const ScoreComponentCollection rhs 
)

Definition at line 27 of file ScoreComponentCollection.cpp.

References Moses::LMList::GetMaxIndex(), and Moses::LMList::GetMinIndex().

Here is the call graph for this function:

size_t Moses::ScoreComponentCollection::size (  )  const [inline]

Definition at line 73 of file ScoreComponentCollection.h.

void Moses::ScoreComponentCollection::ZeroAll (  )  [inline]

Set all values to 0.0.

Definition at line 81 of file ScoreComponentCollection.h.

Referenced by Moses::TargetPhrase::ResetScore(), and Moses::Hypothesis::ResetScore().

Here is the caller graph for this function:

void Moses::ScoreComponentCollection::ZeroAllLM ( const LMList lmList  ) 

Definition at line 19 of file ScoreComponentCollection.cpp.

References Moses::LMList::GetMaxIndex(), and Moses::LMList::GetMinIndex().

Here is the call graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const ScoreComponentCollection rhs 
) [friend]

Definition at line 202 of file ScoreComponentCollection.h.

friend class ScoreIndexManager [friend]

Definition at line 58 of file ScoreComponentCollection.h.


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

Generated on Thu Feb 9 00:04:11 2012 for Moses by  doxygen 1.5.9