class MatrixUtils {

  public static int maxInRow(DoubleMatrix2D A, int row) {
    int index = 0;
    double max = A.getQuick(row, index);
    for (int c = 1; c < A.columns(); c++) {
      if (max < A.getQuick(row, c)) {
        max = A.getQuick(row, c);
        index = c;
      }
    }

    return index;
  }

}