17 #ifndef JUBATUS_CORE_STORAGE_LSH_INDEX_STORAGE_HPP_
18 #define JUBATUS_CORE_STORAGE_LSH_INDEX_STORAGE_HPP_
24 #include <msgpack.hpp>
25 #include "jubatus/util/data/unordered_map.h"
26 #include "jubatus/util/data/unordered_set.h"
29 #include "../common/key_manager.hpp"
30 #include "../common/unordered_map.hpp"
31 #include "../framework/mixable_helper.hpp"
45 typedef jubatus::util::data::unordered_map<std::string, lsh_entry>
48 typedef jubatus::util::data::unordered_map<uint64_t, std::vector<uint64_t> >
60 const std::string& row,
61 const std::vector<float>& hash,
68 const std::vector<float>& hash,
72 std::vector<std::pair<std::string, float> >& ids)
const;
74 const std::string&
id,
76 std::vector<std::pair<std::string, float> >& ids)
const;
77 std::string
name()
const;
91 void unpack(msgpack::object o);
93 void get_diff(lsh_master_table_t& diff)
const;
94 bool put_diff(
const lsh_master_table_t& mixed_diff);
95 void mix(
const lsh_master_table_t& lhs, lsh_master_table_t& rhs)
const;
106 const std::vector<float>& hash,
112 jubatus::util::data::unordered_set<uint64_t>& cands)
const;
115 const jubatus::util::data::unordered_set<uint64_t>& cands,
119 std::vector<std::pair<std::string, float> >& ids)
const;
142 #endif // JUBATUS_CORE_STORAGE_LSH_INDEX_STORAGE_HPP_
void get_sorted_similar_rows(const jubatus::util::data::unordered_set< uint64_t > &cands, const bit_vector &query_simhash, float query_norm, uint64_t ret_num, std::vector< std::pair< std::string, float > > &ids) const
framework::linear_mixable_helper< lsh_index_storage, lsh_master_table_t > mixable_lsh_index_storage
storage::version get_version() const
bool put_diff(const lsh_master_table_t &mixed_diff)
void get_diff(lsh_master_table_t &diff) const
void get_all_row_ids(std::vector< std::string > &ids) const
MSGPACK_DEFINE(master_table_, master_table_diff_, lsh_table_, lsh_table_diff_, shift_, table_num_, key_manager_)
void pack(framework::packer &packer) const
bool retrieve_hit_rows(uint64_t hash, size_t ret_num, jubatus::util::data::unordered_set< uint64_t > &cands) const
MSGPACK_DEFINE(lsh_hash, simhash_bv, norm)
void mix(const lsh_master_table_t &lhs, lsh_master_table_t &rhs) const
jubatus::util::data::unordered_map< std::string, lsh_entry > lsh_master_table_t
lsh_table_t lsh_table_diff_
std::vector< float > make_entry(const std::vector< float > &hash, float norm, lsh_entry &entry) const
const lsh_entry * get_lsh_entry(const std::string &row) const
void set_row(const std::string &row, const std::vector< float > &hash, float norm)
size_t all_lsh_num() const
msgpack::packer< jubatus_packer > packer
lsh_master_table_t master_table_diff_
lsh_master_table_t::iterator remove_and_get_row(const std::string &row)
void set_mixed_row(const std::string &row, const lsh_entry &entry)
std::vector< float > shift_
jubatus::util::data::unordered_map< uint64_t, std::vector< uint64_t > > lsh_table_t
void put_empty_entry(uint64_t row_id, const lsh_entry &entry)
void unpack(msgpack::object o)
std::vector< uint64_t > lsh_hash
common::key_manager key_manager_
void similar_row(const std::vector< float > &hash, float norm, uint64_t probe_num, uint64_t ret_num, std::vector< std::pair< std::string, float > > &ids) const
void remove_row(const std::string &row)
lsh_master_table_t master_table_
virtual ~lsh_index_storage()
void remove_model_row(const std::string &row)