function [x1,x2,x3,res,pg] = lucompare(A,b,x0)

% Primerjava GE, GEPP, GECP

% LU brez pivotiranja
[L,U] = lubasic(A);
x1 = U\(L\b);
pg1 = max(max(abs(U)))/max(max(abs(A)));

% LU z delnim pivotiranjem (vgrajena funkcija v Matlabu)
[L,U,P] = lu(A);
x2 = U\(L\(P*b));
x2 = A\b;
pg2 = max(max(abs(U)))/max(max(abs(A)));

% LU s kompletnim pivotiranjem
[L,U,P,Q] = lucomplete(A);
x3 = Q*(U\(L\(P*b)));
pg3 = max(max(abs(U)))/max(max(abs(A)));

res = [norm(x1-x0) norm(x2-x0) norm(x3-x0)];
pg = [pg1 pg2 pg3];


