gsicsum function

Internal function: row and column sums of matrices