summaryrefslogtreecommitdiff
path: root/klm/search/final.hh
diff options
context:
space:
mode:
Diffstat (limited to 'klm/search/final.hh')
-rw-r--r--klm/search/final.hh39
1 files changed, 39 insertions, 0 deletions
diff --git a/klm/search/final.hh b/klm/search/final.hh
new file mode 100644
index 00000000..1b3092ac
--- /dev/null
+++ b/klm/search/final.hh
@@ -0,0 +1,39 @@
+#ifndef SEARCH_FINAL__
+#define SEARCH_FINAL__
+
+#include "search/arity.hh"
+#include "search/note.hh"
+#include "search/types.hh"
+
+#include <boost/array.hpp>
+
+namespace search {
+
+class Final {
+ public:
+ typedef boost::array<const Final*, search::kMaxArity> ChildArray;
+
+ void Reset(Score bound, Note note, const Final &left, const Final &right) {
+ bound_ = bound;
+ note_ = note;
+ children_[0] = &left;
+ children_[1] = &right;
+ }
+
+ const ChildArray &Children() const { return children_; }
+
+ Note GetNote() const { return note_; }
+
+ Score Bound() const { return bound_; }
+
+ private:
+ Score bound_;
+
+ Note note_;
+
+ ChildArray children_;
+};
+
+} // namespace search
+
+#endif // SEARCH_FINAL__