Programming Assignment I
Programming Assignment I
Write a program (using C or MATLAB) for the solution of a system of linear equations using Gauss Elimination. The program should have the following features: The size of the system should be flexible and an input parameter. Incorporate the right hand side vector(s) in an augmented matrix. Number of right hand side vector(s) should be an input parameter. Program should ask for an option in the beginning, whether to obtain a solution or to invert the matrix. If inversion is chosen, it should automatically augment appropriate numbers of unit column vectors. Incorporate partial pivoting. Synthesize L and U matrices of the Doolittles method. Size of the system and the augmented matrix should be read from an input file (not from the terminal). The solution should be exported to an output file. The output file should be in a well laid out format incorporating appropriate text descriptions. For example, it may include the solution vector(s) with appropriate identifier(s) for each corresponding right hand side vector(s) (or inverse, if chosen), L matrix, U matrix, etc. Use modular programming concept. For example, you may write separate functions for synthesis of augmented matrix, carrying out partial pivoting, carrying out forward elimination, synthesis of LU decomposition and computation of solution using back substitution. Call these functions in a master program to achieve the objective.
Evaluation: You have to compile and run the program in the presence of a TA with the data supplied by the TA. Make sure you test all features of your program with at least 3 to 4 different sets of data (of different sizes) before coming for the evaluation. At the time of evaluation, submit a soft copy of the program that is being run. If multiple copies of the same program are found, all the copies will receive ZERO.