code: public static int[] getOrder(double[] values, boolean descending) {
          return DMatrixUtils.getOrder(values, IntStream.range(0, values.length).toArray(), descending);
      }
docs: Get the order of the elements in descending or ascending order.
  
  @param values A vector of double values.
  @param descending Flag indicating if we go descending or not.
  @return A vector of indices sorted in the provided order.