I'm writing this code for QR decomposition (code bellow). My problem is that I calculate a matrix AM and which is the minor of my matrix QA. This AM matrix is to be passed to the next iteration of the loop and become my NewA matrix, but for some reason the data isn't going through
// QA minor: AM => i.e. QA: 3x3 and AM: 2x2
if(n>2)
{
for(int i = 0; i<n-1; i++)
for(int j = 0; j<n-1; j++)
AM[i][j]= QA[i+1][j+1]; // Gets passed up to become the NewA
** This AM matrix here is what I want to pass to the next iteration, but my new a matrix becomese:
-4.31602e+008 -4.31602e+008
-4.31602e+008 -4.31602e+008
it should be something like:
-49 -14
168 -77 **
//////////////////////////////////////////////////////////////////////
// Dont need data in NewA now
/*for(int i = 0; i<n; i++)
delete[] NewA[i];*/
//////////////////////////////////////////////////////////////////
// Calculation and store all the different Qs
Q_Tran = Tran(Q, N);
Q_Temp_Tran = Tran(Q_Temp, N);