mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-11-12 16:27:56 +03:00
Add Delete()
This commit is contained in:
parent
98a0e40377
commit
ae5286f220
@ -88,9 +88,18 @@ void ArcLists::Sort()
|
||||
BOOST_FOREACH(Coll::value_type &collPair, m_coll) {
|
||||
ArcList &list = *collPair.second;
|
||||
std::sort(list.begin(), list.end(), HypothesisFutureScoreOrderer() );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void ArcLists::Delete(const HypothesisBase *hypo)
|
||||
{
|
||||
Coll::iterator iter = m_coll.find(hypo);
|
||||
UTIL_THROW_IF2(iter == m_coll.end(), "Can't find arc list");
|
||||
ArcList *arcList = iter->second;
|
||||
|
||||
m_coll.erase(iter);
|
||||
delete arcList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -20,8 +20,9 @@ public:
|
||||
ArcLists();
|
||||
virtual ~ArcLists();
|
||||
|
||||
void AddArc(bool added, const HypothesisBase *currHypo,const HypothesisBase *otherHypo);
|
||||
void AddArc(bool added, const HypothesisBase *currHypo, const HypothesisBase *otherHypo);
|
||||
void Sort();
|
||||
void Delete(const HypothesisBase *hypo);
|
||||
|
||||
const ArcList *GetArcList(const HypothesisBase *hypo) const;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user