Logo

Programming-Idioms

History of Idiom 26 > diff from v11 to v12

Edit summary for version 12 by :

Version 11

2015-09-04, 20:43:49

Version 12

2015-09-04, 20:45:32

Idiom #26 Create a 2-dimensional array

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

Idiom #26 Create a 2-dimensional array

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

Code
x = [ j**(1/i) | i <- [1..m], j <- [1..n] ]
Code
x = [ [ j**(1/i) | j <- [1..n] ] | i <- [1..m] ]
Comments bubble
read no need to cast this through (Data.Array.listArray ((1,1),(m,n)))
Comments bubble
read no need to cast this through (Data.Array.listArray ((1,1),(m,n)))