max(ja) may not be equal to number of columns like in matrix SparseMatrix(3, 4, {(0, 0): 1, (1, 2): 3}). We would still need to return column. Moreover, these two functions are going to be used only internally, not to be seen outside, so we can break from tradition. I am not able to think of any way to reliably determine number of columns, though we can determine number of rows.