Skip to content

tuple_sort_indexTupleSortIndexTupleSortIndextuple_sort_indextuple_sort_index🔗

Short description🔗

tuple_sort_indexTupleSortIndexTupleSortIndextuple_sort_indextuple_sort_index — Sort the elements of a tuple and return the indices of the sorted tuple.

Signature🔗

tuple_sort_index( tuple Tuple, out integer Indices )void TupleSortIndex( const HTuple& Tuple, HTuple* Indices )static void HOperatorSet.TupleSortIndex( HTuple tuple, out HTuple indices )def tuple_sort_index( tuple: MaybeSequence[Union[float, int, str]] ) -> Sequence[int]

def tuple_sort_index_s( tuple: MaybeSequence[Union[float, int, str]] ) -> intHerror tuple_sort_index( const Hlong Tuple, Hlong* Indices )

Herror T_tuple_sort_index( const Htuple Tuple, Htuple* Indices )

HTuple HTuple::TupleSortIndex( ) const

HTuple HTuple.TupleSortIndex( )

Description🔗

tuple_sort_indexTupleSortIndex sorts all elements of Tupletupletuple in ascending order and returns the indices of the elements of the sorted tuple (in relation to the input tuple Tupletupletuple) with Indicesindicesindices. As a precondition the single elements of Tupletupletuple must be comparable. Thus, Tupletupletuple must either exclusively consist of strings or it must only contain (integer or floating point) numbers. In the latter case integers and floating point numbers may be mixed.

Exception: Empty input tuple🔗

If the input tuple is empty, the operator returns an empty tuple.

HDevelop In-line Operation🔗

HDevelop provides an in-line operation for tuple_sort_indexTupleSortIndex, which can be used in an expression in the following syntax:

Indices := sort_index(Tuple)

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Tupletupletuple (input_control) tuple(-array) → (integer / real / string)HTuple (Hlong / double / HString)HTuple (int / long / double / string)MaybeSequence[Union[float, int, str]]Htuple (Hlong / double / char*)

Input tuple.

Indicesindicesindices (output_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)

Sorted tuple.

Combinations with other operators🔗

Combinations

Alternatives

tuple_sortTupleSort, tuple_inverseTupleInverse

Module🔗

Foundation