function [a,list] = delr(al,i1,j1)
%
% delc: zero out row neighbors of al(i1,j1) and al(i1,j1) itself
%       called by simridge
% On input:
%     al:
%     i1:
%     j1:
% On output:
%     a:
%     list:
% Call:
%      [a,list] = delr(al,i1,j1)
%

list = [];
a = al;
[m,n] = size(al);
count = 0; j2 = j1; done = 0;
while (j2>0) & (done==0)
  j2 = j2-1;
  if j2==0
    done = 1;
  elseif al(i1,j2) == 0
    done = 1;
  else
    a(i1,j2) = 0;
	count = count+1;
	list(count,1) = i1;
	list(count,2) = j2;
  end
end
a(i1,j1) = 0;
count = count+1;
list(count,1) = i1;
list(count,2) = j1;
j2 = j1; done = 0;
while (j2<(n+1)) & (done==0)
  j2 = j2+1;
  if j2>n
    done = 1;
  elseif al(i1,j2) == 0
    done = 1;
  else
    a(i1,j2) = 0;
	count = count+1;
	list(count,1) = i1;
	list(count,2) = j2;
  end
end
