-
Notifications
You must be signed in to change notification settings - Fork 5
/
hash.hh
75 lines (55 loc) · 1.93 KB
/
hash.hh
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//*****************************************************************/
//
// Copyright (C) 2006-2009 Seung-Jin Sul
//
// Department of Computer Science
// Texas A&M University
// Contact: [email protected]
//
// CLASS DEFINITION
// HashRFMap: Class for hashing bitstrings
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details (www.gnu.org).
//
//*****************************************************************/
#ifndef HASHRFMYHASH_HH
#define HASHRFMYHASH_HH
#include <map>
#include <vector>
#include "hashfunc.hh"
using namespace std;
typedef struct {
unsigned long long _hv2;
unsigned int _t_i;
float _dist;
} BUCKET_STRUCT_T;
typedef vector<BUCKET_STRUCT_T> V_BUCKET_T;
typedef vector<V_BUCKET_T> HASHTAB_T;
typedef struct {
unsigned long long _hv2;
vector<unsigned int> _vec_treeidx;
vector<float> _vec_dist;
} TREEIDX_STRUCT_T;
typedef vector<TREEIDX_STRUCT_T> V_BUCKET_T2;
typedef vector<V_BUCKET_T2> HASHTAB_T2;
class HashRFMap {
public:
HashRFMap() {}
~HashRFMap() {}
CHashFunc _HF;
HASHTAB_T _hashtab; // for weighted RF
HASHTAB_T2 _hashtab2;
void hashing_bs_without_type2_nbits(unsigned int tree_i, unsigned int num_taxa, unsigned long long hv1, unsigned long long hv2, float dist, bool w_option); // fast hash-rf
void uhashfunc_init(unsigned int t, unsigned int n, unsigned int c);
void uhashfunc_init(unsigned int t, unsigned int n, unsigned int c, int32 newseed);
void hashrfmap_clear();
};
#endif