int getIndex(int row, int column) {
        check(row, column);
        return row + (2 * n - (column + 1)) * column / 2;
    }
int getIndex ( int row , int column ) { check ( row , column ) ; return row + ( 2 * n - ( column + 1 ) ) * column / 2 ; }
Checks the row and column indices, and returns the linear data index