07-08-2014 01:36 PM
Is it one of those listed in Wikipedia?
If not:
07-08-2014 02:00 PM
I believe a version of quicksort is hidden under the hood where we don't play.
It is not a stable implementation since the entire data becomes the key for complex data types with simillar elements
07-08-2014 02:14 PM
Can anyone from NI confirm? I need to know the stability and memory utilization for sure before I put it to use.
07-08-2014 02:53 PM - edited 07-08-2014 02:54 PM
@Staab_Engineering wrote:
Can anyone from NI confirm? I need to know the stability and memory utilization for sure before I put it to use.
I challenge you to write your own that outperforms the stock sort algorithm. 😄
Besides, you can easily test it yourself with some simple benchmarks using arrays of various lenght, either random or with some pathological pattern (all the same, all NaN, some NaN, already sorted, reverse sorted, etc.).
Things like sorting are very well studied and I am sure that NI put a lot of thought into it. What prompted you to question the sorting algorithm?
07-08-2014 03:11 PM
I don't remember challenging the quality of the primitive's implementation; I was just asking for more information about it.
One of the most frustrating experiences about posting on the NI forums is that invariably someone, either from NI AE or a community member, will challenge the reason you asked for information or help at all. I want to know the characteristics of the sorting function because I want complete control over the performance of my low-level LabVIEW code. That's reason enough.
07-08-2014 03:22 PM
@Staab_Engineering wrote:
I don't remember challenging the quality of the primitive's implementation; I was just asking for more information about it.
Well, if you need to sort and the NI implmentation does not fit your needs, you would have to write one yourself. Right?
As I said, it would be trivial to write a benchmark testbench geared towards your exact use case (datatype, size, typical patterns, etc.). Why haven't you done that yet?
Staab_Engineering wrote:One of the most frustrating experiences about posting on the NI forums is that invariably someone, either from NI AE or a community member, will challenge the reason you asked for information or help at all. I want to know the characteristics of the sorting function because I want complete control over the performance of my low-level LabVIEW code. That's reason enough.
It is even more frustrating if users fill posts 70% with philosophical comments.
You cannot get "complete control", because sorting depends on the input.
If NI uses their own algorithm, it is most likely proprietary and they won't tell you the details.
Chances are they are using some known library.