title: Large sparse linear system solving with SimplicialCholesky Eigen
body: <p>I am actually trying to solve large sparse linear systems using C++ lib Eigen. 
  Sparse matrices are taken from this <a href="https://sparse.tamu.edu/" rel="nofollow noreferrer">page</a>. Each system as this structure: <code>Ax = b</code> where <code>A</code> is the sparse matrix (n x n), <code>b</code> is computed as <code>A*xe</code> with <code>xe</code> vector of dimension n containing only zeros. After computing <code>x</code> I need to compute the relative error between <code>xe</code> and <code>x</code>. I have written some code but I can't understand why the relative error is so high (1.49853e+08) at the end of the computation. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>#include &lt;iostream&gt;
  #include &lt;Eigen/Dense&gt;
  #include &lt;unsupported/Eigen/SparseExtra&gt;
  #include&lt;Eigen/SparseCholesky&gt;
  #include &lt;sys/time.h&gt;
  #include &lt;sys/resource.h&gt;
  
  
  using namespace std;
  using namespace Eigen;
  
  
  int main()
  {
  
      SparseMatrix&lt;double&gt; mat;
      loadMarket(mat, "/Users/anto/Downloads/ex15/ex15.mtx");
  
   VectorXd xe = VectorXd::Constant(mat.rows(), 1);
   VectorXd b = mat*xe;
  
      
      SimplicialCholesky&lt;Eigen::SparseMatrix&lt;double&gt; &gt; chol(mat);
      VectorXd x = chol.solve(b); 
  
      double relative_error = (x-xe).norm()/(xe).norm(); 
      cout &lt;&lt; relative_error &lt;&lt; endl;
      
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>The matrix <code>ex15</code> can be downloaded from this <a href="https://sparse.tamu.edu/FIDAP/ex15" rel="nofollow noreferrer">page</a>. It is a symmetric, positive definite matrix. Can anyone help me to solve the problem? Thank you in advance for your help.</p>