Hey,
I'm doing a project and on the last little piece.
It involved taking 2 matrices, splitting them into blocks and then checking whether the blocks are simular or not. If the blocks wasn't simular, then swap them /or/ create a new Matrix that holds the values of the second matrix (the correct one).
I have done this, and, been left the right Matrix, but, it's in 2x2 blocks and I need it to be in 4x4 blocks that match the same as the second Matrix. For example:
(The blocks are stored in a vector of vectors)
Matrix2:
0 0 0 1
1 1 0 1
0 1 1 0
0 1 0 1
Final Output:
00
11
01
01
01
01
10
01
I was thinking something like this:
vector<double> formatMatrix(vector<double>& theMatrix)
{
vector<double> newMatrix(4*4, 0);
for(int i=0; (i < 4*4); i++)
{
newMatrix.push_back(theMatrix[i]);
}
return newMatrix;
}
I need it so the final matrix is a 1D vector.
Any ideas? Thanks :)