diff --git a/contrib/other-builds/moses2/Jamfile b/contrib/other-builds/moses2/Jamfile index 415ae0cc1..959eb1cf0 100644 --- a/contrib/other-builds/moses2/Jamfile +++ b/contrib/other-builds/moses2/Jamfile @@ -55,7 +55,6 @@ external-lib boost_serialization ; Search/CubePruning/Misc.cpp Search/CubePruning/Search.cpp Search/CubePruning/Stack.cpp - Search/CubePruning/Stacks.cpp legacy/Bitmap.cpp legacy/Bitmaps.cpp legacy/Factor.cpp diff --git a/contrib/other-builds/moses2/Search/CubePruning/Search.h b/contrib/other-builds/moses2/Search/CubePruning/Search.h index 1cd619b37..7dcc3c7dd 100644 --- a/contrib/other-builds/moses2/Search/CubePruning/Search.h +++ b/contrib/other-builds/moses2/Search/CubePruning/Search.h @@ -9,7 +9,7 @@ #include #include "../Search.h" #include "Misc.h" -#include "Stacks.h" +#include "Stack.h" #include "../../legacy/Range.h" namespace Moses2 diff --git a/contrib/other-builds/moses2/Search/CubePruning/Stacks.cpp b/contrib/other-builds/moses2/Search/CubePruning/Stacks.cpp deleted file mode 100644 index 76007a675..000000000 --- a/contrib/other-builds/moses2/Search/CubePruning/Stacks.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Stacks.cpp - * - * Created on: 6 Nov 2015 - * Author: hieu - */ - -#include "Stacks.h" -#include "../../System.h" -#include "../Manager.h" - -using namespace std; - -namespace Moses2 -{ - -namespace NSCubePruning -{ - -Stacks::Stacks(const Manager &mgr) -:m_mgr(mgr) -{ -} - -Stacks::~Stacks() -{ -} - -void Stacks::Init(size_t numStacks) -{ - m_stacks.resize(numStacks, NULL); -} - -void Stacks::ReadyToDecode(size_t ind) -{ - if (ind) { - // reuse previous stack - Stack *stack = m_stacks[ind - 1]; - stack->Clear(); - - m_stacks[ind - 1] = NULL; - m_stacks[ind] = stack; - } - else { - m_stacks[ind] = new (m_mgr.GetPool().Allocate()) Stack(m_mgr); - } -} - - -std::ostream& operator<<(std::ostream &out, const Stacks &obj) -{ - for (size_t i = 0; i < obj.GetSize(); ++i) { - const Stack *stack = obj.m_stacks[i]; - if (stack) { - out << stack->GetHypoSize() << " "; - } - else { - out << "N "; - } - } - - return out; -} - -void Stacks::Add(const Hypothesis *hypo, Recycler &hypoRecycle) -{ - size_t numWordsCovered = hypo->GetBitmap().GetNumWordsCovered(); - //cerr << "numWordsCovered=" << numWordsCovered << endl; - Stack &stack = *m_stacks[numWordsCovered]; - stack.Add(hypo, hypoRecycle); - -} - -} - -} - - diff --git a/contrib/other-builds/moses2/Search/CubePruning/Stacks.h b/contrib/other-builds/moses2/Search/CubePruning/Stacks.h deleted file mode 100644 index 8e8d9195f..000000000 --- a/contrib/other-builds/moses2/Search/CubePruning/Stacks.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Stacks.h - * - * Created on: 6 Nov 2015 - * Author: hieu - */ - -#pragma once - -#include -#include "Stack.h" -#include "../../Recycler.h" - -namespace Moses2 -{ -class Manager; - -namespace NSCubePruning -{ - -class Stacks { - friend std::ostream& operator<<(std::ostream &, const Stacks &); -public: - Stacks(const Manager &mgr); - virtual ~Stacks(); - - void Init(size_t numStacks); - void ReadyToDecode(size_t ind); - - size_t GetSize() const - { return m_stacks.size(); } - - const Stack &Back() const - { return *m_stacks.back(); } - - Stack &operator[](size_t ind) - { return *m_stacks[ind]; } - - void Add(const Hypothesis *hypo, Recycler &hypoRecycle); - -protected: - const Manager &m_mgr; - std::vector m_stacks; -}; - - -} - -} - -