Logo

Programming-Idioms

History of Idiom 27 > diff from v1 to v2

Edit summary for version 2 by :

Version 1

2015-05-06, 21:04:49

Version 2

2015-08-19, 17:28:54

Idiom #27 Create a 3-dimensional array

Declare and initialize a 3D array x, having dimensions boundaries m, n, p, and containing real numbers.

Idiom #27 Create a 3-dimensional array

Declare and initialize a 3D array x, having dimensions boundaries m, n, p, and containing real numbers.

Code
let x = vec![vec![vec![0.0f64; P]; N]; M];
Comments bubble
You can also use stack-allocated arrays for this: `let x = [[[0.0f64; P]; N]; M];`
Demo URL
http://is.gd/bgzAzQ