Slide 17
Slide 17 text
▶ shape = [4]
– 1-dimensional array
▶ shape = [4,4]
– 2-dimentional array
▶ shape = [4,4,4]
– 3-dimensional array
Nov 19, 2017 RubyKaigi2017@Hiroshima 17
Shape = Array of sizes along dimensions
a[0,0] a[0,1] a[0,2] a[0,3]
a[1,0] a[1,1] a[1,2] a[1,3]
a[2,0] a[2,1] a[2,2] a[2,3]
a[3,0] a[3,1] a[3,2] a[3,3]
a[0] a[1] a[2] a[3]
a[0,0,0] a[0,0,1] a[0,0,2] a[0,0,3]
a[0,1,0] a[0,1,1] a[0,1,2] a[0,1,3]
a[0,2,0] a[0,2,1] a[0,2,2] a[0,2,3]
a[0,3,0] a[0,3,1] a[0,3,2] a[0,3,3]