File: writecolvector.m

package info (click to toggle)
combblas 2.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 190,476 kB
  • sloc: cpp: 55,912; ansic: 25,134; sh: 3,691; makefile: 548; csh: 66; python: 49; perl: 21
file content (15 lines) | stat: -rw-r--r-- 286 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function writecolvector(v,name,isint)

[i,j,k] = find(v);
fid = fopen(name, 'w+');
fprintf(fid, '%d\t%d\n',size(v,1), nnz(v)); 
if(isint)
	for m = 1:nnz(v)
		fprintf(fid, '%d\t%d\n',i(m),k(m)); 
	end
else
	for m = 1:nnz(v)
		fprintf(fid, '%d\t%.5f\n',i(m),k(m)); 
	end
end
fclose(fid);