1 #ifndef UTIL__HISTOGRAM_BINNING__HPP
2 #define UTIL__HISTOGRAM_BINNING__HPP
73 m_iNumBins = num_bins;
92 m_mapValueToTotalAppearances[the_number] += num_appearances;
98 m_mapValueToTotalAppearances.clear();
106 Uint8 total_appearances_arg );
135 eHistAlgo_Default = eHistAlgo_IdentifyClusters
150 TListOfBins* CalcHistogram(
151 EHistAlgo eHistAlgo = eHistAlgo_Default)
const;
187 eInitStatus_KeepGoing
204 EInitStatus x_InitializeHistogramAlgo(
205 TListOfBins & out_listOfBins,
206 Uint8 & out_num_bins)
const;
Given a set of integer data, this will bin the data for use in histograms.
void SetNumBins(Uint8 num_bins)
This should not normally be needed, since number of bins is usually picked in the constructor.
Uint8 m_iNumBins
The number of bins to aim for the next time CalcHistogram is called.
vector< SBin > TListOfBins
A histogram is given as a vector of bins.
CHistogramBinning(const CHistogramBinning &)
forbid copying
void AddNumber(TValue the_number, Uint8 num_appearances=1)
Give this histogram another number to bin.
Int8 TValue
The numeric type this bins.
TMapValueToTotalAppearances m_mapValueToTotalAppearances
Maps a value to the number of times it appears, for the data given so far.
EInitStatus
shared by the various histogram algos
@ eInitStatus_AllAlgoWorkDone
This indicates that x_InitializeHistogramAlgo has done all the work required of it and the caller can...
void clear(void)
This clears all data given to the object.
EHistAlgo
Pick which binning algorithm to use when generating the histogram.
@ eHistAlgo_TryForSameNumDataInEachBin
This algorithm tries to make each bin roughly even in size, except the last bin which may be much sma...
@ eHistAlgo_IdentifyClusters
This algorithm tries to make each bin represent values that are clustered together.
map< TValue, Uint8 > TMapValueToTotalAppearances
Maps each value (e.g.
CHistogramBinning(Uint8 num_bins=0)
Constructor.
int64_t Int8
8-byte (64-bit) signed integer
uint64_t Uint8
8-byte (64-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Miscellaneous common-use basic types and functionality.
NCBI_XUTIL_EXPORT
Parameter to control printing diagnostic message about conversion of static array data from a differe...
Holds the information about a bin.
Uint8 total_appearances
The total number of data points in this bin for all values from first_number to last_number.
TValue first_number
The start range of the bin (inclusive)
TValue last_number
The end range of the bin (inclusive)