title: segmentation fault when calling a function
body: <p>Segmentation fault when calling the Update_Multiplier and gdb debugger shows these:</p>
  
  <blockquote>
    <p>Program received signal SIGSEGV, Segmentation fault.
    0x080b74e8 in Update_Multiplier() ()</p>
  </blockquote>
  
  <pre><code>double upperbound = 116325;
  double objective = 1.1707e+07;
  int main()
  {
      Update_Multiplier();
  }
  void Update_Multiplier()
  {
      cout &lt;&lt; "function 0" &lt;&lt; endl;
      // Determine subgradient vectors
      double gra[1000][1000];
      double grb[1000][1000];
      double dumX = 0;
      double stepsize[1000][1000];
      double tuning=2;
      double LRADum[1000][1000];
      double LRBDum[1000][1000];
  
      cout &lt;&lt; "function 1" &lt;&lt; endl;
      // update subgradient vectors
      for (int i=1; i&lt;=noOfNodes; i++)
      {
          for (int j=1; j&lt;=noOfNodes; j++)
          {
              if (C[i][j] != 0)
              {
                  dumX=0;
                  for (int p=1; p&lt;=noOfCommodity; p++)
                  {
                      dumX += X[i][j][p];
                  }
                  gra[i][j]=dumX-U[i][j]*Y[i][j]-Q[i][j];
                  grb[i][j]=Q[i][j]-B[i][j]*Y[i][j];
              }
          }
      }
  
      // update stepsize
      cout &lt;&lt; "function 2" &lt;&lt; endl;
      for (int i=1; i&lt;=noOfNodes; i++)
      {
          for (int j=1; j&lt;=noOfNodes; j++)
          {
              if (C[i][j] != 0)
              {
                  stepsize[i][j]=(tuning*(UpperBound-Objective))/sqrt((gra[i][j]*gra[i][j])*(grb[i][j]*grb[i][j]));
                  LRADum[i][j]=LRA[i][j]+stepsize[i][j]*gra[i][j];
                  LRA[i][j]=LRADum[i][j];
                  LRBDum[i][j]=LRB[i][j]+stepsize[i][j]*grb[i][j];
                  LRB[i][j]=LRBDum[i][j];
  
              }
          }
      }
  
  }
  </code></pre>