function x=allcorners(A,b)
%ALLCORNERS Returns all corners (including invalid ones) to Ax>=b.
%
%x=allcorners(A,b)

% v1.0  2000-09-25. Niclas Borlin, niclas@cs.umu.se.

[m,n]=size(A);

% Get all possible row selections.
i=nchoosek(1:m,n);

% Pre-allocate corner matrix.
x=zeros(n,size(i,1));

% Calculate corner for each row selection.
for j=1:size(i,1)
	x(:,j)=A(i(j,:),:)\b(i(j,:));
end