/gausian-elimination

Use the code for Gaussian elimination discussed in class as a base to do the following. Create a separate program file for each part: a) Use the triangular form of the matrix after the elimination step to calculate the determinant of the matrix. [As a check confirm that you get the same answer as in question 1 for a matrix.] Notice how a simple transformation dramatically reduces the number of operations needed to compute the determinant. This is another aspect of programming that makes it both beautiful and fun. b) Using the triangular form of the matrix after the elimination step calculate the inverse of the matrix. You can use the code in part a) as a function. Create a .o file and a .h header file for the function that does elimination. Include the .h file in your code file for the inverse and then use the .o file when you generate the executable. c) Implement the following variation of Gaussian elimination called the Gauss-Jordan method. In the elimination step we zeroed out all entries in the column below the pivot element to finally get a triangular matrix. Instead, if we zero out all entries both above and below the pivot element in the column then we will be left with a diagonal matrix after the elimination step. Now. the backsubstitution step becomes very simple - just divide each RHS by the corresponding diagonal entry to get the solution to the system of linear equations. Remember that in each elimination step you have to ensure that the pivot element is not 0.

gausian-elimination

Use the code for Gaussian elimination discussed in class as a base to do the following. Create a separate program file for each part: a) Use the triangular form of the matrix after the elimination step to calculate the determinant of the matrix. [As a check confirm that you get the same answer as in question 1 for a matrix.] Notice how a simple transformation dramatically reduces the number of operations needed to compute the determinant. This is another aspect of programming that makes it both beautiful and fun. b) Using the triangular form of the matrix after the elimination step calculate the inverse of the matrix. You can use the code in part a) as a function. Create a .o file and a .h header file for the function that does elimination. Include the .h file in your code file for the inverse and then use the .o file when you generate the executable. c) Implement the following variation of Gaussian elimination called the Gauss-Jordan method. In the elimination step we zeroed out all entries in the column below the pivot element to finally get a triangular matrix. Instead, if we zero out all entries both above and below the pivot element in the column then we will be left with a diagonal matrix after the elimination step. Now. the backsubstitution step becomes very simple - just divide each RHS by the corresponding diagonal entry to get the solution to the system of linear equations. Remember that in each elimination step you have to ensure that the pivot element is not 0.