This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Program 1 Foundations of Computational Math 1 Fall 2011 Due date: via email by 11:59PM on Friday, 7 October 2011 General Task Consider the case where A ∈ R n × n is nonsingular and the system Ax = b is to be solved via LU factorization without pivoting, using partial pivoting or using complete pivoting. Implement a code that is capable of performing these three tasks, based on a user selection, and one or more test routines designed to evaluate and validate the correctness of the code. Your code should also detect situations where the factorization may not proceed and exit gracefully. Clearly, this is the case when the candidate pivot set contains no acceptable value. In exact arithmetic this means they are all 0. Your code should also allow the detection of a set of candidate pivots that are all “too small” and warn the user. You may code in any language you wish with C, Fortran or MATLAB are preferred. In all cases, however, you may not use standard libraries such as LAPACK or built-in matrix routines for pieces of your routines with the exception of the test routines. Submission of Results Expected results comprise: 1. A document describing the tests used and the results generated to validate the correct functioning of the code. You should write this in a manner intended to convince me that your code behaves correctly. 2. The source code, makefiles, and instructions on how to compile and execute your code including the math department’s machine used if applicable. 3. Code documentation should be included in each routine. These results should be emailed to [email protected] by 11:59PM on the due date above. You may be asked to demonstrate your code if your document does not completely convince me that you tested your code sufficiently. Code Structure Your factorization routine should accept the matrix A stored in a simple 2-dimensional array- like data structure and other relevant parameters such as n and a flag indicating what form of the factorization should be attempted, e.g., no pivoting, partial pivoting, or complete pivoting. The routine should return the matrices L and U stored within the array that 1 contained A on input, i.e., you should implement the in-place algorithm strategy described in the class notes and lectures. You should also keep a copy of A in an additional data structure for correctness checking. The 1 values on the diagonal of L , the 0 values in the upper triangular portion of L and the 0 values in the lower triangular portion of...
View Full Document
- Fall '09