Array2D Module
- Namespace: FSharp.Collections
- Assembly: FSharp.Core.dll
Contains operations for working with 2-dimensional arrays.
See also F# Language Guide - Arrays.
F# and CLI multi-dimensional arrays are typically zero-based.
However, CLI multi-dimensional arrays used in conjunction with external
libraries (e.g. libraries associated with Visual Basic) be
non-zero based, using a potentially different base for each dimension.
The operations in this module will accept such arrays, and
the basing on an input array will be propagated to a matching output
array on the Array2D.map and Array2D.mapi operations.
Non-zero-based arrays can also be created using Array2D.zeroCreateBased,
Array2D.createBased and Array2D.initBased.
Functions and values
| Function or value | Description |
Full Usage:
Array2D.base1 array
Parameters:
'T[,]
-
The input array.
Returns: int
The base-index of the first dimension of the array.
Type parameters: 'T |
|
Full Usage:
Array2D.base2 array
Parameters:
'T[,]
-
The input array.
Returns: int
The base-index of the second dimension of the array.
Type parameters: 'T |
|
Full Usage:
Array2D.blit source sourceIndex1 sourceIndex2 target targetIndex1 targetIndex2 length1 length2
Parameters:
'T[,]
-
The source array.
sourceIndex1 : int
-
The first-dimension index to begin copying from in the source array.
sourceIndex2 : int
-
The second-dimension index to begin copying from in the source array.
target : 'T[,]
-
The target array.
targetIndex1 : int
-
The first-dimension index to begin copying into in the target array.
targetIndex2 : int
-
The second-dimension index to begin copying into in the target array.
length1 : int
-
The number of elements to copy across the first dimension of the arrays.
length2 : int
-
The number of elements to copy across the second dimension of the arrays.
Type parameters: 'T |
|
Full Usage:
Array2D.copy array
Parameters:
'T[,]
-
The input array.
Returns: 'T[,]
A copy of the input array.
Type parameters: 'T |
|
|
|
Full Usage:
Array2D.createBased base1 base2 length1 length2 initial
Parameters:
int
-
The base for the first dimension of the array.
base2 : int
-
The base for the second dimension of the array.
length1 : int
-
The length of the first dimension of the array.
length2 : int
-
The length of the second dimension of the array.
initial : 'T
-
The value to populate the new array.
Returns: 'T[,]
The created array.
Type parameters: 'T |
|
|
|
Full Usage:
Array2D.init length1 length2 initializer
Parameters:
int
-
The length of the first dimension of the array.
length2 : int
-
The length of the second dimension of the array.
initializer : int -> int -> 'T
-
A function to produce elements of the array given the two indices.
Returns: 'T[,]
The generated array.
Type parameters: 'T |
|
Full Usage:
Array2D.initBased base1 base2 length1 length2 initializer
Parameters:
int
-
The base for the first dimension of the array.
base2 : int
-
The base for the second dimension of the array.
length1 : int
-
The length of the first dimension of the array.
length2 : int
-
The length of the second dimension of the array.
initializer : int -> int -> 'T
-
A function to produce elements of the array given the two indices.
Returns: 'T[,]
The created array.
Type parameters: 'T |
|
Full Usage:
Array2D.iter action array
Parameters:
'T -> unit
-
A function to apply to each element of the array.
array : 'T[,]
-
The input array.
Type parameters: 'T |
|
|
|
Full Usage:
Array2D.length1 array
Parameters:
'T[,]
-
The input array.
Returns: int
The length of the array in the first dimension.
Type parameters: 'T |
|
Full Usage:
Array2D.length2 array
Parameters:
'T[,]
-
The input array.
Returns: int
The length of the array in the second dimension.
Type parameters: 'T |
|
Full Usage:
Array2D.map mapping array
Parameters:
'T -> 'U
-
A function that is applied to transform each item of the input array.
array : 'T[,]
-
The input array.
Returns: 'U[,]
An array whose elements have been transformed by the given mapping.
Type parameters: 'T, 'U |
|
Full Usage:
Array2D.mapi mapping array
Parameters:
int -> int -> 'T -> 'U
-
A function that is applied to transform each element of the array. The two integers
provide the index of the element.
array : 'T[,]
-
The input array.
Returns: 'U[,]
An array whose elements have been transformed by the given mapping.
Type parameters: 'T, 'U |
|
Full Usage:
Array2D.rebase array
Parameters:
'T[,]
-
The input array.
Returns: 'T[,]
The zero-based output array.
Type parameters: 'T |
|
|
|
|
|
Full Usage:
Array2D.zeroCreateBased base1 base2 length1 length2
Parameters:
int
-
The base for the first dimension of the array.
base2 : int
-
The base for the second dimension of the array.
length1 : int
-
The length of the first dimension of the array.
length2 : int
-
The length of the second dimension of the array.
Returns: 'T[,]
The created array.
Type parameters: 'T |
