diff options
author | Kenneth Heafield <github@kheafield.com> | 2012-09-12 12:01:26 +0100 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2012-09-12 12:01:26 +0100 |
commit | 143ba7317dcaee3058d66f9e6558316f88f95212 (patch) | |
tree | 8686672c35ae34340306aa59ebbb55bfcd91702d /klm/search/final.hh | |
parent | dea088773b024d6d5c65eab2883910483f99bc0a (diff) |
Refactor search so that it knows even less, but keeps track of edge pointers
Diffstat (limited to 'klm/search/final.hh')
-rw-r--r-- | klm/search/final.hh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/klm/search/final.hh b/klm/search/final.hh index 24e6f0a5..823b8c1a 100644 --- a/klm/search/final.hh +++ b/klm/search/final.hh @@ -1,18 +1,20 @@ #ifndef SEARCH_FINAL__ #define SEARCH_FINAL__ -#include "search/rule.hh" +#include "search/arity.hh" #include "search/types.hh" #include <boost/array.hpp> namespace search { +class Edge; + class Final { public: typedef boost::array<const Final*, search::kMaxArity> ChildArray; - void Reset(Score bound, const Rule &from, const Final &left, const Final &right) { + void Reset(Score bound, const Edge &from, const Final &left, const Final &right) { bound_ = bound; from_ = &from; children_[0] = &left; @@ -21,16 +23,14 @@ class Final { const ChildArray &Children() const { return children_; } - unsigned int ChildCount() const { return from_->Arity(); } - - const Rule &From() const { return *from_; } + const Edge &From() const { return *from_; } Score Bound() const { return bound_; } private: Score bound_; - const Rule *from_; + const Edge *from_; ChildArray children_; }; |