tuple_repeattuple_repeatTupleRepeatTupleRepeattuple_repeat (Operator)

Name

tuple_repeattuple_repeatTupleRepeatTupleRepeattuple_repeat — Repeat a tuple.

Signature

tuple_repeat( : : Tuple, Num : Result)

Herror tuple_repeat(const Hlong Tuple, const Hlong Num, Hlong* Result)

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

void TupleRepeat(const HTuple& Tuple, const HTuple& Num, HTuple* Result)

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

static void HOperatorSet.TupleRepeat(HTuple tuple, HTuple num, out HTuple result)

HTuple HTuple.TupleRepeat(HTuple num)

def tuple_repeat(tuple: HTupleType, num: Union[int, float]) -> Sequence[HTupleElementType]

def tuple_repeat_s(tuple: HTupleType, num: Union[int, float]) -> HTupleElementType

Description

tuple_repeattuple_repeatTupleRepeatTupleRepeattuple_repeat repeats TupleTupleTupletupletuple NumNumNumnumnum times and returns them with ResultResultResultresultresult. Thus, ResultResultResultresultresult contains NumNumNumnumnum times more elements than TupleTupleTupletupletuple. For example, the first NumNumNumnumnum elements of ResultResultResultresultresult are element-wise equal to the elements of TupleTupleTupletupletuple. NumNumNumnumnum must be positive and integer (also for type real). If NumNumNumnumnum 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_repeattuple_repeatTupleRepeatTupleRepeattuple_repeat, which can be used in an expression in the following syntax:

Result := rep(Tuple, Num)

Execution Information

Parameters

TupleTupleTupletupletuple (input_control)  tuple(-array) HTupleHTupleTypeHTupleHtuple (integer / real / string / handle) (int / long / double / string / HHandle) (Hlong / double / HString / HHandle) (Hlong / double / char* / handle)

Input tuple.

NumNumNumnumnum (input_control)  integer HTupleUnion[int, float]HTupleHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double)

Number of repetitions.

ResultResultResultresultresult (output_control)  tuple(-array) HTupleSequence[HTupleElementType]HTupleHtuple (integer / real / string / handle) (int / long / double / string / HHandle) (Hlong / double / HString / HHandle) (Hlong / double / char* / handle)

Tuple with multiple copies.

Example (HDevelop)

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

Alternatives

tuple_gen_consttuple_gen_constTupleGenConstTupleGenConsttuple_gen_const, tuple_concattuple_concatTupleConcatTupleConcattuple_concat

See also

tuple_repeat_elemtuple_repeat_elemTupleRepeatElemTupleRepeatElemtuple_repeat_elem

Module

Foundation