mosesdecoder/moses2/ArcLists.h

45 lines
819 B
C
Raw Normal View History

2015-10-27 15:08:32 +03:00
/*
* ArcList.h
*
* Created on: 26 Oct 2015
* Author: hieu
*/
2016-03-17 20:54:25 +03:00
#pragma once
2015-10-27 15:08:32 +03:00
#include <vector>
2024-02-22 03:06:21 +03:00
#include <unordered_map>
#include <unordered_set>
2015-10-27 15:08:32 +03:00
2015-12-10 23:49:30 +03:00
namespace Moses2
{
2016-08-24 00:38:27 +03:00
class System;
2015-12-10 23:49:30 +03:00
2016-03-16 13:27:05 +03:00
class HypothesisBase;
2015-10-27 15:08:32 +03:00
2016-03-16 13:27:05 +03:00
typedef std::vector<const HypothesisBase*> ArcList;
2015-10-27 15:08:32 +03:00
2016-03-31 23:00:16 +03:00
class ArcLists
{
2015-10-27 15:08:32 +03:00
public:
2016-03-31 23:00:16 +03:00
ArcLists();
virtual ~ArcLists();
2015-10-27 15:08:32 +03:00
2016-03-31 23:00:16 +03:00
void AddArc(bool added, const HypothesisBase *currHypo,
2017-02-01 03:10:16 +03:00
const HypothesisBase *otherHypo);
2016-03-31 23:00:16 +03:00
void Sort();
void Delete(const HypothesisBase *hypo);
2015-10-27 15:08:32 +03:00
2016-08-03 13:10:35 +03:00
const ArcList &GetArcList(const HypothesisBase *hypo) const;
2016-03-17 20:54:25 +03:00
2016-08-24 00:38:27 +03:00
std::string Debug(const System &system) const;
2015-10-27 15:08:32 +03:00
protected:
2024-02-22 03:06:21 +03:00
typedef std::unordered_map<const HypothesisBase*, ArcList*> Coll;
2016-03-31 23:00:16 +03:00
Coll m_coll;
2015-10-27 15:08:32 +03:00
2016-08-03 13:10:35 +03:00
ArcList &GetArcList(const HypothesisBase *hypo);
ArcList &GetAndDetachArcList(const HypothesisBase *hypo);
2015-10-27 15:08:32 +03:00
};
2015-12-10 23:49:30 +03:00
}