function [res, err, np, cnd, timer] = test_prop(A)
% testuje wybrane wlasnosci rozkladu i rozwiazania
global solver;

	N = size(A,1);
	x = rand(N,1); b = A*x; 
	normA = norm(A,Inf); normx = norm(x,Inf);
	switch solver
	case 'PA = LU'
		[L U P] = lu(A);
		res = norm(P*A-L*U, Inf)/normA;
		tic; X = A\b; timer = toc;
	case 'A = QR'
		tic; [Q R] = qr(A);
		X = R\(Q'*b); timer = toc;
		res = norm(A-Q*R, Inf)/normA;
	case 'hilbert'
		res = NaN;
		X = invhilb(N)*b;
	otherwise
		res = NaN;
		X = NaN*b; timer = NaN;
	end
	err = norm(x-X,Inf)/normx; % blad
	np = norm(A*x-b,Inf)/(normA*normx+norm(b,Inf)); % numeryczne kryterium NP
	cnd = cond(A); % uwarunkowanie
end
