CMPSC/Mathematics 451 MATLAB Program One Due 26 February 2020 Spring 2020
You are to write a MATLAB function to implement the Hager–Higham method to estimate the condition number of the matrix A in the one-norm. This is explained in the notes on Canvas and in class.
Your function should have the form
[kappa,z,jmax]=cond1(L,U,p,A).
Thus, here L, U , and p are outputs from the command [L,U,p]=lu(A,’vector’).
Here kappa is the condition number κ1(A) = ∥A∥1∥A−1∥1, z is the vec- tor such that ∥z∥∞ = 1, ∥A−Tz∥∞ ≈ ∥A−1∥1 = ∥A−T∥∞, and jmax is a column of the identity matrix such that ∥A−1ejmax∥1 = ∥A−1∥1. Test your routine with the matrices generated by the m-files matrix1.m, matrix2.m, matrix3.m posted on Canvas in the MATLAB codes folder.
Your code should do no more than four iterations and it should be short. You can check your answer with the MATLAB function cond. The MATLAB statement kappa1 = cond(A, 1) gives you the condition number in the one- norm. If A is well conditioned, your value of kappa should be close to kappa1. If A is badly conditioned, they should both be very large.
A possible starting vector for z could the one recommended by Higham (in the notes) or it could be the one produced from the MATLAB statements
f = randn(n, 1);
z = f/norm(f,Inf);
where n is the dimension of A.
1