-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstats.h
40 lines (33 loc) · 930 Bytes
/
stats.h
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
#ifndef __STATS_H
#define __STATS_H
#include<iostream>
#include<vector>
using namespace std;
class iterstat{
public:
iterstat(int nc=0, int nl=0, int nm=0, double tt=0.0, double aa=0.0):
numcand(nc), numlarge(nl), nummax(nm), time(tt), avgtid(aa){}
int numcand;
int numlarge;
int nummax;
double time;
double avgtid;
};
class Stats: public vector<iterstat>{
public:
static double sumtime;
static int sumcand;
static int sumlarge;
static int summax;
static int numjoin;
static double tottime;
//Stats();
void add(iterstat &is);
void add(int cand, int freq, double time, int max=0, double avgtid=0.0);
void incrcand(unsigned int pos, int ncand=1);
void incrlarge(unsigned int pos, int nlarge=1);
void incrmax(unsigned int pos, int nmax=1);
void incrtime(unsigned int pos, double ntime);
friend ostream& operator << (ostream& fout, Stats& stats);
};
#endif