public class Rank
extends java.lang.Object
Most of the code is based on the code developed by algolist which can be found below.
Constructor and Description |
---|
Rank() |
Modifier and Type | Method and Description |
---|---|
static int[] |
getRanks(double[] arrayToSort,
boolean highestIsOne,
RankingType typeOfRanking,
int precision)
Returns the ranks.
|
static double |
roundToDecimals(double d,
int c) |
public static int[] getRanks(double[] arrayToSort, boolean highestIsOne, RankingType typeOfRanking, int precision)
arrayToSort
- The Array To sort (DMU Objectives)highestIsOne
- A boolean. If true, specifies that the highest values of the ArrayToSort
should be '1' (i.e. first).precision
- An int value to specify at which decimal place the scores need to be rounded up prior to been ranked.
This is important as most of the scores of the 'efficient' DMUs are not 1 but some value very close to 1
(e.g. 1.00000000000002).
All precisions between 0 and 16 are taken into account, any other int value would leave the scores unchanged.public static double roundToDecimals(double d, int c)