Logo

Programming-Idioms

History of Idiom 26 > diff from v60 to v61

Edit summary for version 61 by miguel:
New Kotlin implementation by user [miguel]

Version 60

2019-09-26, 17:37:51

Version 61

2019-09-26, 18:44:20

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Illustration

Idiom #26 Create a 2-dimensional array

Declare and initialize a matrix x having m rows and n columns, containing real numbers.

Illustration
Code
val x = Array(m, { DoubleArray(n) })
Comments bubble
The type of x is Array<DoubleArray>. In other words, an array of arrays.