JaggedArray Module

Functions and values

Function or value Description

copy arr

Full Usage: copy arr

Parameters:
    arr : 'a[][] -

Returns: 'a[][]

Copies the jagged array

arr : 'a[][]

Returns: 'a[][]

Example

fold innerFolder outerFolder innerState outerState jArray

Full Usage: fold innerFolder outerFolder innerState outerState jArray

Parameters:
    innerFolder : 'State1 -> 'T -> 'State1
    outerFolder : 'State2 -> 'State1 -> 'State2
    innerState : 'State1
    outerState : 'State2
    jArray : 'T[][]

Returns: 'State2

Applies a function to each element of the inner arrays of the jagged array, threading an accumulator argument through the computation.

A second function is the applied to each result of the predeceding computation, again passing an accumulater through the computation

innerFolder : 'State1 -> 'T -> 'State1
outerFolder : 'State2 -> 'State1 -> 'State2
innerState : 'State1
outerState : 'State2
jArray : 'T[][]
Returns: 'State2

init rowN colN f

Full Usage: init rowN colN f

Parameters:
    rowN : int -
    colN : int -
    f : int -> int -> 'a -

Returns: 'a[][]

Creates an jagged array with the given dimensions and a generator function to compute the elements

rowN : int

colN : int

f : int -> int -> 'a

Returns: 'a[][]

Example

innerChoose chooser jArray

Full Usage: innerChoose chooser jArray

Parameters:
    chooser : 'T -> 'U option -
    jArray : 'T[][] -

Returns: 'U[][]

Applies the given function to each element in the inner arrays of the jagged array. Returns the jagged array whose inner arrays are comprised of the results x for each element where the function returns Some(x)

chooser : 'T -> 'U option

jArray : 'T[][]

Returns: 'U[][]

Example

innerFilter predicate jArray

Full Usage: innerFilter predicate jArray

Parameters:
    predicate : 'T -> bool -
    jArray : 'T[][] -

Returns: 'T[][]

Returns a new jagged array whose inner arrays only contain the elements for which the given predicate returns true

predicate : 'T -> bool

jArray : 'T[][]

Returns: 'T[][]

Example

innerFold folder state jArray

Full Usage: innerFold folder state jArray

Parameters:
    folder : 'State -> 'T -> 'State -
    state : 'State -
    jArray : 'T[][] -

Returns: 'State[]

Applies a function to each element of the inner arrays of the jagged array, threading an accumulator argument through the computation.

folder : 'State -> 'T -> 'State

state : 'State

jArray : 'T[][]

Returns: 'State[]

Example

map mapping jArray

Full Usage: map mapping jArray

Parameters:
    mapping : 'T -> 'U -
    jArray : 'T[][] -

Returns: 'U[][]

Builds a new jagged array whose inner arrays are the results of applying the given function to each of their elements.

mapping : 'T -> 'U

jArray : 'T[][]

Returns: 'U[][]

Example

map2 mapping jArray1 jArray2

Full Usage: map2 mapping jArray1 jArray2

Parameters:
    mapping : 'T1 -> 'T2 -> 'U -
    jArray1 : 'T1[][] -
    jArray2 : 'T2[][] -

Returns: 'U[][]

Builds a new jagged array whose inner arrays are the results of applying the given function to the corresponding elements of the inner arrays of the two jagged arrays pairwise.
All corresponding inner arrays must be of the same length, otherwise ArgumentException is raised.

mapping : 'T1 -> 'T2 -> 'U

jArray1 : 'T1[][]

jArray2 : 'T2[][]

Returns: 'U[][]

Example

map3 mapping jArray1 jArray2 jArray3

Full Usage: map3 mapping jArray1 jArray2 jArray3

Parameters:
    mapping : 'T1 -> 'T2 -> 'T3 -> 'U -
    jArray1 : 'T1[][] -
    jArray2 : 'T2[][] -
    jArray3 : 'T3[][] -

Returns: 'U[][]

Builds a new jagged array whose inner arrays are the results of applying the given function to the corresponding elements of the inner arrays of the tree jagged arrays triplewise.
All corresponding inner arrays must be of the same length, otherwise ArgumentException is raised.

mapping : 'T1 -> 'T2 -> 'T3 -> 'U

jArray1 : 'T1[][]

jArray2 : 'T2[][]

jArray3 : 'T3[][]

Returns: 'U[][]

Example

mapi mapping jArray

Full Usage: mapi mapping jArray

Parameters:
    mapping : int -> 'T -> 'U -
    jArray : 'T[][] -

Returns: 'U[][]

Builds a new jagged array whose inner arrays are the results of applying the given function to each of their elements. The integer index passed to the function indicates the index of element in the inner array being transformed.

mapping : int -> 'T -> 'U

jArray : 'T[][]

Returns: 'U[][]

Example

ofArray2D arr

Full Usage: ofArray2D arr

Parameters:
    arr : 'T[,] -

Returns: 'T[][]

Converts a jagged array into an Array2D

arr : 'T[,]

Returns: 'T[][]

Example

ofJaggedList data

Full Usage: ofJaggedList data

Parameters:
    data : 'T list list -

Returns: 'T[][]

Converts a jagged list into a jagged array

data : 'T list list

Returns: 'T[][]

Example

ofJaggedSeq data

Full Usage: ofJaggedSeq data

Parameters:
    data : seq<'b> -

Returns: 'T[][]

Converts a jagged Seq into a jagged array

data : seq<'b>

Returns: 'T[][]

Example

shuffle arr

Full Usage: shuffle arr

Parameters:
    arr : 'T[][] -

Returns: 'T[][]

Shuffels a jagged array (method: Fisher-Yates)

arr : 'T[][]

Returns: 'T[][]

Example

shuffleColumnWise arr

Full Usage: shuffleColumnWise arr

Parameters:
    arr : 'T[][] -

Returns: 'T[][]

Shuffles each column of a jagged array separately (method: Fisher-Yates)

arr : 'T[][]

Returns: 'T[][]

Example

shuffleColumnWiseInPlace arr

Full Usage: shuffleColumnWiseInPlace arr

Parameters:
    arr : 'T[][] -

Returns: 'T[][]

Shuffles each column of a jagged array separately (method: Fisher-Yates) in place

arr : 'T[][]

Returns: 'T[][]

Example

shuffleInPlace arr

Full Usage: shuffleInPlace arr

Parameters:
    arr : 'T[][] -

Returns: 'T[][]

Shuffels a jagged array (method: Fisher-Yates) in place

arr : 'T[][]

Returns: 'T[][]

Example

shuffleRowWise arr

Full Usage: shuffleRowWise arr

Parameters:
    arr : 'T[][] -

Returns: 'T[][]

Shuffles each row of a jagged array separately (method: Fisher-Yates)

arr : 'T[][]

Returns: 'T[][]

Example

shuffleRowWiseInPlace arr

Full Usage: shuffleRowWiseInPlace arr

Parameters:
    arr : 'T[][] -

Returns: 'T[][]

Shuffles each row of a jagged array separately (method: Fisher-Yates) in place

arr : 'T[][]

Returns: 'T[][]

Example

toArray2D arr

Full Usage: toArray2D arr

Parameters:
    arr : 'T[][] -

Returns: 'T[,]

Converts from an Array2D into an jagged array

arr : 'T[][]

Returns: 'T[,]

Example

toJaggedList arr

Full Usage: toJaggedList arr

Parameters:
    arr : 'T[][] -

Returns: 'T list list

Converts a jagged array into a jagged list

arr : 'T[][]

Returns: 'T list list

Example

toJaggedSeq arr

Full Usage: toJaggedSeq arr

Parameters:
    arr : 'T[][] -

Returns: seq<seq<'T>>

Converts a jagged array into a jagged seq

arr : 'T[][]

Returns: seq<seq<'T>>

Example

transpose arr

Full Usage: transpose arr

Parameters:
    arr : 'T[][] -

Returns: 'T[][]

Transposes a jagged array

arr : 'T[][]

Returns: 'T[][]

Example

zeroCreate rowN colN

Full Usage: zeroCreate rowN colN

Parameters:
    rowN : int -
    colN : int -

Returns: 'a[][]

Creates an jagged array where the entries are initially the default value Unchecked.defaultof

rowN : int

colN : int

Returns: 'a[][]

Example