You can calculate the maximum `rowSum` without allocating this vector similarly to what you do for `p=1`.