class MatrixUtils {

  public static DoubleMatrix2D sortedRowsView(
      DoubleMatrix2D matrix, IndirectComparator comparator) {
    return matrix.viewSelection(IndirectSort.mergesort(0, matrix.rows(), comparator), null);
  }

}