Skip to content

tuple_select_maskTupleSelectMaskTupleSelectMasktuple_select_masktuple_select_mask🔗

Short description🔗

tuple_select_maskTupleSelectMaskTupleSelectMasktuple_select_masktuple_select_mask — Select in mask specified elements of a tuple.

Signature🔗

tuple_select_mask( tuple Tuple, integer Mask, out tuple Selected )void TupleSelectMask( const HTuple& Tuple, const HTuple& Mask, HTuple* Selected )static void HOperatorSet.TupleSelectMask( HTuple tuple, HTuple mask, out HTuple selected )def tuple_select_mask( tuple: MaybeSequence[Union[float, int, str]], mask: MaybeSequence[int] ) -> Sequence[Union[float, int, str]]

def tuple_select_mask_s( tuple: MaybeSequence[Union[float, int, str]], mask: MaybeSequence[int] ) -> Union[float, int, str]Herror tuple_select_mask( const Hlong Tuple, const Hlong Mask, Hlong* Selected )

Herror T_tuple_select_mask( const Htuple Tuple, const Htuple Mask, Htuple* Selected )

HTuple HTuple::TupleSelectMask( const HTuple& Mask ) const

HTuple HTuple.TupleSelectMask( HTuple mask )

Description🔗

tuple_select_maskTupleSelectMask selects one or more single elements of the tuple Tupletupletuple and returns them with Selectedselectedselected. For every element Maskmaskmask determines the corresponding element to select. If the value is greater than 0, the appropriate element is selected. Thus the length of the two input tuples has to be equal and Maskmaskmask may only contain integer or float values.

Exception: Empty input tuples🔗

If both input tuples are empty, the operator returns an empty tuple. If only one of the input tuples is empty and the other is not, an exception is raised.

HDevelop In-line Operation🔗

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

Selected := select_mask(Tuple, Mask)

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.

Maskmaskmask (input_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)

> 0 specifies the elements to select.

Selectedselectedselected (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*)

Selected tuple elements.

Combinations with other operators🔗

Combinations

Alternatives

tuple_first_nTupleFirstN, tuple_last_nTupleLastN, tuple_str_bit_selectTupleStrBitSelect, tuple_concatTupleConcat, tuple_selectTupleSelect, tuple_select_rangeTupleSelectRange, tuple_select_rankTupleSelectRank

See also

tuple_removeTupleRemove

Module🔗

Foundation