Skip to content

tuple_select_rankTupleSelectRankTupleSelectRanktuple_select_ranktuple_select_rank🔗

Short description🔗

tuple_select_rankTupleSelectRankTupleSelectRanktuple_select_ranktuple_select_rank — Select the element of rank n of a tuple.

Signature🔗

tuple_select_rank( number Tuple, number RankIndex, out number Selected )void TupleSelectRank( const HTuple& Tuple, const HTuple& RankIndex, HTuple* Selected )static void HOperatorSet.TupleSelectRank( HTuple tuple, HTuple rankIndex, out HTuple selected )def tuple_select_rank( tuple: MaybeSequence[Union[float, int]], rank_index: Union[float, int] ) -> Union[float, int]

Herror tuple_select_rank( const Hlong Tuple, const Hlong RankIndex, Hlong* Selected )

Herror T_tuple_select_rank( const Htuple Tuple, const Htuple RankIndex, Htuple* Selected )

HTuple HTuple::TupleSelectRank( const HTuple& RankIndex ) const

HTuple HTuple.TupleSelectRank( HTuple rankIndex )

Description🔗

tuple_select_rankTupleSelectRank sorts the elements of the tuple Tupletupletuple and returns the element of rank n in Selectedselectedselected. RankIndexrankIndexrank_index determines the index of the element to select. Thus, RankIndexrankIndexrank_index may only contain integer values (any floating point number in RankIndexrankIndexrank_index must represent an integer value without fraction). Indices of tuple elements start at 0, i.e. the lowest tuple element has the index 0.

Exception: Empty input tuples🔗

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

HDevelop In-line Operation🔗

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

Selected := select_rank(Tuple, RankIndex)

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) number(-array) → (integer / real)HTuple (Hlong / double)HTuple (int / long / double)MaybeSequence[Union[float, int]]Htuple (Hlong / double)

Input tuple.

RankIndexrankIndexrank_index (input_control) number → (integer / real)HTuple (Hlong / double)HTuple (int / long / double)Union[float, int]Htuple (Hlong / double)

Rank of the element to select.

Selectedselectedselected (output_control) number → (integer / real)HTuple (Hlong / double)HTuple (int / long / double)Union[float, int]Htuple (Hlong / double)

Selected tuple element.

Combinations with other operators🔗

Combinations

Alternatives

tuple_sort_indexTupleSortIndex, tuple_sortTupleSort

See also

tuple_medianTupleMedian, tuple_selectTupleSelect

Module🔗

Foundation