I have an mxn matrix, that is stored in memory in an array:
matA = new float[m * n];
// ... Assign values
matA[0] = 1;
matB[1] = 2;
// ...
After I finish with this array, I then need to create very similar array to store a new mxn matrix--the same matrix as before, but with each column shifted to the right. Let's call it matB.
Am I better of to create a new matrix?
matB = new float[m * n];
// ... Assign values
matB[0] = 23;
matB[1] = 1;
matB[2] = 2;
// ...
Or is there a more efficient way to shift the values in the matrix?