-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHashHist.h
More file actions
37 lines (32 loc) · 750 Bytes
/
Copy pathHashHist.h
File metadata and controls
37 lines (32 loc) · 750 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
// $Id: HashHist.h,v 1.1 2008/08/11 20:45:45 samn Exp $
#ifndef HASH_HIST_H
#define HASH_HIST_H
#include <hash_map>
using namespace std;
struct eqstr
{
bool operator()(const char* s1, const char* s2) const
{
return strcmp(s1, s2);
}
};
typedef hash_map< const char *, int ,hash_compare<const char*, eqstr> > myhash;
typedef myhash::iterator HIT;
class HashHist
{
myhash m_oHash;
int m_iSize;
public:
void Print2Log();
int Count();
int ForceCount();
float Entropy();
bool RemoveVertex(const char* str);
void AddVertex(const char* str);
float Prob(const char* str);
void Clear();
HashHist();
virtual ~HashHist();
float KLDiv(HashHist& Q); // KLDiv from this distribution to Q
};
#endif