3 ms·
Did I misunderstand something? that "3x3" matrix isn't a 2 dimensional matrix. It's a 9 item array.
by cynicalpeace 2y ago
Did I misunderstand something? that "3x3" matrix isn't a 2 dimensional matrix. It's a 9 item array.
- viraptor 2y agoThey're the same thing in a way. Most dense n-dimensional matrices are stored as a simple 1d array with some metadata about how to interpret it.
- floydnoel 2y agoWe learned to do that in my second CS class at university. It is a common way to represent a matrix. instead of keeping track of just `i`, you will also have a row index and use the modulus operator on the iterator tracking (i) to get the column index.