Write a FORTRAN77 program that uses Gauss-Jordan elimination with row shifting to solve a system of linear algebraic equations.
- It should read the data in from a file called data.d. The first number in data.d will be an integer, N, that indicates the size of the system. For example, if it is a 5, the matrix will be 5x5 and the solution will have 5 elements. The next N^2 terms will be the matrix and the last N terms will be the "b" vector in Ax=b. The largest matrix size will be 100x100.
- During the forward reduction phase, row shifting should be used to put the element with the largest magnitude at or below the diagonal element into the pivot position. You should use your subroutine from Homework 9 to do the row shifting.
- If the largest magnitude possible for a pivot term is less than 10E-6, a warning message should be printed that the matrix is ill-conditioned.
- Test your program on the following data files. Your final program should always use row shifting, but for debugging purposes, the first file should work without row shifting. The second file requires row shifting. I don't know what will happen with the third file. The fourth file has a matrix A and vector b for which there is no solution x, so your program should print a warning for that.
- Here is the program and data file from class on December 4.