title: Solve linear system using iterative method with solveWithGuess and a sparse b vector in Eigen
body: <p>I am currently using Eigen 3.4.0 to solve linear systems of equations <code>Ax=b</code> where both <code>A</code> and <code>b</code> are sparse. I am using the BiCGSTAB method, which is iterative, like so:</p>
  <pre><code>Eigen::SparseMatrix&lt;double&gt; A;
  Eigen::SparseVector&lt;double&gt; b;
  
  Eigen::BiCGSTAB&lt;SparseMat, Eigen::IncompleteLUT&lt;double&gt;&gt; solver;
  solver.compute(A);
  Eigen::SparseVector&lt;double&gt; x = solver.solve(b).eval();
  </code></pre>
  <p>Turns out, in some cases I may have an initial guess that I can give to the solver (also a sparse vector). So my first instinct was to do this:</p>
  <pre><code>Eigen::SparseVector&lt;double&gt; x0;
  Eigen::BiCGSTAB&lt;SparseMat, Eigen::IncompleteLUT&lt;double&gt;&gt; solver;
  solver.compute(A);
  Eigen::SparseVector&lt;double&gt; x = solver.solveWithGuess(b, x0).eval();
  </code></pre>
  <p>But I get the error <code>No matching member function for call to 'solveWithGuess'</code>. Alright, why? So I tried this code:</p>
  <pre><code>Eigen::SparseVector&lt;double&gt; sv;
  VectorXd dv;
  
  solver.solveWithGuess(sv, dv); // ERROR
  solver.solveWithGuess(dv, sv); // OK
  solver.solveWithGuess(sv, sv); // ERROR
  solver.solveWithGuess(dv, dv); // OK
  </code></pre>
  <p>Apparently, even though I can call <code>solve</code> with a sparse <code>b</code> vector, I must call <code>solveWithGuess</code> with a dense <code>b</code> vector. Why? And is my only option really to convert <code>b</code> into a dense vector before calling <code>solveWithGuess</code>? That's very inefficient.</p>