Class Ranker


  • public class Ranker
    extends Object
    A class to calculate a ranking for an array of given values.
    Author:
    Michael Röder (michael.roeder@uni-paderborn.de)
    • Method Detail

      • rank

        public double[] rank​(double[] values,
                             boolean sortAscending)
        Ranks the values in the given array and replaces the values by their rank.
        Parameters:
        values - an array of the values for which the ranks should be calculated. Note that the values will be replaced by ranks
        sortAscending - a flag indicating whether the values should be sorted in ascending (the lowest value is the best) or descending (the highest value is the best) order.
        Returns:
        The given double array with the calculated ranks
      • createRanks

        private double[] createRanks​(double[] sortedValues,
                                     int startPos,
                                     int endPos,
                                     IntUnaryOperator stepFunction)