File: readtriples.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 (9 lines) | stat: -rw-r--r-- 286 bytes parent folder | download
1
2
3
4
5
6
7
8
9
function A = readtriples(inputname)

[fid message] = fopen(inputname,'r');

% XMAT is a 3-by-nnz(X) matrix of triples (i.e. each column is a triple)
AMAT = fscanf(fid,'%d\t%d\t%f\n',[3 inf]);
whos
A = sparse(AMAT(1,2:end),AMAT(2,2:end),AMAT(3,2:end), AMAT(1,1), AMAT(2,1), AMAT(3,1));