solve a linear system with LU decomposition