I want to create a sparse cell that can be used as a 2D accumulate structure.
1 2 3 4
1 [1] [3,2] [2,3,2] [1,2]
2 [1,3] [1,2] [2] [1,4]
3 [2] [1,2] [2,3] [1]
The dimension of the matrix is around 10e6 Here are the few things I though of:
Sparse Matrix
Of course this won't work since the element in the matrix should be array
.
Cell
This works somehow. But the memory is extremely heavy. It takes tons of memory at the very first assignment! Though it is said that cell structure is sparse itself, it doesn't appear practical in my case.
>> whos
Name Size Bytes Class Attributes
C 9357x12363 925445184 cell
Map
I though of using map to store the set where the coordinate being the key. However I can only find ways to assign 'char' as keytype, rather than two-dimensional coordinates.