Matrix -> upper triangular matrix