mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-08 20:46:59 +03:00
mempool for batch vector
This commit is contained in:
parent
f8744cf071
commit
8f4cb5e9f7
@ -18,7 +18,7 @@ StatefulFeatureFunction::~StatefulFeatureFunction() {
|
|||||||
// TODO Auto-generated destructor stub
|
// 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) {
|
BOOST_FOREACH(Hypothesis *hypo, hypos) {
|
||||||
hypo->EvaluateWhenApplied(*this);
|
hypo->EvaluateWhenApplied(*this);
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
#include "FeatureFunction.h"
|
#include "FeatureFunction.h"
|
||||||
#include "../legacy/FFState.h"
|
#include "../legacy/FFState.h"
|
||||||
|
#include "../MemPool.h"
|
||||||
|
|
||||||
class Hypothesis;
|
class Hypothesis;
|
||||||
|
|
||||||
@ -30,7 +31,7 @@ public:
|
|||||||
//! return the state associated with the empty hypothesis for a given sentence
|
//! 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 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,
|
virtual void EvaluateWhenApplied(const Manager &mgr,
|
||||||
const Hypothesis &hypo,
|
const Hypothesis &hypo,
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ public:
|
|||||||
Scores &scores,
|
Scores &scores,
|
||||||
Scores *estimatedScores) const;
|
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,
|
virtual void EvaluateWhenApplied(const Manager &mgr,
|
||||||
const Hypothesis &hypo,
|
const Hypothesis &hypo,
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include "../legacy/Range.h"
|
#include "../legacy/Range.h"
|
||||||
#include "../legacy/Bitmap.h"
|
#include "../legacy/Bitmap.h"
|
||||||
#include "../TypeDef.h"
|
#include "../TypeDef.h"
|
||||||
|
#include "../MemPool.h"
|
||||||
#include "ArcLists.h"
|
#include "ArcLists.h"
|
||||||
#include "Search.h"
|
#include "Search.h"
|
||||||
|
|
||||||
@ -31,7 +32,7 @@ public:
|
|||||||
const Hypothesis *GetBestHypothesis() const;
|
const Hypothesis *GetBestHypothesis() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
std::vector<Hypothesis*> m_hypos;
|
std::vector<Hypothesis*, MemPoolAllocator<Hypothesis*> > m_hypos;
|
||||||
|
|
||||||
void Extend(const Hypothesis &hypo);
|
void Extend(const Hypothesis &hypo);
|
||||||
void Extend(const Hypothesis &hypo, const InputPath &path);
|
void Extend(const Hypothesis &hypo, const InputPath &path);
|
||||||
|
Loading…
Reference in New Issue
Block a user