% aeig - Arrow for eigenvalue/vector decomposition
%
% aeig :: N:natural, I:[[M]->[N]] -> arrow( {[[N,N]]}, {[[N,M]], [[M]]}, empty).
function o=aeig(N,I)
	J=(1+N)-I;
	o=arr(@eigsI,'sizefn',@(sz){[N,length(I)],[length(I),1]});

	function [V,d]=eigsI(A)
		[V,D]=eig(A.cov);
		V=V(:,J);
		d=diag(D);
		d=d(J);
	end
end


