function a=loadsmms(filename)
% Function a=loadsmms(filename)
%   Loads a SMMS-formatted sparse matrix from the named file
%   (strips the dimension line, the terminating line)
eval(['fid=fopen(''' filename ''',''r'');']);
buffer=fgetl(fid);
% while 1
%   buffer = fgetl(fid);
%   if ~isstr(buffer), break, end
% end
x=fscanf(fid,'%d %d %f');
[n1 n2]=size(x);
if (x(n1-2)==0)
  n1 = n1 - 3; 
end
ip = 1:3:n1;
jp = 2:3:n1;
vp = 3:3:n1;      
i=x(ip);
j=x(jp);
v=x(vp);
a=spconvert([i,j,v]);
fclose(fid);
