-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathBinner.h
More file actions
51 lines (45 loc) · 1.19 KB
/
Binner.h
File metadata and controls
51 lines (45 loc) · 1.19 KB
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
#pragma once
namespace hiddenMarkovModel{
class Binner
{
private:
// number of bins
unsigned int size;
// lower boundary
double min;
// upper boundary
double max;
// bin size
double binSize;
public:
// constructor
Binner(unsigned int size, double* dataToFit, unsigned long dataSize);
Binner(unsigned int size, double* dataToFit, unsigned long dataSize, double minValue, double maxValue);
Binner(unsigned int size, double minValue, double maxValue);
/**
* returns the bin to a given value. Throws an exception if the value is out of bound.
*
* @param double value
* @return unsigned int
*/
unsigned int getBinIndex(double value) const;
unsigned int operator [](double value) const;
/**
* returns the middle value of the bin. Throws an exception if the bin is out of bound.
*
* @param unsigned int bin
* @return double
*/
double getBinValue(unsigned int bin) const;
double operator ()(unsigned int bin) const;
/**
* returns the size of the binner
*
* @return int
*/
unsigned int getSize() const;
double getMin() const;
double getMax() const;
double getBinSize() const;
};
}