Provides parallel operations on arrays
Function or value | Description | ||
Full Usage:
Array.Parallel.choose chooser array
Parameters:
'T -> 'U option
-
The function to generate options from the elements.
array : 'T[]
-
The input array.
Returns: 'U[]
The array of results.
|
![]() ![]() ![]() ![]() ![]() ![]()
Apply the given function to each element of the array. Return
the array comprised of the results Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input array is not specified.
Example
Evaluates to [| 1; 2 |]
Example
Evaluates to [| 2 |]
|
||
Full Usage:
Array.Parallel.collect mapping array
Parameters:
'T -> 'U[]
-
array : 'T[]
-
The input array.
Returns: 'U[]
'U[]
|
![]() ![]() ![]() ![]() ![]() ![]() For each element of the array, apply the given function. Concatenate all the results and return the combined array. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input array is not specified.
Example
Evaluates to [| 1; 2; 3; 4 |]
Example
Evaluates to [| 1; 2; 3; 4 |]
|
||
|
Performs the operation in parallel using Parallel.For. The order in which the given function is applied to indices is not specified.
Example
Evaluates to [| 5; 6; 7; 8 |]
|
||
Full Usage:
Array.Parallel.iter action array
Parameters:
'T -> unit
-
array : 'T[]
-
The input array.
|
Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input array is not specified.
Example
Evaluates to unit and prints the following to the console in an unspecified order:
|
||
|
![]() ![]() ![]() ![]() ![]() ![]() Apply the given function to each element of the array. The integer passed to the function indicates the index of element. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input array is not specified.
Example
Evaluates to unit and prints the following to the console in an unspecified order:
|
||
Full Usage:
Array.Parallel.map mapping array
Parameters:
'T -> 'U
-
array : 'T[]
-
The input array.
Returns: 'U[]
The array of results.
|
![]() ![]() ![]() ![]() ![]() ![]() Build a new array whose elements are the results of applying the given function to each of the elements of the array. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input array is not specified.
Example
Evaluates to [| 1; 3; 2 |]
|
||
Full Usage:
Array.Parallel.mapi mapping array
Parameters:
int -> 'T -> 'U
-
array : 'T[]
-
The input array.
Returns: 'U[]
The array of results.
|
![]() ![]() ![]() ![]() ![]() ![]() Build a new array whose elements are the results of applying the given function to each of the elements of the array. The integer index passed to the function indicates the index of element being transformed. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input array is not specified.
Example
Evaluates to [| 10; 11; 12 |]
|
||
Full Usage:
Array.Parallel.partition predicate array
Parameters:
'T -> bool
-
The function to test the input elements.
array : 'T[]
-
The input array.
Returns: 'T[] * 'T[]
The two arrays of results.
|
![]() ![]() ![]() ![]() ![]() ![]() Split the collection into two collections, containing the elements for which the given predicate returns "true" and "false" respectively Performs the operation in parallel using Parallel.For. The order in which the given function is applied to indices is not specified.
Example
Evaluates to ([|2; 4|], [|1; 3|]) .
|