Class MatrixBasedHistogram


  • public class MatrixBasedHistogram
    extends java.lang.Object
    MatrixBasedHistogram

    Modest v. Korff

    Created by korffmo1 on 21.12.18.

    • Field Detail

      • VERBOSE

        public static boolean VERBOSE
    • Constructor Detail

      • MatrixBasedHistogram

        public MatrixBasedHistogram()
    • Method Detail

      • getFromQuadraticMatrix

        public static Histogram getFromQuadraticMatrix​(Matrix ma,
                                                       double min,
                                                       double max,
                                                       int bins)
      • getHistogram

        public static Matrix getHistogram​(Matrix ma,
                                          Matrix maHistogramBins)
        Parameters:
        ma - matrix values are written into the histogram
        maHistogramBins - matrix with two rows row 1: lower bins; row 2: upper bins.
        Returns:
        matrix with 3 rows. Row 0 lower bins, row 1: upper bins, row 2 frequency.
      • getHistogram

        public static Matrix getHistogram​(double[] arrValues,
                                          Matrix maHistogramBins)
      • getHistogram

        public static Matrix getHistogram​(Matrix maHistogramBins)
      • getBordersMostFreqOccBin

        public static double[] getBordersMostFreqOccBin​(Matrix maHistogram,
                                                        int radius)
        Gets the upper and lower limit of the most occupied bin.
        Parameters:
        maHistogram -
        radius - so many bins are taken from the left and the right.
        Returns:
        arr[0]: lower limit, arr[1]: upper limit
      • getHistogram

        public static Matrix getHistogram​(float[] ma,
                                          Matrix maHistogramBins)
      • getHistogram

        public static Matrix getHistogram​(float[][] ma,
                                          int col,
                                          Matrix maHistogramBins)
      • getHistogram

        public static Matrix getHistogram​(Matrix ma,
                                          int numBins)
      • getMinOccBin

        public static double getMinOccBin​(Matrix maHist)
        Parameters:
        maHist - histogram
        Returns:
        the lower limit of the first occupied bin in the histogram.
      • getMaxOccBin

        public static double getMaxOccBin​(Matrix maHist)
        Parameters:
        maHist - histogram
        Returns:
        the higher limit of the last occupied bin in the histogram.
      • getHistogramBins

        public static Matrix getHistogramBins​(double dMin,
                                              double dMax,
                                              int iNumBins)
        Parameters:
        dMin - smallest value to put into the histogram
        dMax - maximum value to be considered.
        iNumBins - number of bins, between min and max.
        Returns:
        matrix with two rows, the lower and upper bins. The last bin is a little bit bigger than the other bins. So the highest value fits into it.
      • writeHistogram

        public static void writeHistogram​(java.lang.String sFile,
                                          Matrix hist,
                                          boolean bApppend,
                                          int digits,
                                          int totalWidth)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • histogram2String

        public static java.lang.String histogram2String​(Matrix hist,
                                                        int digits,
                                                        int totalWidth)
        Parameters:
        hist -
        digits -
        totalWidth - for one number.
        Returns: