jacobi method for matrix