I know how to reshape a list into a table. But how do I turn a table into a list or uni- dimensional array.
my_list=:3 4 $i.12
0 1 2 3
4 5 6 7
8 9 10 11
And is it better to perform operations on lists or tables or is there no difference (in terms of performance)
, y(ravel) is what you need:There is no performance difference for operations where the shape of the data does not matter, f.e.
1 + my_listand1 + , my_list. Also reshaping is free (if no padding is involved), because internally the atoms are always saved as a flat list with its corresponding shape.my_listcould be understood as the tuple of the listsdata: 0…11andshape: 3 4, while, my_listwould bedata: 0…11andshape: 12.