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>
|
|
|
|
#include <boost/unordered_map.hpp>
|
|
|
|
|
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:
|
2016-03-31 23:00:16 +03:00
|
|
|
typedef boost::unordered_map<const HypothesisBase*, ArcList*> Coll;
|
|
|
|
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
|
|
|
}
|
|
|
|
|