Contents

randomSplit(by:using:)

Generates two generic arrays by randomly splitting the elements of the sequence.

Declaration

func randomSplit<T, Generator>(by proportion: Double, using generator: inout Generator) -> (ArraySlice<T>, ArraySlice<T>) where T == Self.Element, Generator : RandomNumberGenerator

Parameters

  • proportion:

    A proportion in the range [0.0, 1.0].

  • generator:

    A random-number generator.

Return Value

A tuple of array slices.