I have a matrix in the form below where the position is only given via one iterable (x).
A B 1 0 3 2 0 2 4 5
where for matrixA[x] and matrixB[x]
matrixA = 1, matrixA = 0, matrixA = 0, matrixA = 2 matrixB = 3, matrixB = 2 etc.
What would be the best way to implement a multiplication of matrices A and B (preferably in C) when the only way to receive the position within a matrix is through variable x (also have the length of width and height)?
(the examples I have gotten from google all use two variables - height and width to solve this however I'm only working with one)