Entity Matching by Similarity Join
 
Loading...
Searching...
No Matches
down_sampler.h
Go to the documentation of this file.
1/*
2 * author: Yunqi Li
3 * contact: liyunqixa@gmail.com
4 */
5#ifndef _DOWN_SAMPLER_H_
6#define _DOWN_SAMPLER_H_
7
9#include <random>
10#include <numeric>
11#include <chrono>
12#include <omp.h>
13#include <sys/time.h>
14
15
16class DownSampler : public Sampler
17{
18public:
19 using Sampler::Sampler;
20 ui n{0}; // |S|
21 ui y{0}; // parameter y according to falcon-sigmod2017
22 std::unordered_map<ui, std::vector<ui>> tokenIndex; // inverted index I
23 std::vector<std::pair<int, int>> samplePairs[MAXTHREADNUM];
24
25public:
26 DownSampler() = default;
27 DownSampler(ui _n, ui _y, std::string _blkAttr, bool _isRS) : Sampler(_blkAttr, _isRS), n(_n), y(_y) {
28 std::cout << "spawn down sampler: " << blkAttr << " n: " << n << " y: " << y << " is RS Join: " << isRS << std::endl;
29 }
30 ~DownSampler() = default;
31 DownSampler(const DownSampler &other) = delete;
32 DownSampler(DownSampler &&other) = delete;
33
34public:
35 void sample(const std::string &pathTableA, const std::string &pathTableB);
36};
37
38
39#endif // _DOWN_SAMPLER_H_
Definition down_sampler.h:17
std::vector< std::pair< int, int > > samplePairs[MAXTHREADNUM]
Definition down_sampler.h:23
DownSampler()=default
void sample(const std::string &pathTableA, const std::string &pathTableB)
Definition sampler_impl.cc:50
~DownSampler()=default
DownSampler(DownSampler &&other)=delete
DownSampler(ui _n, ui _y, std::string _blkAttr, bool _isRS)
Definition down_sampler.h:27
ui n
Definition down_sampler.h:20
DownSampler(const DownSampler &other)=delete
std::unordered_map< ui, std::vector< ui > > tokenIndex
Definition down_sampler.h:22
ui y
Definition down_sampler.h:21
Definition base_sampler.h:15
std::string blkAttr
Definition base_sampler.h:17
std::string pathTableA
Definition base_sampler.h:20
std::string pathTableB
Definition base_sampler.h:21
bool isRS
Definition base_sampler.h:18
Sampler()=default
#define MAXTHREADNUM
Definition config.h:38
unsigned int ui
Definition type.h:8