<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: 1D array sort not working (7.0) in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174706#M102403</link>
    <description>&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/11082"&gt;@Gabriela&lt;/a&gt; Tillmann wrote:&lt;BR /&gt;Thanks again for your time.&lt;BR /&gt;So it is a bug. And I thought that all sorting algorithms were weatherproof since ages.....&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Gabi,&lt;BR /&gt;&lt;BR /&gt;Last spring, some of us have studied sorting algorithms in quite some detail, as it was needed for the &lt;A href="http://www.ni.com/devzone/lvzone/codechallenge8.htm" target="_blank"&gt;Median Coding Challenge&lt;/A&gt; (&lt;A href="http://www.ni.com/devzone/lvzone/codechallenge8_results.htm" target="_blank"&gt;see the results&lt;/A&gt;).&lt;BR /&gt;&lt;BR /&gt;While it is easy to write a dumb sorting algorithm, it is quite challenging if you want it to be very, very fast even with "pathological" input arrays (sorted, reverse sorted, patterned). My wild guess is that the pivot selection algorithm somehow hits a weird edge effect in the LabVIEW 7.0 version of the code.&lt;BR /&gt;&lt;BR /&gt;Some other interesting observations: If you "rotate" your input array (no size change), the result is incorrect for rotations or 0 to -8 and some show only very subtle errors, not directly visible in the graph. Most other rotations I tried yield the correct result.&lt;BR /&gt;&lt;BR /&gt;I think the error is rare enough that two " Sort 1D array" in series will always produce a correct result. The first step will remove the strong "pattern" in the input, which is most likely the cause of the problem. Of course you could also write your own sorting VI directly in G. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
    <pubDate>Thu, 13 Jan 2005 17:42:12 GMT</pubDate>
    <dc:creator>altenbach</dc:creator>
    <dc:date>2005-01-13T17:42:12Z</dc:date>
    <item>
      <title>1D array sort not working (7.0)</title>
      <link>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174351#M102231</link>
      <description>We moved a couple of months from LV 6.0.2 to 7.0. A further update is currently not possible.&lt;BR /&gt;&lt;BR /&gt;I came across an error I never imagined possible. The built in function "1D sort" gives not the correct result for a certain input sequence.&lt;BR /&gt;&lt;BR /&gt;In my program I concatenated two previously sorted arrays ( in the original clusters) and did a resort. In both arrays could be duplicates so this input far from random.&lt;BR /&gt;&lt;BR /&gt;The built in function is doing some sorting but a one point their is a break and than the sorting stops.&lt;BR /&gt;&lt;BR /&gt;Doing the same in LV 6.0.2 works as expected.&lt;BR /&gt;Doing a second sort helps (but always ?)&lt;BR /&gt;&lt;BR /&gt;Can someone please confirm this and test it with LV 7.1&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Gabi</description>
      <pubDate>Wed, 12 Jan 2005 16:12:40 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174351#M102231</guid>
      <dc:creator>GabbyG</dc:creator>
      <dc:date>2005-01-12T16:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: 1D array sort not working (7.0)</title>
      <link>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174353#M102233</link>
      <description>Sorry I forgot to include the program.&lt;BR /&gt;&lt;BR /&gt;The sequence in question is made the default data.&lt;BR /&gt;&lt;BR /&gt;GT</description>
      <pubDate>Wed, 12 Jan 2005 16:21:48 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174353#M102233</guid>
      <dc:creator>GabbyG</dc:creator>
      <dc:date>2005-01-12T16:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: 1D array sort not working (7.0)</title>
      <link>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174354#M102234</link>
      <description>Sorry I forgot to include the program.&lt;BR /&gt;&lt;BR /&gt;The sequence in question is made the default data.&lt;BR /&gt;&lt;BR /&gt;GT</description>
      <pubDate>Wed, 12 Jan 2005 16:23:17 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174354#M102234</guid>
      <dc:creator>GabbyG</dc:creator>
      <dc:date>2005-01-12T16:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: 1D array sort not working (7.0)</title>
      <link>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174367#M102241</link>
      <description>Seems to work good in 7.1&lt;BR /&gt;See attachment provided...</description>
      <pubDate>Wed, 12 Jan 2005 16:55:06 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174367#M102241</guid>
      <dc:creator>Don_Phillips</dc:creator>
      <dc:date>2005-01-12T16:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: 1D array sort not working (7.0)</title>
      <link>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174448#M102276</link>
      <description>&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Maelstrom wrote:&lt;BR /&gt;Seems to work good in 7.1&lt;BR /&gt;See attachment provided...&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for trying it. I had a doublecheck with a random sequence. Please push the button to use the non-random sequence.&lt;BR /&gt;&lt;BR /&gt;GT</description>
      <pubDate>Wed, 12 Jan 2005 21:02:50 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174448#M102276</guid>
      <dc:creator>GabbyG</dc:creator>
      <dc:date>2005-01-12T21:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: 1D array sort not working (7.0)</title>
      <link>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174449#M102277</link>
      <description>Sure no problem, non-random sequence:</description>
      <pubDate>Wed, 12 Jan 2005 21:08:10 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174449#M102277</guid>
      <dc:creator>Don_Phillips</dc:creator>
      <dc:date>2005-01-12T21:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: 1D array sort not working (7.0)</title>
      <link>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174451#M102279</link>
      <description>He instalado tu programa en mi versión de LabView 7 Express y no me ha presentado ningún problema en su ejecución, inclusive ejecutando la función non-random q mencionas.  De pronto se puede pensar en limitaciones en la versión q usas, algunas versiones nuevas liberadas no contienen todas las funciones.</description>
      <pubDate>Wed, 12 Jan 2005 21:18:39 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174451#M102279</guid>
      <dc:creator>Freddy.A.</dc:creator>
      <dc:date>2005-01-12T21:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: 1D array sort not working (7.0)</title>
      <link>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174480#M102287</link>
      <description>I can confirm this to be abug in LabVIEW 7.0, while in LabVIEW 7.1 it works correctly.&lt;BR /&gt;&lt;BR /&gt;If you add another sort as indicated in the figure, LabVIEW 7.0 also works correctly. Very strange!&lt;BR /&gt;&lt;BR /&gt;Time to upgrade! &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Wed, 12 Jan 2005 23:07:11 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174480#M102287</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2005-01-12T23:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: 1D array sort not working (7.0)</title>
      <link>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174481#M102288</link>
      <description>There seems to be a specific problem with your size 744 array (your presorted array). If you either add an element or remove the last element, it behaves correctly.&lt;BR /&gt;&lt;BR /&gt;I have attached an image demonstrating your problem with a minimal VI. Sorting only once scrambles the data above 500 as seen in the second graph.</description>
      <pubDate>Wed, 12 Jan 2005 23:26:14 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174481#M102288</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2005-01-12T23:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: 1D array sort not working (7.0)</title>
      <link>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174531#M102315</link>
      <description>Thanks again for your time.&lt;BR /&gt;So it is a bug. And I thought that all sorting algorithms were weatherproof since ages.....&lt;BR /&gt;&lt;BR /&gt;I checked again for different behaviour with a different size of the array.&lt;BR /&gt;First it seems that if you increase or decrease it works sometimes. But if you change values in the input sequence you run again into errors.&lt;BR /&gt;&lt;BR /&gt;I altered one value to be completly out of sequence from the rest and again I got an error. It is not so obvious to be spotted in the graphs, but my checker that I included afterwards finds it.&lt;BR /&gt;&lt;BR /&gt;Upgrading is not a question of time only. Unfortunatly money is also involved &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Gabi</description>
      <pubDate>Thu, 13 Jan 2005 08:01:43 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174531#M102315</guid>
      <dc:creator>GabbyG</dc:creator>
      <dc:date>2005-01-13T08:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: 1D array sort not working (7.0)</title>
      <link>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174706#M102403</link>
      <description>&lt;BR /&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/11082"&gt;@Gabriela&lt;/a&gt; Tillmann wrote:&lt;BR /&gt;Thanks again for your time.&lt;BR /&gt;So it is a bug. And I thought that all sorting algorithms were weatherproof since ages.....&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Gabi,&lt;BR /&gt;&lt;BR /&gt;Last spring, some of us have studied sorting algorithms in quite some detail, as it was needed for the &lt;A href="http://www.ni.com/devzone/lvzone/codechallenge8.htm" target="_blank"&gt;Median Coding Challenge&lt;/A&gt; (&lt;A href="http://www.ni.com/devzone/lvzone/codechallenge8_results.htm" target="_blank"&gt;see the results&lt;/A&gt;).&lt;BR /&gt;&lt;BR /&gt;While it is easy to write a dumb sorting algorithm, it is quite challenging if you want it to be very, very fast even with "pathological" input arrays (sorted, reverse sorted, patterned). My wild guess is that the pivot selection algorithm somehow hits a weird edge effect in the LabVIEW 7.0 version of the code.&lt;BR /&gt;&lt;BR /&gt;Some other interesting observations: If you "rotate" your input array (no size change), the result is incorrect for rotations or 0 to -8 and some show only very subtle errors, not directly visible in the graph. Most other rotations I tried yield the correct result.&lt;BR /&gt;&lt;BR /&gt;I think the error is rare enough that two " Sort 1D array" in series will always produce a correct result. The first step will remove the strong "pattern" in the input, which is most likely the cause of the problem. Of course you could also write your own sorting VI directly in G. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 13 Jan 2005 17:42:12 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/1D-array-sort-not-working-7-0/m-p/174706#M102403</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2005-01-13T17:42:12Z</dc:date>
    </item>
  </channel>
</rss>

