Skip to content

tuple_repeatTupleRepeatTupleRepeattuple_repeattuple_repeat🔗

Short description🔗

tuple_repeatTupleRepeatTupleRepeattuple_repeattuple_repeat — Repeat a tuple.

Signature🔗

tuple_repeat( tuple Tuple, integer Num, out tuple Result )void TupleRepeat( const HTuple& Tuple, const HTuple& Num, HTuple* Result )static void HOperatorSet.TupleRepeat( HTuple tuple, HTuple num, out HTuple result )def tuple_repeat( tuple: HTupleType, num: Union[int, float] ) -> Sequence[HTupleElementType]

def tuple_repeat_s( tuple: HTupleType, num: Union[int, float] ) -> HTupleElementTypeHerror tuple_repeat( const Hlong Tuple, const Hlong Num, Hlong* Result )

Herror T_tuple_repeat( const Htuple Tuple, const Htuple Num, Htuple* Result )

HTuple HTuple::TupleRepeat( const HTuple& Num ) const

HTuple HTuple.TupleRepeat( HTuple num )

Description🔗

tuple_repeatTupleRepeat repeats Tupletupletuple Numnumnum times and returns them with Resultresultresult. Thus, Resultresultresult contains Numnumnum times more elements than Tupletupletuple. For example, the first Numnumnum elements of Resultresultresult are element-wise equal to the elements of Tupletupletuple. Numnumnum must be positive and integer (also for type real). If Numnumnum is equal to 0, an empty tuple is returned.

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_repeatTupleRepeat, which can be used in an expression in the following syntax:

Result := rep(Tuple, Num)

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 / handle)HTuple (Hlong / double / HString / HHandle)HTuple (int / long / double / string / HHandle)HTupleTypeHtuple (Hlong / double / char* / handle)

Input tuple.

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

Number of repetitions.

Resultresultresult (output_control) tuple(-array) → (integer / real / string / handle)HTuple (Hlong / double / HString / HHandle)HTuple (int / long / double / string / HHandle)Sequence[HTupleElementType]Htuple (Hlong / double / char* / handle)

Tuple with multiple copies.

Example🔗

(HDevelop)

tuple_repeat (['a', 'b', 'c'], 2, Result)
* Returns ['a', 'b', 'c', 'a', 'b', 'c']

Combinations with other operators🔗

Combinations

Alternatives

tuple_gen_constTupleGenConst, tuple_concatTupleConcat

See also

tuple_repeat_elemTupleRepeatElem

Module🔗

Foundation