Array
extension Array
extension Array where Element: Numeric
-
Makes a new array, where every element in the new array is
f(self[i])
for alli
in0..<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]
-
Computes the sum of all the elements in parallel.
Declaration
Swift
public func pSum() -> Element