title: What does "X += nb; Y+= nb;" mean if X and Y are two vectors and nb is an integer?
body: <p>at page 8 of the paper :
    [Reducing floating point error in dot product using the superblock family of algorithms- Anthony M. Castaldo , R.Clint Whaley, and Anthony T. Chronopouos][1]</p>
  
  <p>there is the following code:</p>
  
  <pre><code>typedef double scalar;
  typedef scalar *Vec;
  scalar dotProd(Vec X, Vec Y, int nb)
  {  int n = X.length;
     int nblks = n / nb;
     int nsblks = sqrt(nblks);
     int blksInSblk = nblks / nsblks;
     scalar dot = 0.0, sdot, cdot;
  
     for (s=0; s &lt; nsblks; s++)
     {  sdot = 0.0;
        for (b=0; b &lt; blksInSblk; b++)
        {
           cdot = X[0] * Y[0];
           for (i=1; i &lt; nb; i++)
              cdot += X[i] * Y[i];
           sdot += cdot;
           X += nb; Y += nb;
        }
        dot += sdot;
     }
     return dot;
  }
  </code></pre>
  
  <p>I do not understand this line of the pseudocode:</p>
  
  <pre><code>X += nb; Y+= nb;
  </code></pre>
  
  <p>What does it mean if <code>X</code> and <code>Y</code> are two vectors and <code>nb</code> is an integer?</p>
  
  <p><strong>Addendum</strong>: if not using pointers, how to "increment" by <code>nb</code> elements?</p>
  
  <pre><code>int n = x.size();
  int nblks = n / nb;
  
  int nsblks = sqrt(nblks);
  int blksInSblk = nblks / nsblks;
  double dot = 0.0;
  double sdot = 0.0;
  double cdot = 0.0;
  for(int s=0;s&lt;nsblks;s++) {
    std::cout &lt;&lt; "iteration s= " &lt;&lt; s &lt;&lt; std::endl;
    for(int b=0;b&lt;blksInSblk;b++) {
      std::cout &lt;&lt; "iteration b= " &lt;&lt; b &lt;&lt; std::endl;
      cdot += x(0) * y(0);
      std::cout &lt;&lt; "cdot += x(0) * y(0) = " &lt;&lt; cdot &lt;&lt; std::endl;
         int pointingTo = 0;
        for(int i=pointingTo;i&lt;nb;i++) {
          cdot += x(i) * y(i);
        }
        sdot += cdot;
        // Increment the pointer to x by nb elements:
        // x += nb;
        pointingTo += nb;
        // Increment the pointer to y by nb elements;
        // y += nb
      //}
    }
    dot += sdot;
  }
  </code></pre>