fix bug. tridiagonal matrix is wrong previously.