summaryrefslogtreecommitdiff
path: root/klm/util/sorted_uniform.hh
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2011-01-25 22:30:48 +0200
committerChris Dyer <cdyer@cs.cmu.edu>2011-01-25 22:30:48 +0200
commit931a036dc3cf9e1deafc10e78e94a0ebe3c8004f (patch)
tree9e1935fc4deafdbd04a8d38835c91b57f359cdee /klm/util/sorted_uniform.hh
parentbee6a3c3f6c54cf7449229488c6124dddc7e2f31 (diff)
update kenlm
Diffstat (limited to 'klm/util/sorted_uniform.hh')
-rw-r--r--klm/util/sorted_uniform.hh10
1 files changed, 10 insertions, 0 deletions
diff --git a/klm/util/sorted_uniform.hh b/klm/util/sorted_uniform.hh
index a8e208fb..05826b51 100644
--- a/klm/util/sorted_uniform.hh
+++ b/klm/util/sorted_uniform.hh
@@ -62,6 +62,7 @@ template <class PackingT> class SortedUniformMap {
public:
typedef PackingT Packing;
typedef typename Packing::ConstIterator ConstIterator;
+ typedef typename Packing::MutableIterator MutableIterator;
public:
// Offer consistent API with probing hash.
@@ -113,6 +114,15 @@ template <class PackingT> class SortedUniformMap {
*size_ptr_ = (end_ - begin_);
}
+ // Don't use this to change the key.
+ template <class Key> bool UnsafeMutableFind(const Key key, MutableIterator &out) {
+#ifdef DEBUG
+ assert(initialized_);
+ assert(loaded_);
+#endif
+ return SortedUniformFind<MutableIterator, Key>(begin_, end_, key, out);
+ }
+
// Do not call before FinishedInserting.
template <class Key> bool Find(const Key key, ConstIterator &out) const {
#ifdef DEBUG