forked from nmeisburger/LSH-Tables
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLSH.h
More file actions
42 lines (28 loc) · 984 Bytes
/
LSH.h
File metadata and controls
42 lines (28 loc) · 984 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#pragma once
#include "Reservoir.h"
#include <iostream>
#include <omp.h>
#include <vector>
class LSH {
private:
unsigned int L;
unsigned int reservoir_size;
unsigned int range_pow;
unsigned int range;
Reservoir **reservoirs;
public:
LSH();
//num_items is the number of items we're inserting
// items is a pointer to the first item in an array of tems.
// hashes is a pointer to an array of all the k*L hashes.
//puts in all the hashes we need to hash
void insert(unsigned int num_items, unsigned int *items, unsigned int *hashes);
void insert(unsigned int item, unsigned int *hashes);
void retrieve(unsigned int num_query, unsigned int *hashes, unsigned int *results_buffer);
void top_k(unsigned int num_query, unsigned int top_k, unsigned int *hashes,
unsigned int *selection);
void reset();
void view();
void add_random_items(unsigned int num_items, bool verbose);
~LSH();
};