%residual_correction.m
% m-script to apply the residual correction method
% with the purpose of estimating the
% accuracy in the computed solution x1 to the system Ax=b.
%Examples taken from textbook Problem 1, Section 6.5 on page 302.

A1=[4 -6 4 -1 ; -6 14 -11 3; 4 -11 10 -3;  -1 3 -3 1];
b1=[0.43 ;-1 ; 0.82 ; -0.23];
[x1,lu1,p1]= GEpivot(A1,b1);
disp('The solution is: ')
fprintf(' %15.4f \n', x1)

disp('***** Another example *****')

A2=[5 7 6 5 ; 7 10 8 7; 6 8 10 9 ; 5 7 9 10];
b2=[23 ; 32 ; 33 ; 31];
[x2,lu2,p2]= GEpivot(A2,b2);
disp('The solution is: ')
fprintf(' %15.4f \n', x2)

