title: OpenCV `sortIdx` returning unexpected results
body: <p>I try to use OpenCV <code>sortIdx</code> (in C++ / Objective C) but get unexpected results:</p>
  
  <pre><code>Mat test = (Mat_&lt;double&gt;(1, 6) &lt;&lt; 15.342105,5.000000,27.000000,1.1,2.1,3.1);
  std::cout &lt;&lt; test &lt;&lt; "\n";
  Mat testIdx;
  sortIdx(test, testIdx, CV_SORT_ASCENDING | CV_SORT_EVERY_ROW);
  std::cout &lt;&lt; testIdx &lt;&lt; "\n";
  </code></pre>
  
  <p>This gives output:</p>
  
  <pre><code>[15.342105, 5, 27, 1.1, 2.1, 3.1]
  [3, 4, 5, 1, 0, 2]
  </code></pre>
  
  <p>While I would expect</p>
  
  <pre><code>[15.342105, 5, 27, 1.1, 2.1, 3.1]
  [4, 3, 5, 0, 1, 2]
  </code></pre>
  
  <p>I have no clue why, the normal <code>sort</code> function returns correctly the sorted sequence.</p>