mempool for batch vector

This commit is contained in:
Hieu Hoang 2015-11-17 15:29:45 +00:00
parent f8744cf071
commit 8f4cb5e9f7
5 changed files with 7 additions and 5 deletions

View File

@ -18,7 +18,7 @@ StatefulFeatureFunction::~StatefulFeatureFunction() {
// TODO Auto-generated destructor stub
}
void StatefulFeatureFunction::EvaluateWhenApplied(const std::vector<Hypothesis*> &hypos) const
void StatefulFeatureFunction::EvaluateWhenApplied(const std::vector<Hypothesis*, MemPoolAllocator<Hypothesis*> > &hypos) const
{
BOOST_FOREACH(Hypothesis *hypo, hypos) {
hypo->EvaluateWhenApplied(*this);

View File

@ -10,6 +10,7 @@
#include "FeatureFunction.h"
#include "../legacy/FFState.h"
#include "../MemPool.h"
class Hypothesis;
@ -30,7 +31,7 @@ public:
//! return the state associated with the empty hypothesis for a given sentence
virtual void EmptyHypothesisState(FFState &state, const Manager &mgr, const PhraseImpl &input) const = 0;
virtual void EvaluateWhenApplied(const std::vector<Hypothesis*> &hypos) const;
virtual void EvaluateWhenApplied(const std::vector<Hypothesis*, MemPoolAllocator<Hypothesis*> > &hypos) const;
virtual void EvaluateWhenApplied(const Manager &mgr,
const Hypothesis &hypo,

View File

@ -148,7 +148,7 @@ KENLMBatch::EvaluateInIsolation(const System &system,
}
}
void KENLMBatch::EvaluateWhenApplied(const std::vector<Hypothesis*> &hypos) const
void KENLMBatch::EvaluateWhenApplied(const std::vector<Hypothesis*, MemPoolAllocator<Hypothesis*> > &hypos) const
{
}

View File

@ -34,7 +34,7 @@ public:
Scores &scores,
Scores *estimatedScores) const;
virtual void EvaluateWhenApplied(const std::vector<Hypothesis*> &hypos) const;
virtual void EvaluateWhenApplied(const std::vector<Hypothesis*, MemPoolAllocator<Hypothesis*> > &hypos) const;
virtual void EvaluateWhenApplied(const Manager &mgr,
const Hypothesis &hypo,

View File

@ -11,6 +11,7 @@
#include "../legacy/Range.h"
#include "../legacy/Bitmap.h"
#include "../TypeDef.h"
#include "../MemPool.h"
#include "ArcLists.h"
#include "Search.h"
@ -31,7 +32,7 @@ public:
const Hypothesis *GetBestHypothesis() const;
protected:
std::vector<Hypothesis*> m_hypos;
std::vector<Hypothesis*, MemPoolAllocator<Hypothesis*> > m_hypos;
void Extend(const Hypothesis &hypo);
void Extend(const Hypothesis &hypo, const InputPath &path);