% Script to test LU_pivot.m
% K. Ming Leung, 02/05/03

% A=[2  6 10
%    1  3  3
%    3 14 28];
A=[ 1 2 2
    4 4 2
    4 6 4];     % Example 6.2 Heath, p.73
b=[3;6;10]; n=length(b);
[L,U,P]=LU_pivot(A);

display(L);
display(U);
% The following matrices must be identical.
% They are the same as A but with rows permuted.
T1=L*U,
T2=P*A,
y = forwardSubstitution(L,b,n);
x = backSubstitution(U,y,n),
xMatlab = A\b,