【发布时间】:2017-03-25 00:22:49
【问题描述】:
我正在运行 Cuckoo 过滤器存储库中提供的示例的修改版本:https://github.com/efficient/cuckoofilter/blob/master/example/test.cc
我想给 cuckoo 过滤器添加字符串。虽然添加了字符串,但是当我检查它是否存在于过滤器中时,它总是返回 false。谁能指出我的方法有什么问题?
size_t total_items = 1000000;
CuckooFilter<string, 12> filter(total_items);
// Insert items to this cuckoo filter
string temp1 = "sample";
if (filter.Add(temp1) != cuckoofilter::Ok) {
cout<<"not added"<<endl;
}
// Check if previously inserted items are in the filter
string temp2 = "sample";
assert(filter.Contain(temp2) == cuckoofilter::Ok);
断言应该是真的,但在这种情况下它是假的。为什么?
【问题讨论】: