title: Best way to exchange matrix rows?
body: <p>Working with two dimensional arrays, I want to find a way to avoid actually swapping rows of a matrix and just change the indices of the rows. I found <a href="https://stackoverflow.com/questions/4121149/how-to-sort-3d-array-in-c-with-each-row-is-specific-to-one-entry-if-1d-array">this question</a> but the answer includes swapping the rows and seems to take just as much time.</p>
  
  <p>and if there isn't any way to change the indices, what other way would you suggest for making row/column swapping less time consuming?</p>
  
  <p>PS.
  this is how I have defined the Matrix:</p>
  
  <pre><code>float[,] Ab = new float[,] 
              {
              {1,4,-2,104},
              {3,5,100,90},
              {2,-3,48,2},
              };
  </code></pre>
  
  <p>and I want it to be sorted by a vector like this: [3 2 1], so the result would be</p>
  
  <pre><code>Ab =    {
          {2,-3,48,2},
          {3,5,100,90},
          {1,4,-2,104},     
          };
  </code></pre>