When setting up the algo it is useful to note that the different operations on the matrix (here as a 4×4 case with diagonals di and off-diagonals ei) give is an extremely simple algorithm, namely [d1e100e2d2e200e3d3e300e4d4]→[d1e1000˜d2e200e3d3e300e4d4]→[d1e1000˜d2e2000˜d3e300e4d4] and finally [d1e1000˜d2e2000˜d3e3000˜d4]