Click here to Skip to main content
15,867,594 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to get the inversion of n*n method so using augmented method so i made the identity matrix then made column reduction then found the inverse
for(i=0;i<n;i++)
 {
    t=a[i][i];
    for(j=0;j<2*n;j++)
    {a[i][j]=a[i][j]/t;}     // divide all the row column by a[i][i] element

    for(int m=0;m<n;m++)
    {
       if(i!=m)
       {
          t=a[m][i];
          for(k=0;k<2*n;k++)
              a[m][k]-=t*a[i][k];
        }
    }
 }

need explanation for this part

What I have tried:

i tried to analyze it and found:
1.dividing all row element by the main diagonal element of this roe
2.make a row reduction and this part can not understand it
Posted
Updated 30-May-16 3:05am
Comments
Kenneth Haugland 27-May-16 15:30pm    
I explain one method here:
http://www.codeproject.com/Articles/616608/High-precision-native-Gaussian-Elimination
Sergey Alexandrovich Kryukov 27-May-16 15:44pm    
I hope it really works. In this case, it would make an excellent formal answer, not just a comment.
—SA
Kenneth Haugland 30-May-16 9:02am    
It does work as long as the preconditions for solving it is met, i.a. a square matrix. I just solve it column by column. PS: Sorry for the late reply :-)

1 solution

I have one way of solving the inverse of a matrix, solving it column by column:
High precision native Gaussian Elimination[^]

I also think you would benefit from reading up on matrixes in general, not just the inverse bit. Matrices are very useful in many areas, but mastering and understanding them can be a little tricky at first.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 30-May-16 10:27am    
5ed.
—SA
Kenneth Haugland 30-May-16 10:33am    
Thank you, Sergey :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900