#include <ScoreComponentCollection.h>

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 ©) |
| 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) |
Definition at line 55 of file ScoreComponentCollection.h.
| 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] |
| 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().

| 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] |
Definition at line 136 of file ScoreComponentCollection.h.
References CHECK, Moses::ScoreIndexManager::GetBeginIndex(), Moses::ScoreProducer::GetNumScoreComponents(), and Moses::ScoreProducer::GetScoreBookkeepingID().
Referenced by Moses::LMList::CalcScore(), Moses::SyntacticLanguageModel::Evaluate(), Moses::LanguageModelImplementation::EvaluateChart(), Moses::TargetPhrase::SetScore(), and Moses::TranslationOption::TranslationOption().


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


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


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


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

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

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

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

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

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

| void Moses::ScoreComponentCollection::PlusEquals | ( | const ScoreComponentCollection & | rhs | ) | [inline] |
add the score in rhs
Definition at line 87 of file ScoreComponentCollection.h.
References CHECK.
Referenced by Moses::Hypothesis::CalcRemainingScore(), Moses::Hypothesis::CalcScore(), Moses::ChartHypothesis::CalcScore(), Moses::ChartTrellisPath::ChartTrellisPath(), Moses::LanguageModelImplementation::Evaluate(), Moses::LexicalReordering::Evaluate(), Moses::GlobalLexicalModel::Evaluate(), Moses::WordPenaltyProducer::Evaluate(), Moses::DistortionScoreProducer::Evaluate(), Moses::TrellisPath::InitScore(), Moses::TranslationOption::MergeNewFeatures(), Moses::DecodeStepGeneration::Process(), and Moses::TranslationOption::TranslationOption().

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

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

| void Moses::ScoreComponentCollection::ZeroAllLM | ( | const LMList & | lmList | ) |
Definition at line 19 of file ScoreComponentCollection.cpp.
References Moses::LMList::GetMaxIndex(), and Moses::LMList::GetMinIndex().

| 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.
1.5.9