Creates an array whose elements are all initially the given value
int
The length of the first dimension.
int
The length of the second dimension.
int
The length of the third dimension.
int
The length of the fourth dimension.
'T
The initial value for each element of the array.
'T[,,,]
The created array.
Array4D.create 2 2 2 2 1
module Array4D from Microsoft.FSharp.Collections
val create: length1: int -> length2: int -> length3: int -> length4: int -> initial: 'T -> 'T array4d
Evaluates to a 2x2x2x2 array with all entries1
Fetches an element from a 4D array. You can also use the syntax 'array.[index1,index2,index3,index4]'
let array: float[,,,] = Array4D.zeroCreate 2 3 4 5
array[0,2,1,3]
Multiple items
val array: float array4d
--------------------
type 'T array = 'T array
Multiple items
val float: value: 'T -> float (requires member op_Explicit)
--------------------
type float = System.Double
--------------------
type float<'Measure> = float
module Array4D from Microsoft.FSharp.Collections
val zeroCreate: length1: int -> length2: int -> length3: int -> length4: int -> 'T array4d
'T[,,,]
The input array.
int
The index along the first dimension.
int
The index along the second dimension.
int
The index along the third dimension.
int
The index along the fourth dimension.
'T
The value at the given index.
let array = Array4D.zeroCreate 2 3 4 5
Array4D.get array 0 2 1 3
Multiple items
val array: obj array4d
--------------------
type 'T array = 'T array
module Array4D from Microsoft.FSharp.Collections
val zeroCreate: length1: int -> length2: int -> length3: int -> length4: int -> 'T array4d
val get: array: 'T array4d -> index1: int -> index2: int -> index3: int -> index4: int -> 'T
Creates an array given the dimensions and a generator function to compute the elements.
int
The length of the first dimension.
int
The length of the second dimension.
int
The length of the third dimension.
int
The length of the fourth dimension.
int -> int -> int -> int -> 'T
The function to create an initial value at each index in the array.
'T[,,,]
The created array.
Array4D.init 2 2 2 2 (fun i j k l -> i*1000+j*100+k*10+l)
module Array4D from Microsoft.FSharp.Collections
val init: length1: int -> length2: int -> length3: int -> length4: int -> initializer: (int -> int -> int -> int -> 'T) -> 'T array4d
val i: int
val j: int
val k: int
val l: int
Evaluates to a 2x2x2x2 array with contents[[[[0; 1]; [10; 11]]; [[100; 101]; [110; 111]]];[[[1000; 1]; [1010; 1011]]; [[1100; 1101]; [1110; 1111]]]]
Returns the length of an array in the first dimension
'T[,,,]
The input array.
int
The length of the array in the first dimension.
let array = Array4D.init 2 3 4 5 (fun i j k -> 100*i + 10*j + k)
array |> Array4D.length1
type 'T array = 'T array
module Array4D from Microsoft.FSharp.Collections
val init: length1: int -> length2: int -> length3: int -> length4: int -> initializer: (int -> int -> int -> int -> 'T) -> 'T array4d
val i: int
val j: int
val k: int
val length1: array: 'T array4d -> int
Evaluates to2
.
Returns the length of an array in the second dimension.
'T[,,,]
The input array.
int
The length of the array in the second dimension.
let array = Array4D.init 2 3 4 5 (fun i j k -> 100*i + 10*j + k)
array |> Array4D.length2
type 'T array = 'T array
module Array4D from Microsoft.FSharp.Collections
val init: length1: int -> length2: int -> length3: int -> length4: int -> initializer: (int -> int -> int -> int -> 'T) -> 'T array4d
val i: int
val j: int
val k: int
val length2: array: 'T array4d -> int
Evaluates to3
.
Returns the length of an array in the third dimension.
'T[,,,]
The input array.
int
The length of the array in the third dimension.
let array = Array4D.init 2 3 4 5 (fun i j k -> 100*i + 10*j + k)
array |> Array4D.length3
type 'T array = 'T array
module Array4D from Microsoft.FSharp.Collections
val init: length1: int -> length2: int -> length3: int -> length4: int -> initializer: (int -> int -> int -> int -> 'T) -> 'T array4d
val i: int
val j: int
val k: int
val length3: array: 'T array4d -> int
Evaluates to4
.
Returns the length of an array in the fourth dimension.
'T[,,,]
The input array.
int
The length of the array in the fourth dimension.
let array = Array4D.init 2 3 4 5 (fun i j k -> 100*i + 10*j + k)
array |> Array4D.length4
type 'T array = 'T array
module Array4D from Microsoft.FSharp.Collections
val init: length1: int -> length2: int -> length3: int -> length4: int -> initializer: (int -> int -> int -> int -> 'T) -> 'T array4d
val i: int
val j: int
val k: int
val length4: array: 'T array4d -> int
Evaluates to5
.
Sets the value of an element in an array. You can also use the syntax 'array.[index1,index2,index3,index4] <- value'.
let array: float[,,,] = Array4D.zeroCreate 2 3 4 5
array[0,2,1,3] <- 5.0
Multiple items
val array: float array4d
--------------------
type 'T array = 'T array
Multiple items
val float: value: 'T -> float (requires member op_Explicit)
--------------------
type float = System.Double
--------------------
type float<'Measure> = float
module Array4D from Microsoft.FSharp.Collections
val zeroCreate: length1: int -> length2: int -> length3: int -> length4: int -> 'T array4d
'T[,,,]
The input array.
int
The index along the first dimension.
int
The index along the second dimension.
int
The index along the third dimension.
int
The index along the fourth dimension.
'T
The value to set.
let array = Array4D.zeroCreate 2 3 4 5
Array4D.2et array 0 2 1 3 5.0
Multiple items
val array: obj array4d
--------------------
type 'T array = 'T array
module Array4D from Microsoft.FSharp.Collections
val zeroCreate: length1: int -> length2: int -> length3: int -> length4: int -> 'T array4d
Creates an array where the entries are initially the "default" value.
int
The length of the first dimension.
int
The length of the second dimension.
int
The length of the third dimension.
int
The length of the fourth dimension.
'T[,,,]
The created array.
let array : float[,,,] = Array4D.zeroCreate 2 3 3 5
Multiple items
val array: float array4d
--------------------
type 'T array = 'T array
Multiple items
val float: value: 'T -> float (requires member op_Explicit)
--------------------
type float = System.Double
--------------------
type float<'Measure> = float
module Array4D from Microsoft.FSharp.Collections
val zeroCreate: length1: int -> length2: int -> length3: int -> length4: int -> 'T array4d
After evaluationarray
is a 2x3x3x5 array with contents all zero.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4