What is the following code doing? global DEBUG;DEBUG=true;…
What is the following code doing? global DEBUG;DEBUG=true;A=;b=;P = ;A = P*A;b = P*b;n = 3;debug_mat(“A: “, A);debug_mat(“b: “, b);C = A;for k=1:n C(k,k) = 0; x(k,1) = 0; epsilon_a(k,1) = 1;endfor k=1:n C(k,1:n) = C(k,1:n)/A(k,k); d(k) = b(k)/A(k,k);enddebug_mat(“x: “, x);debug_mat(“C: “, C);debug_mat(“d: “, d);show = ;% from book, Fig 12.2, es=0.00001% is 0.0000001% called the ‘stop criterion’book_es = 0.0000001;for iter=1:50 % an nx1 column vector; should b zeros! e = A*x – b; % Griffis Method: a little looser bound; cheat a little here % this is also nx1 column vector of “err” bounds err = ((n+1)*abs(A)*abs(x)+abs(b))*eps; err_subm = (norm(A,1)*norm(x,1)+norm(b,1))*eps; % important tests! UNDERSTAND what these say. x_is_floating_pt_valid = norm(e,1) ‘, repmat(‘%8.16f ‘, 1, n), ‘\n’]; fprintf(“%s\n”, entry); fprintf(fmt1, A’); fprintf(“\n”);end