title: Segmentation fault in running AGMG
body: <p>I have linked a C++ program with fortran dagmg.f90 routine from AGMG library. Initially the sparse matrix is built by Eigen library in CRS format and then i convert it to the required format for fortran routine. AGMG runs and calculates the number of non-zeros and displays the number of unknowns. But then it suddenly displays segmentation fault. I am unable to figure out what is the reasons behind it. </p>
  
  <pre><code>    int jatest[NNZ];
  int iatest[nodes+1];
  double bftest[nodes];
  double VXtest[nodes];
  // code to convert Af into a, ja, ia vectors for AGMG
  double *aptr; int* japtr; int* iaptr;
  aptr = Af.valuePtr();
  japtr = Af.innerIndexPtr();
  iaptr = Af.outerIndexPtr();
  for (i = 0; i &lt; NNZ ; i++ ){
    atest[i] = aptr[i];
    jatest[i] = japtr[i] + 1;
   // cout &lt;&lt; atest[i] &lt;&lt; "\t" &lt;&lt; japtr[i] &lt;&lt; endl;
  }
  for ( i = 0; i &lt;= nodes; i++){
    iatest[i] = iaptr[i] + 1;
     }
   dagmg_(nodes,atest,jatest,iatest,bftest,VXtest,ijob,iprint,nrest,iter,tol);
  </code></pre>
  
  <p>The output looks like this:</p>
  
  <p>*<strong><em>ENTERING AGMG *</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**</strong></p>
  
  <p><em><strong></em>        Number of unknowns:          17
  **</strong>                 Nonzeros :          51 (per row:   3.00)</p>
  
  <p>Segmentation fault</p>
  
  <p>Why am i getting this fault ??? </p>