mosesdecoder/contrib/moses2/SCFG/Stacks.h

40 lines
592 B
C
Raw Normal View History

2016-02-29 18:51:17 +03:00
#pragma once
#include <stddef.h>
#include <vector>
#include "Stack.h"
namespace Moses2
{
class ManagerBase;
namespace SCFG
{
class Stacks
{
public:
2016-05-25 23:02:34 +03:00
virtual ~Stacks();
2016-04-17 11:47:04 +03:00
void Init(SCFG::Manager &mgr, size_t size);
2016-02-29 18:51:17 +03:00
2016-04-17 17:11:13 +03:00
const Stack &GetStack(size_t startPos, size_t size) const
{ return *m_cells[startPos][size - 1]; }
2016-04-17 13:01:01 +03:00
Stack &GetStack(size_t startPos, size_t size)
{ return *m_cells[startPos][size - 1]; }
2016-04-17 21:33:21 +03:00
void OutputStacks() const;
2016-05-06 17:41:50 +03:00
const Stack &GetLastStack() const
{ return GetStack(0, m_cells.size()); }
2016-02-29 18:51:17 +03:00
protected:
2016-03-31 23:00:16 +03:00
std::vector<std::vector<Stack*> > m_cells;
2016-02-29 18:51:17 +03:00
};
}
}