blob: 94ebe4618d7b14a1dc4beb45ecc98396f431a035 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
/*
* Stacks.h
*
* Created on: 6 Nov 2015
* Author: hieu
*/
#pragma once
#include <vector>
#include "../CubePruningMiniStack/Stack.h"
#include "../../Recycler.h"
namespace Moses2
{
class Manager;
namespace NSCubePruningPerMiniStack
{
class Stacks {
friend std::ostream& operator<<(std::ostream &, const Stacks &);
public:
Stacks(const Manager &mgr);
virtual ~Stacks();
void Init(size_t numStacks);
size_t GetSize() const
{ return m_stacks.size(); }
const NSCubePruningMiniStack::Stack &Back() const
{ return *m_stacks.back(); }
NSCubePruningMiniStack::Stack &operator[](size_t ind)
{ return *m_stacks[ind]; }
void Add(const Hypothesis *hypo, Recycler<Hypothesis*> &hypoRecycle);
NSCubePruningMiniStack::MiniStack &GetMiniStack(const Bitmap &newBitmap, const Range &pathRange);
protected:
const Manager &m_mgr;
std::vector<NSCubePruningMiniStack::Stack*> m_stacks;
};
}
}
|