Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Stacks.h « CubePruningPerBitmap « defer « moses2 « contrib - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5729fa6131c4751ec0c80c045a4faccece9a4711 (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 NSCubePruningPerBitmap
{

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;
};


}

}