Array

extension Array
extension Array where Element: Numeric
  • Makes a new array, where every element in the new array is f(self[i]) for all i in 0..<count.

    Note: this function applies f in parallel across all available threads on the local machine.

    Declaration

    Swift

    public func pMap<T>(_ f: (Element) -> T) -> [T]

Available where Element: Numeric

  • Computes the sum of all the elements in parallel.

    Declaration

    Swift

    public func pSum() -> Element