upper and lower triangular matrix