示例#1
0
void euclid_lsh::neighbor_row(
    const common::sfv_t& query,
    vector<pair<string, float> >& ids,
    uint64_t ret_num) const {
  neighbor_row_from_hash(
      cosine_lsh(query, hash_num_),
      l2norm(query),
      ids,
      ret_num);
}
示例#2
0
void euclid_lsh::neighbor_row(
    const common::sfv_t& query,
    vector<pair<string, float> >& ids,
    uint64_t ret_num) const {
  util::concurrent::scoped_rlock lk(get_const_table()->get_mutex());

  /* table lock acquired; all subsequent table operations must be nolock */

  neighbor_row_from_hash(
      cosine_lsh(query, hash_num_, threads_, cache_),
      l2norm(query),
      ids,
      ret_num);
}
示例#3
0
storage::bit_vector lsh::hash(const common::sfv_t& sfv) const {
  return cosine_lsh(sfv, bitnum());
}
示例#4
0
void euclid_lsh::set_row(const string& id, const common::sfv_t& sfv) {
  // TODO(beam2d): support nested algorithm, e.g. when used by lof and then we
  // cannot suppose that the first two columns are assigned to euclid_lsh.
  get_table()->add(id, owner(my_id_),
                   cosine_lsh(sfv, hash_num_, threads_, cache_), l2norm(sfv));
}
示例#5
0
void euclid_lsh::set_row(const string& id, const common::sfv_t& sfv) {
  get_table()->add(id, owner(my_id_), cosine_lsh(sfv, hash_num_), l2norm(sfv));
}
示例#6
0
storage::bit_vector lsh::hash(const common::sfv_t& sfv) const {
  return cosine_lsh(sfv, bitnum(), threads_, cache_);
}