mosesdecoder/contrib/other-builds/moses2/Search/CubePruningPerMiniStack/Stacks.h

52 lines
919 B
C
Raw Normal View History

2016-01-07 22:04:22 +03:00
/*
* Stacks.h
*
* Created on: 6 Nov 2015
* Author: hieu
*/
#pragma once
#include <vector>
#include "../CubePruningMiniStack/Stack.h"
2016-01-07 22:04:22 +03:00
#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(); }
2016-02-09 16:43:10 +03:00
const NSCubePruningMiniStack::Stack &Back() const
2016-01-07 22:04:22 +03:00
{ return *m_stacks.back(); }
2016-02-09 16:43:10 +03:00
NSCubePruningMiniStack::Stack &operator[](size_t ind)
2016-01-07 22:04:22 +03:00
{ return *m_stacks[ind]; }
void Add(const Hypothesis *hypo, Recycler<Hypothesis*> &hypoRecycle);
2016-02-09 16:43:10 +03:00
NSCubePruningMiniStack::MiniStack &GetMiniStack(const Bitmap &newBitmap, const Range &pathRange);
2016-01-07 22:04:22 +03:00
protected:
const Manager &m_mgr;
2016-02-09 16:43:10 +03:00
std::vector<NSCubePruningMiniStack::Stack*> m_stacks;
2016-01-07 22:04:22 +03:00
};
}
}