[ILNumerics numpy Module]

**Namespace:**ILNumerics

**Assembly:**ILNumerics.numpy (in ILNumerics.numpy.dll) Version: 5.5.0.0 (5.5.7503.3146)

public static RetT repeat<T1, LocalT, InT, OutT, RetT, StorageT, IndT>( this ConcreteArray<T1, LocalT, InT, OutT, RetT, StorageT> A, BaseArray<IndT> repeats, Nullable<uint> axis = null ) where T1 : struct, new() where LocalT : Mutable<T1, LocalT, InT, OutT, RetT, StorageT> where InT : Immutable<T1, LocalT, InT, OutT, RetT, StorageT> where OutT : Mutable<T1, LocalT, InT, OutT, RetT, StorageT> where RetT : ConcreteRetArray<T1, LocalT, InT, OutT, RetT, StorageT> where StorageT : new(), BaseStorage<T1, LocalT, InT, OutT, RetT, StorageT> where IndT : struct, new(), IConvertible

#### Parameters

- A
- Type: ILNumerics.Core.ArraysConcreteArrayT1, LocalT, InT, OutT, RetT, StorageT

The array storing the elements to be repeated. - repeats
- Type: ILNumericsBaseArrayIndT

Counts for element repetitions. - axis (Optional)
- Type: SystemNullableUInt32

[Optional] The working dimension. Default: (null) flatten A and repeat all values along dimension #0.

#### Type Parameters

- T1
- Element type of A.
- LocalT
- (subtype of A)
- InT
- (subtype of A)
- OutT
- (subtype of A)
- RetT
- (subtype of A)
- StorageT
- (subtype of A)
- IndT
- Element type of repeats. Must be an integer type.

#### Return Value

Type: RetT#### Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ConcreteArrayT1, LocalT, InT, OutT, RetT, StorageT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Exception | Condition |
---|---|

ArgumentNullException | if any of the A or repeats is null |

ArgumentException | if axis points to a virtual dimension; if repeats is not a numeric array, is of a shape which is not broadcastable to the length of the working dimension or contains elements which are not convertible to positive integer values; |

This function repeats elements of A along a single dimension. By default, where no axis is defined A is reshaped to a vector in row-major order and all elements are repeated according to repeats. Otherwise, if an axis was specified, repetitions are performed along that dimension only. In this case, the array returned has the same shape as A, except that the working dimension axis is enlarged.

The shape of repeats is ignored. Its values give the counts for each element along the axis axis. Values must be numeric, positive integers and are read in row-major order. If repeats has exactly one element all elements along the working dimension of A are repeated by the same number. Alternatively, the length of repeats must match A.S[axis] to specify individual repetition counts for each element along the working dimension. Thus, if axis is null (default) repeats can be a scalar or an array with 'A.S.NumberOfElements == repeats.S.NumberOfElements'.

This function returns a new array and does not alter A or any input parameters.

[ILNumerics numpy Module]