FSharpAux


Array2D

Namespace: FSharpAux
Attributes:
[<AutoOpen>]

Functions and values

Function or valueDescription
array2D_to_seq(arr)
Signature: arr:'?8984 [,] -> seq<'?8984>
Type parameters: '?8984
colCount(arr)
Signature: arr:'T [,] -> int
Type parameters: 'T

Returns the numbers of rows.

countDistinctBy keyf arr
Signature: keyf:('T -> 'Key) -> arr:'T [,] -> ('Key * int) []
Type parameters: 'T, 'Key

Applies a keyfunction to each element and counts the amount of each distinct resulting key

empty
Signature: 'a [,]
Type parameters: 'a

Create an empty array2D

foldByCol f state arr
Signature: f:('?9004 -> 'T -> '?9004) -> state:'?9004 -> arr:'T [,] -> '?9004 []
Type parameters: '?9004, 'T

Fold all columns into one row array.

foldByRow f state arr
Signature: f:('?9007 -> 'T -> '?9007) -> state:'?9007 -> arr:'T [,] -> '?9007 []
Type parameters: '?9007, 'T

Fold all rows into one column array.

foldCol f state arr colI
Signature: f:('?8998 -> 'T -> '?8998) -> state:'?8998 -> arr:'T [,] -> colI:int -> '?8998
Type parameters: '?8998, 'T

Fold one column.

foldRow f state arr rowI
Signature: f:('?9001 -> 'T -> '?9001) -> state:'?9001 -> arr:'T [,] -> rowI:int -> '?9001
Type parameters: '?9001, 'T

Fold one row.

indexMaxBy projection arr
Signature: projection:('?8989 -> '?8990) -> arr:'?8989 [,] -> int * int
Type parameters: '?8989, '?8990

Returns the index of the element which is the biggest after projection according to the Operators.max operator in the array

map2 f arr1 arr2
Signature: f:('T -> 'T -> '?9025) -> arr1:'T [,] -> arr2:'T [,] -> '?9025 [,]
Type parameters: 'T, '?9025

Builds a new array whose elements are the results of applying the given function to the corresponding pairs of elements from the two arrays.

mapColI f arr
Signature: f:(int -> 'T -> '?9011) -> arr:'T [,] -> '?9011 [,]
Type parameters: 'T, '?9011

Builds a new array whose elements are the results of applying the given function to each of the elements of the array. The integer indices passed to the function indicates the column index of the element being transformed.

mapiInPlace f arr
Signature: f:(int -> 'T -> 'T) -> arr:'T [,] -> 'T [,]
Type parameters: 'T

Applying the given function to each of the elements of the array and returns the value in place. The integer indices passed to the function indicates the element being transformed.

mapInPlace f arr
Signature: f:('T -> 'T) -> arr:'T [,] -> 'T [,]
Type parameters: 'T

Applying the given function to each of the elements of the array and returns the value in place.

mapInPlaceColi f arr
Signature: f:(int -> 'T -> 'T) -> arr:'T [,] -> 'T [,]
Type parameters: 'T

Applying the given function to each of the elements of the array and returns the value in place. The integer indices passed to the function indicates the column index of the element being transformed.

mapInPlaceRowi f arr
Signature: f:(int -> 'T -> 'T) -> arr:'T [,] -> 'T [,]
Type parameters: 'T

Applying the given function to each of the elements of the array and returns the value in place. The integer indices passed to the function indicates the row index of the element being transformed.

mapRowI f arr
Signature: f:(int -> 'T -> '?9014) -> arr:'T [,] -> '?9014 [,]
Type parameters: 'T, '?9014

Builds a new array whose elements are the results of applying the given function to each of the elements of the array. The integer indices passed to the function indicates the row index of the element being transformed.

maxBy projection arr
Signature: projection:('?8986 -> '?8987) -> arr:'?8986 [,] -> '?8986
Type parameters: '?8986, '?8987

Returns the element of the array which is the biggest after projection according to the Operators.max operator

ofJaggedArray(arr)
Signature: arr:'a [] [] -> 'a [,]
Type parameters: 'a

Converts a jagged array (twodimensional) into a array2D

ofLongColumnArray arr nrow ncol
Signature: arr:'?8982 [] -> nrow:int -> ncol:int -> '?8982 [,]
Type parameters: '?8982

Creates a Array2D out of a column array [a1;b1;c1;a2;b2;c2;...]

rowCount(arr)
Signature: arr:'T [,] -> int
Type parameters: 'T

Returns the numbers of rows.

shuffle(arr)
Signature: arr:'?9031 [,] -> '?9031 [,]
Type parameters: '?9031

Shuffels the input Array2D (method: Fisher-Yates)

shuffleColumnWise(arr)
Signature: arr:'?9027 [,] -> '?9027 [,]
Type parameters: '?9027

Shuffels each column of the input Array2D separately (method: Fisher-Yates)

shuffleRowWise(arr)
Signature: arr:'?9029 [,] -> '?9029 [,]
Type parameters: '?9029

Shuffels each row of the input Array2D separately (method: Fisher-Yates)

toArray(arr)
Signature: arr:'?8974 [,] -> '?8974 []
Type parameters: '?8974

Converts a array2D with one row to array

toJaggedArray(arr)
Signature: arr:'?8976 [,] -> '?8976 [] []
Type parameters: '?8976

Converts a array2D to jagged array

toLongColumnArray(arr)
Signature: arr:'?8980 [,] -> '?8980 []
Type parameters: '?8980

concate the columns of an Array2D into a long column array

transpose(arr)
Signature: arr:'?8992 [,] -> '?8992 [,]
Type parameters: '?8992

Transpose the array

Fork me on GitHub