Im fairly new to c++ and am trying to program strassen's algorithm to multiply matrices. Part of the algorithm requires me to partition a matrix into four parts e.g
4 5 6 7
6 7 8 9
1 2 3 4
2 3 5 6
partitioned:
4 5 6 7
6 7 8 9
1 2 3 4
2 3 5 6
(each part is then used again recursively and partitioned). I want to partition the matrices without looping and copying the data from the original matrix (as this would take more time). The book i am reading says the matrices are partitioned using 'index calculations, identifying a submatrix by a range of row indices and a range of column indices of the original matrix.i am not sure what is meant by this.
Also, im not sure whether i should be using 2D arrays or vectors? Ive seen alot of people recommending vectors but ive already written everything so far in 2D arrays so im hoping what i want is possible with 2D arrays.
p.s it can be assumed the dimensions of the matrices will always be a power of 2 and be nxn (square). Also, i have seen alot of questions similar to this but none of them actually have the solution i am looking for.
Thanks