solve a linear system with a cached LU decomposition