title: Program seems to skip inner for loop
body: <p>I use VS2017 studio community.
  I want to back-substitute a matrix that is already forward-eliminated. So I made the corresponding template function.</p>
  
  <pre><code>template&lt;typename element_type&gt;
  inline void backwardSubstitution(std::vector&lt;std::vector&lt;element_type&gt;&gt; &amp; mat,
  std::vector&lt;element_type&gt;&amp;sol) {
      sol.resize(mat.size());
      unsigned int col_size = mat[0].size();
  
      double numerator ;
      double multiplier;
      for (unsigned int col_id = col_size - 1; col_id &gt; -1; --col_id) {
  
          //INNER LOOP!!!!!!!!!!!!!!!!
          for (unsigned int row_id = mat.size(); (row_id &lt; col_id + 1) &amp;&amp; row_id &gt; -1; --row_id) {
  
              if (row_id == col_id) {
                  numerator = mat[row_id][col_id];
                  mat[row_id][col_id] = 1.;   
                  mat[row_id][col_size] /= numerator;
              }
              else
              {
                  multiplier = -mat[row_id][col_id];
                  mat[row_id][col_id] = 0.;
                  mat[row_id][col_size] += multiplier;
              }
  
              sol[row_id] = mat[row_id][col_size];
          }
      }
      return;
  }//Point to which VS2017 jumps
  </code></pre>
  
  <p>And I tested it with a matrix.</p>
  
  <pre><code>std::vector&lt;std::vector&lt;double&gt;&gt; small_mat3 = {
      { 144.0000, 12.0000, 1.0000, 9.0000 },
      { 0       ,  2.9167, 0.8264, 5.4375 },
      { 0       ,       0,-0.2000,-0.9714 },
  };
  std::vector&lt;double&gt; sol;
  backwardSubstitution(small_mat3, sol);
  std::cout &lt;&lt; std::endl;
  print(small_mat3);//print function I defined.
  for (double element : sol) {
      std::cout &lt;&lt; element &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>The result is as follows:</p>
  
  <p>1) small_mat3: Same as before.</p>
  
  <pre><code>144 12 1 9
  0 2.9167 0.8264 5.4375
  0 0 -0.2 -0.9714
  </code></pre>
  
  <p>2) sol: Same as initialized in backSubstitution().</p>
  
  <pre><code>0
  0
  0
  </code></pre>
  
  <p>Nothing happened. So, I marked the line of the function as a break point and started debugging. And when the step passes by the first loop, that is, when it meets the INNER LOOP, my VS2017 just goes to point right after return command.
  I have made a similar mistake once and then I was told that the condition always was not fulfilled. But the current problem I faces with seems not to be such a thing like that. </p>