Can someone help me troubleshoot my Gaussian Elimination code for scaling?

  • Thread starter Thread starter jinro
  • Start date Start date
AI Thread Summary
The discussion revolves around a coding issue related to Gaussian elimination, specifically concerning the scaling of matrix elements. The user is attempting to scale elements of a matrix A using a temporary matrix A4, where the operation A4[a][c] = A[a][c]/t yields the expected result. However, when they attempt to assign A[a][c] = A4[a][c], the output unexpectedly shows A[a][c] divided by t squared instead of the anticipated scaled value. The user also mentions trying to use another matrix, A3, which works correctly, but they are unable to resolve the issue with the original matrix A. The conversation highlights a need for code clarification to diagnose the problem effectively.
jinro
Messages
4
Reaction score
0
hi

i have this problem

this is part of my code, where i am scaling in guassian elimination

A4[a][c] = A[a][c]/t;

when i put printf A4 at the bottom, it shows the right element divided by t

when i put
A[a][c] = A4[a][c];

my output for my input when i scale becomes A[a][c]/t^2. i try to make another matrix A3, and used A3 = A4, it showed the right answer, but i can't make it work for A!
 
Technology news on Phys.org
Show us your code. I can't figure out what's going on from your description.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...
Back
Top