Implemented a fallback to Gaussian elimination if Gauss-Seidel exceeds a certain number of iterations.