In article <firstname.lastname@example.org>, email@example.com writes:
>Had the idea to represent a 2d-matrix as a 1d-vector.
That's how most (if not all) programming languages do it.
>Need a function to map [ row, col ] indices to an index [ n ], and vice-versa. > >Then the rest should be straightforward. > >So we have two functions ...
>Then the rest of the code can be refactored to use the 1d-vector representation of a 2d-matrix. > >The question is, are there already existing formulas for matrix operations, where the matrix is represented as a 1d-vector?