diff options
author | Kenneth Heafield <github@kheafield.com> | 2012-10-22 14:04:27 +0100 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2012-10-22 14:04:27 +0100 |
commit | 0ff82d648446645df245decc1e9eafad304eb327 (patch) | |
tree | 0806d429e4f12b672fd6d0461ba8165679bf424d /klm/search/source.hh | |
parent | 5f98fe5c4f2a2090eeb9d30c030305a70a8347d1 (diff) |
Update search, make it compile
Diffstat (limited to 'klm/search/source.hh')
-rw-r--r-- | klm/search/source.hh | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/klm/search/source.hh b/klm/search/source.hh deleted file mode 100644 index 11839f7b..00000000 --- a/klm/search/source.hh +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef SEARCH_SOURCE__ -#define SEARCH_SOURCE__ - -#include "search/types.hh" - -#include <assert.h> -#include <vector> - -namespace search { - -template <class Final> class Source { - public: - Source() : bound_(kScoreInf) {} - - Index Size() const { - return final_.size(); - } - - Score Bound() const { - return bound_; - } - - const Final &operator[](Index index) const { - return *final_[index]; - } - - Score ScoreOrBound(Index index) const { - return Size() > index ? final_[index]->Total() : Bound(); - } - - protected: - void AddFinal(const Final &store) { - final_.push_back(&store); - } - - void SetBound(Score to) { - assert(to <= bound_ + 0.001); - bound_ = to; - } - - private: - std::vector<const Final *> final_; - - Score bound_; -}; - -} // namespace search -#endif // SEARCH_SOURCE__ |