From 7278218f4581ed8da3dacbff9c7ff3834c292dab Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Mon, 22 Oct 2012 11:35:31 -0400 Subject: Remove global variable, have decoder hold a pointer --- decoder/incremental.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'decoder/incremental.h') diff --git a/decoder/incremental.h b/decoder/incremental.h index 180383ce..f791a626 100644 --- a/decoder/incremental.h +++ b/decoder/incremental.h @@ -6,6 +6,18 @@ class Hypergraph; -void PassToIncremental(const char *model_file, const std::vector &weights, unsigned int pop_limit, const Hypergraph &hg); +class IncrementalBase { + public: + static IncrementalBase *Load(const char *model_file, const std::vector &weights); + + virtual ~IncrementalBase(); + + virtual void Search(unsigned int pop_limit, const Hypergraph &hg) const = 0; + + protected: + IncrementalBase(const std::vector &weights); + + const std::vector &cdec_weights_; +}; #endif // _INCREMENTAL_H_ -- cgit v1.2.3