Parallel Module
Parallel operations on ResizeArray using Threading.Tasks.Parallel.For The API is aligned with from FSharp.Core.Array.Parallel module
Functions and values
| Function or value |
Description
|
||
Full Usage:
average resizeArray
Parameters:
ResizeArray<^T>
-
The input ResizeArray.
Returns: ^T
The average of the elements in the ResizeArray.
Modifiers: inline Type parameters: ^T (requires (static member op_Addition : ^T * ^T -> ^T) and (static member DivideByInt : ^T * Microsoft.FSharp.Core.int -> ^T)) |
Returns the average of the elements in the ResizeArray. Performs the operation in parallel using Parallel.For. For floating point numbers the result may differ slightly from ResizeArray.average, because the elements are added in a different order.
|
||
Full Usage:
averageBy projection resizeArray
Parameters:
'T -> ^Key
-
The function to transform the ResizeArray elements before averaging.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: ^Key
The computed average.
Modifiers: inline Type parameters: 'T, ^Key (requires (static member op_Addition : ^Key * ^Key -> ^Key) and (static member DivideByInt : ^Key * Microsoft.FSharp.Core.int -> ^Key)) |
Returns the average of the elements generated by applying the function to each element of the ResizeArray. Performs the operation in parallel using Parallel.For. For floating point numbers the result may differ slightly from ResizeArray.averageBy, because the elements are added in a different order.
|
||
Full Usage:
choose chooser resizeArray
Parameters:
'T -> 'U option
-
The function to generate options from the elements.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: ResizeArray<'U>
The ResizeArray of results.
Type parameters: 'T, 'U |
Apply the given function to each element of the ResizeArray. Return the ResizeArray comprised of the results "x" for each element where the function returns Some(x). Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input ResizeArray is not specified.
|
||
Full Usage:
collect mapping resizeArray
Parameters:
'T -> ResizeArray<'U>
-
The function to transform each input element into a ResizeArray.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: ResizeArray<'U>
The combined ResizeArray of mapped elements.
Type parameters: 'T, 'U |
For each element of the ResizeArray, apply the given function. Concatenate all the results and return the combined ResizeArray. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input ResizeArray is not specified.
|
||
Full Usage:
exists predicate resizeArray
Parameters:
'T -> bool
-
The function to test the input elements.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: bool
True if any result from predicate is true.
Type parameters: 'T |
Tests if any element of the ResizeArray satisfies the given predicate.
The predicate is applied to the elements of the input ResizeArray in parallel. If any application
returns true then the overall result is true and testing of other elements in all threads is stopped at system's earliest convenience.
Otherwise,
|
||
Full Usage:
filter predicate resizeArray
Parameters:
'T -> bool
-
The function to test the input elements.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: ResizeArray<'T>
A ResizeArray containing the elements for which the given predicate returns true.
Type parameters: 'T |
Returns a new ResizeArray containing only the elements of the ResizeArray
for which the given predicate returns
|
||
Full Usage:
forall predicate resizeArray
Parameters:
'T -> bool
-
The function to test the input elements.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: bool
True if all of the ResizeArray elements satisfy the predicate.
Type parameters: 'T |
Tests if all elements of the ResizeArray satisfy the given predicate. The predicate is applied to the elements of the input ResizeArray in parallel. If any application returns false then the overall result is false and testing of other elements in all threads is stopped at system's earliest convenience. Otherwise, true is returned.
|
||
Full Usage:
groupBy projection resizeArray
Parameters:
'T -> 'Key
-
A function that transforms an element of the ResizeArray into a comparable key. Null or Option.None is allowed as key.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: ResizeArray<'Key * ResizeArray<'T>>
The result ResizeArray.
Type parameters: 'T, 'Key (requires equality) |
Applies a key-generating function to each element of a ResizeArray in parallel and yields a ResizeArray of unique keys. Each unique key contains a ResizeArray of all elements that match to this key. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input ResizeArray is not specified. Unlike with ResizeArray.groupBy, the order of the keys and of the elements within each group is not specified either. Like in Array.Parallel.groupBy, all float and float32 nan keys are put in one group.
|
||
Full Usage:
init count initializer
Parameters:
int
-
The number of elements to create.
initializer : int -> 'T
-
The function used to initialize each element from its index.
Returns: ResizeArray<'T>
The ResizeArray of results.
Type parameters: 'T |
Create a ResizeArray given the dimension and a generator function to compute the elements. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to indices is not specified.
|
||
Full Usage:
iter action resizeArray
Parameters:
'T -> unit
-
The function to apply to each element.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Type parameters: 'T |
Apply the given function to each element of the ResizeArray. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input ResizeArray is not specified.
|
||
Full Usage:
iteri action resizeArray
Parameters:
int -> 'T -> unit
-
The function to apply to each index and element.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Type parameters: 'T |
Apply the given function to each element of the ResizeArray. 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 ResizeArray is not specified.
|
||
Full Usage:
map mapping resizeArray
Parameters:
'T -> 'U
-
The function to transform each element.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: ResizeArray<'U>
The ResizeArray of results.
Type parameters: 'T, 'U |
Build a new ResizeArray whose elements are the results of applying the given function to each of the elements of the ResizeArray. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input ResizeArray is not specified.
|
||
Full Usage:
mapi mapping resizeArray
Parameters:
int -> 'T -> 'U
-
The function to transform each index and element.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: ResizeArray<'U>
The ResizeArray of results.
Type parameters: 'T, 'U |
Build a new ResizeArray whose elements are the results of applying the given function to each of the elements of the ResizeArray. 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 ResizeArray is not specified.
|
||
Full Usage:
max resizeArray
Parameters:
ResizeArray<'T>
-
The input ResizeArray.
Returns: 'T
The maximum element, or NaN.
Modifiers: inline Type parameters: 'T (requires comparison) |
Returns the greatest of all elements of the ResizeArray. NaN propagates: if any element is NaN, NaN is returned, like ResizeArray.max. If several elements are the greatest, the first one of them is returned. Performs the operation in parallel using Parallel.For. This is the 'maximum' operation of IEEE 754:2019: NaN propagates and +0.0 is bigger than -0.0. See https://github.com/dotnet/fsharp/issues/13207#issuecomment-1194411950
|
||
Full Usage:
maxBy projection resizeArray
Parameters:
'T -> 'Key
-
The function to transform the elements into a type supporting comparison.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: 'T
The maximum element.
Modifiers: inline Type parameters: 'T, 'Key (requires comparison) |
Returns the element of the ResizeArray with the greatest projected key. NaN keys are ignored like in ResizeArray.maxBy: elements with a NaN key are only returned if all keys are NaN. If several keys are the greatest, the first element of them is returned. Performs the operation in parallel using Parallel.For.
|
||
Full Usage:
min resizeArray
Parameters:
ResizeArray<'T>
-
The input ResizeArray.
Returns: 'T
The minimum element, or NaN.
Modifiers: inline Type parameters: 'T (requires comparison) |
Returns the smallest of all elements of the ResizeArray. NaN propagates: if any element is NaN, NaN is returned, like ResizeArray.min. If several elements are the smallest, the first one of them is returned. Performs the operation in parallel using Parallel.For. This is the 'minimum' operation of IEEE 754:2019: NaN propagates and -0.0 is smaller than +0.0. See https://github.com/dotnet/fsharp/issues/13207#issuecomment-1194411950
|
||
Full Usage:
minBy projection resizeArray
Parameters:
'T -> 'Key
-
The function to transform the elements into a type supporting comparison.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: 'T
The minimum element.
Modifiers: inline Type parameters: 'T, 'Key (requires comparison) |
Returns the element of the ResizeArray with the smallest projected key. NaN keys are ignored like in ResizeArray.minBy: elements with a NaN key are only returned if all keys are NaN. If several keys are the smallest, the first element of them is returned. Performs the operation in parallel using Parallel.For.
|
||
Full Usage:
partition predicate resizeArray
Parameters:
'T -> bool
-
The function to test the input elements.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: ResizeArray<'T> * ResizeArray<'T>
The two ResizeArrays of results.
Type parameters: 'T |
Split the collection into two collections, containing the
elements for which the given predicate returns
|
||
Full Usage:
partitionWith partitioner resizeArray
Parameters:
'T -> Choice<'U1, 'U2>
-
The function to transform and classify each input element into one of two output types.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: ResizeArray<'U1> * ResizeArray<'U2>
A tuple of two ResizeArrays. The first containing values from Choice1Of2 results and the second
containing values from Choice2Of2 results.
Type parameters: 'T, 'U1, 'U2 |
Splits the collection into two ResizeArrays, by applying the given partitioning function to each element. Returns Choice1Of2 elements in the first ResizeArray and Choice2Of2 elements in the second ResizeArray. Element order is preserved in both of the created ResizeArrays. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input ResizeArray is not specified. The partitioner function must be thread-safe.
|
||
Full Usage:
reduce reduction resizeArray
Parameters:
'T -> 'T -> 'T
-
The function to reduce a pair of elements to a single element.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: 'T
The final result of the reductions.
Type parameters: 'T |
Applies a function to each element of the ResizeArray in parallel, threading an accumulator argument through the computation for each thread involved in the computation. After processing the entire input, results from all threads are reduced together. Raises ArgumentException if the ResizeArray is empty. The ResizeArray is split into contiguous chunks. The order in which the chunks are processed is not specified. But the elements within each chunk, and then the results of the chunks, are reduced in their original order. So the 'reduction' function needs to be associative, but it does not need to be commutative. Compared to the non-parallel ResizeArray.reduce, the 'reduction' function is invoked a few more times to combine the results of the chunks.
|
||
Full Usage:
reduceBy projection reduction resizeArray
Parameters:
'T -> 'U
-
The function to project from elements of the input ResizeArray.
reduction : 'U -> 'U -> 'U
-
The function to reduce a pair of projected elements to a single element.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: 'U
The final result of the reductions.
Type parameters: 'T, 'U |
Applies a projection function to each element of the ResizeArray in parallel, reducing elements in each thread with a dedicated 'reduction' function. After processing the entire input, results from all threads are reduced together. Raises ArgumentException if the ResizeArray is empty. The ResizeArray is split into contiguous chunks. The order in which the chunks are processed is not specified. But the elements within each chunk, and then the results of the chunks, are reduced in their original order. So the 'reduction' function needs to be associative, but it does not need to be commutative. Compared to the non-parallel ResizeArray.reduce, the 'reduction' function is invoked a few more times to combine the results of the chunks.
|
||
Full Usage:
sort resizeArray
Parameters:
ResizeArray<'T>
-
The input ResizeArray.
Returns: ResizeArray<'T>
A new sorted ResizeArray.
Type parameters: 'T (requires comparison) |
Sorts the elements of a ResizeArray in parallel, returning a new ResizeArray. Elements are compared using Operators.compare. This means "Z" is before "a". This is different from Collections.Generic.Sort() where "a" is before "Z" using IComparable interface. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.
|
||
Full Usage:
sortBy projection resizeArray
Parameters:
'T -> 'Key
-
The function to transform ResizeArray elements into the type that is compared.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: ResizeArray<'T>
The sorted ResizeArray.
Type parameters: 'T, 'Key (requires comparison) |
Sorts the elements of a ResizeArray in parallel, using the given projection for the keys and returning a new ResizeArray. Elements are compared using Operators.compare. This means "Z" is before "a". This is different from Collections.Generic.Sort() where "a" is before "Z" using IComparable interface. The projection is applied to each element exactly once, in parallel. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.
|
||
Full Usage:
sortByDescending projection resizeArray
Parameters:
'T -> 'Key
-
The function to transform ResizeArray elements into the type that is compared.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: ResizeArray<'T>
The sorted ResizeArray.
Type parameters: 'T, 'Key (requires comparison) |
Sorts the elements of a ResizeArray in parallel, in descending order, using the given projection for the keys and returning a new ResizeArray. Elements are compared using Operators.compare. This means in ascending sorting "Z" is before "a". This is different from Collections.Generic.Sort() where "a" is before "Z" using IComparable interface. The projection is applied to each element exactly once, in parallel. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.
|
||
Full Usage:
sortDescending resizeArray
Parameters:
ResizeArray<'T>
-
The input ResizeArray.
Returns: ResizeArray<'T>
The sorted ResizeArray.
Type parameters: 'T (requires comparison) |
Sorts the elements of a ResizeArray in parallel, in descending order, returning a new ResizeArray. Elements are compared using Operators.compare. This means in ascending sorting "Z" is before "a". This is different from Collections.Generic.Sort() where "a" is before "Z" using IComparable interface. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.
|
||
Full Usage:
sortInPlace resizeArray
Parameters:
ResizeArray<'T>
-
The input ResizeArray.
Type parameters: 'T (requires comparison) |
Sorts the elements of a ResizeArray in place in parallel, using generic comparison. Elements are compared using Operators.compare. This means in ascending sorting "Z" is before "a". This is different from Collections.Generic.Sort() where "a" is before "Z" using IComparable interface. The elements are sorted in a temporary array and then copied back into the ResizeArray. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.
|
||
Full Usage:
sortInPlaceBy projection resizeArray
Parameters:
'T -> 'Key
-
The function to transform ResizeArray elements into the type that is compared.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Type parameters: 'T, 'Key (requires comparison) |
Sorts the elements of a ResizeArray in place in parallel, using the given projection for the keys. Elements are compared using Operators.compare. This means in ascending sorting "Z" is before "a". This is different from Collections.Generic.Sort() where "a" is before "Z" using IComparable interface. The projection is applied to each element exactly once, in parallel. The elements are sorted in a temporary array and then copied back into the ResizeArray. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.
|
||
Full Usage:
sortInPlaceWith comparer resizeArray
Parameters:
'T -> 'T -> int
-
The function to compare pairs of ResizeArray elements.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Type parameters: 'T |
Sorts the elements of a ResizeArray in place in parallel, using the given comparison function as the order. The elements are sorted in a temporary array and then copied back into the ResizeArray. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.
|
||
Full Usage:
sortWith comparer resizeArray
Parameters:
'T -> 'T -> int
-
The function to compare pairs of ResizeArray elements.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: ResizeArray<'T>
The sorted ResizeArray.
Type parameters: 'T |
Sorts the elements of a ResizeArray in parallel, using the given comparison function as the order, returning a new ResizeArray. This is NOT a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.sort.
|
||
Full Usage:
sum resizeArray
Parameters:
ResizeArray<^T>
-
The input ResizeArray.
Returns: ^T
The resulting sum.
Modifiers: inline Type parameters: ^T (requires (static member get_Zero : -> ^T) and (static member op_Addition : ^T * ^T -> ^T)) |
Returns the sum of the elements in the ResizeArray. Returns zero for an empty ResizeArray. Performs the operation in parallel using Parallel.For. For floating point numbers the result may differ slightly from ResizeArray.sum, because the elements are added in a different order.
|
||
Full Usage:
sumBy projection resizeArray
Parameters:
'T -> ^Key
-
The function to transform the ResizeArray elements into the type to be summed.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: ^Key
The resulting sum.
Modifiers: inline Type parameters: 'T, ^Key (requires (static member get_Zero : -> ^Key) and (static member op_Addition : ^Key * ^Key -> ^Key)) |
Returns the sum of the results generated by applying the function to each element of the ResizeArray. Returns zero for an empty ResizeArray. Performs the operation in parallel using Parallel.For. For floating point numbers the result may differ slightly from ResizeArray.sumBy, because the elements are added in a different order.
|
||
Full Usage:
tryFind predicate resizeArray
Parameters:
'T -> bool
-
The function to test the input elements.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: 'T option
The first element that satisfies the predicate, or None.
Type parameters: 'T |
Returns the first element for which the given function returns
|
||
Full Usage:
tryFindIndex predicate resizeArray
Parameters:
'T -> bool
-
The function to test the input elements.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: int option
The index of the first element that satisfies the predicate, or None.
Type parameters: 'T |
Returns the index of the first element in the ResizeArray
that satisfies the given predicate.
Returns
|
||
Full Usage:
tryPick chooser resizeArray
Parameters:
'T -> 'U option
-
The function to transform the ResizeArray elements into options.
resizeArray : ResizeArray<'T>
-
The input ResizeArray.
Returns: 'U option
The first transformed element that is Some(x).
Type parameters: 'T, 'U |
Applies the given function to successive elements, returning the first
result where the function returns
|
||
Full Usage:
zip resizeArray1 resizeArray2
Parameters:
ResizeArray<'T>
-
The first input ResizeArray.
resizeArray2 : ResizeArray<'U>
-
The second input ResizeArray.
Returns: ResizeArray<'T * 'U>
The ResizeArray of tupled elements.
Type parameters: 'T, 'U |
Combines the two ResizeArrays into a ResizeArray of pairs. The two ResizeArrays must have equal lengths, otherwise an
|
ResizeArray