LabVIEW Idea Exchange

About LabVIEW Idea Exchange

Have a LabVIEW Idea?

  1. Browse by label or search in the LabVIEW Idea Exchange to see if your idea has previously been submitted. If your idea exists be sure to vote for the idea by giving it kudos to indicate your approval!
  2. If your idea has not been submitted click Post New Idea to submit a product idea to the LabVIEW Idea Exchange. Be sure to submit a separate post for each idea.
  3. Watch as the community gives your idea kudos and adds their input.
  4. As NI R&D considers the idea, they will change the idea status.
  5. Give kudos to other ideas that you would like to see in a future version of LabVIEW!
Top Authors
cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos

Sort 1D array should output sorted index numbers

Status: Declined

Declined for reasons listed in AristosQueue's reply

When you use Sort 1D array function, it sorts items but does not output sorted index numbers. This is a problem especially if a particular 1D subarray is used to sort an 2D array and if subarray has identical items in it. It makes it hard to rebuild the 2D array based on the sorted 1D subarray. If sorted index numbers are provided, 2D array can easily be rebuilt.

Master of Science Mechanical Engineer
Ozgur Aslan
Senior Software Developer
Aerospace and Defense
Michigan, USA
4 Comments
Proven Zealot

Providing that would kill performance of the Sort 1D Array node. Tracking all the swapped indexes is major overhead for a sort operation that isn't needed most of the time, and when you do need it, there are often better ways to achieve it.

 

If you want to sort a 2D array, use the vi "vi.lib\Array\Sort 2D Array.vim". Internal to that VI, you'll find code that manipulates the sorted array of indexes if you want the index list for some other purpose.

Proven Zealot
Status changed to: Declined

Declined for reasons listed in AristosQueue's reply

DNatt, NI
Member

Aristo

Sort 2D array.vim has its own flaws already. Instead of declining the idea, you can let developer select the index array output by implementing "Activate" input node (T or F) and make F default so that it would not bother the performance if the feature is not activated. I think this feature is almost needed and make a good improvement going forward.

Master of Science Mechanical Engineer
Ozgur Aslan
Senior Software Developer
Aerospace and Defense
Michigan, USA
Knight of NI

Can't you just sort a 1-D array of clusters where the cluster consists of the string value and the original index position?  Sure it would take some looping to create the cluster to sort, or break the sorted cluster back into 2 arrays.

 

RavensFan_0-1582865422713.png