title: Eigen::SparseQR::matrixQ() hangs forever for a large thin sparse matrix
body: <p>I have a large but sparse matrix <code>B</code>, with size 19068 x 156, and 79884 nonzeros (so about 2.7% of entries are non-zero). I want to compute the kernal of the matrix Bᵀ, so I did a sparse QR decomposition on B. So if B = [Q₁ Q₂] * [R; 0], then Q₂ is a kernal of Bᵀ. I can do the QR decomposition successfully (and very quickly), but when I call SparseQR::matrixQ() function, the program just hangs there for an hour without returning anything.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;Eigen/Sparse&gt;
  #include &lt;Eigen/SparseQR&gt;
  
  int main() {
    // Assume the matrix B is generated somehow. B's size is 19068 x 156
    Eigen::SparseMatrix&lt;double&gt; B = ...;
    // Now do QR decomposition on B.
    Eigen::SparseQR&lt;Eigen::SparseMatrix&lt;double&gt;, Eigen::COLAMDOrdering&lt;int&gt;&gt; qr;
    qr.analyzePattern(B);
    qr.factorize(B);
    if (qr.info() != Eigen::Success) {
      throw std::runtime_error("QR fails.");  // It doesn't throw
    }
    std::cout &lt;&lt; "rank of B is " &lt;&lt; qr.rank() &lt;&lt; "\n"; // rank of B is 156
    Eigen::SparseMatrix&lt;double&gt; Q;
    Q = qr.matrixQ();  // It hangs on this step forever.
    const Eigen::SparseMatrix&lt;double&gt; B_kernal = Q.rightCols(B.rows() - qr.rank());
  }
  </code></pre>
  
  <p>According to <a href="https://eigen.tuxfamily.org/dox/classEigen_1_1SparseQR.html#ae1cc0a836c177d4f42600f8639354be1" rel="nofollow noreferrer">https://eigen.tuxfamily.org/dox/classEigen_1_1SparseQR.html#ae1cc0a836c177d4f42600f8639354be1</a>, calling <code>matrixQ()</code> simply performs a sparse product between the matrix Q and a sparse identity matrix. Why this should be slow?</p>