MINT2
HyperBinningMakerMint.cpp
Go to the documentation of this file.
2 
3 
4 HyperBinningMakerMint::HyperBinningMakerMint(const HyperCuboid& binningRange,const HyperPointSet& data, int startingDim) :
5  HyperBinningMaker(binningRange, data),
6  _startingDim(startingDim)
7 {
8  WELCOME_LOG << "Good day from the HyperBinningMakerMint() Constructor"<<std::endl;
9  //makeBinning(startingDim);
10 }
11 
13 
14  int dimension = _binningDimensions.size();
15 
16  int splitDim = _startingDim;
17  if (splitDim >= dimension) splitDim = 0;
18 
19  int nBins = 0;
20  int unchanged = 0;
21 
22  if (s_printBinning == true) INFO_LOG << "Splitting all bins in dimension " << _binningDimensions.at(splitDim) <<std::endl;
23 
24  while ( splitAll(_binningDimensions.at(splitDim), 0.5) != 0){
25  if (nBins == getNumBins()) unchanged++;
26  else unchanged = 0;
27  if (unchanged >= dimension) break;
28  nBins = getNumBins();
29  if (s_printBinning == true) INFO_LOG << "There is now a total of " << nBins << " bins" << std::endl;
30  splitDim++;
31  if( splitDim == dimension ) splitDim = 0;
32  if (s_printBinning == true) INFO_LOG << "Trying to split all bins in dimension " << _binningDimensions.at(splitDim) <<std::endl;
33  }
34 
35  if (s_printBinning == true) INFO_LOG << "Mint binning algorithm complete " <<std::endl;
36 
37 }
38 
40  GOODBYE_LOG << "Goodbye from the HyperBinningMakerMint() Constructor" <<std::endl;
41 }
#define INFO_LOG
static bool s_printBinning
HyperBinningMakerMint(const HyperCuboid &binningRange, const HyperPointSet &data, int startingDim=0)
int splitAll(int dimension, double splitPoint)
#define GOODBYE_LOG
#define WELCOME_LOG
std::vector< int > _binningDimensions