Can sequence be multidimensional? If so, how is a 2d sequence type defined and used?
Also, since openarrays can't be multidimensional, how is its usage (2d indexing via multiplication) performance compared to a 2d sequence (if sequences can be multidimensional)?
Can sequence be multidimensional? If so, how is a 2d sequence type defined and used?
type
TMy2DSeq = seq[seq[int]]
var
x = @[@[1],@[1,2],@[1,2,3]]
> Also, since openarrays can't be multidimensional, how is its usage (2d indexing via multiplication) performance compared to a 2d sequence (if sequences can be multidimensional)?
I'm not quite sure, but a flat memory should always be faster than 2D pointer indexing.