% własności numeryczne wybranych solverów i wybranych macierzy
disp('Wlasnosci solverow i macierzy');

clear;

global solver;

solver = 'PA = LU';


for slvr = 1:2
switch slvr
case 1 
	solver = 'PA = LU';
case 2
	solver = 'A = QR';
otherwise
	solver = 'undefined';
end

% jedna z macierzy Wilkinsona
err = []; np = []; res = []; cnd = []; timer = [];
matrix = 'Wilkinsona';
range = 1:55;
for N = range;
	W = eye(N,N)-tril(ones(N,N),-1);
	W(1:N,N) = ones(N,1);
	[res(N), err(N), np(N), cnd(N), timer(N)] = test_prop(W);
end
test_rysuj(range, err, np, res, cnd, timer, solver, matrix);

% macierz Hilberta
err = []; np = []; res = []; cnd = []; timer = [];
matrix = 'Hilberta';
range = 1:25;
for N = range;
	W = hilb(N);
	[res(N), err(N), np(N), cnd(N), timer(N)] = test_prop(W);
end
test_rysuj(range, err, np, res, cnd, timer, solver, matrix);


% losowe
err = []; np = []; res = []; cnd = []; timer = [];
matrix = 'Losowa';
range = 1:325;
for N = range;
	W = randn(N,N);
	[res(N), err(N), np(N), cnd(N), timer(N)] = test_prop(W);
end
test_rysuj(range, err, np, res, cnd, timer, solver, matrix);

end % for solver...
