function [mI,mJ,mA] = minnzrow(A)
	% [mI, mJ, mV] = minnzrow(A)
	% find the index of the smallest non-zero column in each row of A
	
	% sort largest first, so smallest has largest index
	[sA,sI]	= sort(A, 2, 'descend');
	% find non-zero entries in sorted A
	[I,J]		= find(sA);
	% find index J in every row of largest entry
	msJ		= max( sparse(I, J, J,size(A,1),size(A,2)), [], 2);
	[mI,~,jj] = find(msJ);
	mJ			= sI(sub2ind(size(A), mI, jj));
	mA			= full(sA(sub2ind(size(A), mI, jj)));
end
