Skip to content

tuple_sortTupleSortTupleSorttuple_sorttuple_sort🔗

Short description🔗

tuple_sortTupleSortTupleSorttuple_sorttuple_sort — Sort the elements of a tuple in ascending order.

Signature🔗

tuple_sort( tuple Tuple, out tuple Sorted )void TupleSort( const HTuple& Tuple, HTuple* Sorted )static void HOperatorSet.TupleSort( HTuple tuple, out HTuple sorted )def tuple_sort( tuple: MaybeSequence[Union[float, int, str]] ) -> Sequence[Union[float, int, str]]

def tuple_sort_s( tuple: MaybeSequence[Union[float, int, str]] ) -> Union[float, int, str]Herror tuple_sort( const Hlong Tuple, Hlong* Sorted )

Herror T_tuple_sort( const Htuple Tuple, Htuple* Sorted )

HTuple HTuple::TupleSort( ) const

HTuple HTuple.TupleSort( )

Description🔗

tuple_sortTupleSort sorts all elements of Tupletupletuple in ascending order and returns the result with Sortedsortedsorted. 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_sortTupleSort, which can be used in an expression in the following syntax:

Sorted := sort(Tuple)

Execution information🔗

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

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

  • Automatically parallelized on internal data level.

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.

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

Sorted tuple.

Combinations with other operators🔗

Combinations

Alternatives

tuple_sort_indexTupleSortIndex, tuple_inverseTupleInverse

Module🔗

Foundation