You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FindFacebookNeighbors_binary.m 602B

12345678910111213141516171819202122232425262728293031
  1. function [ neighbors ] = FindFacebookNeighbors_binary( fileName, node_index, max_node_index )
  2. %UNTITLED4 Summary of this function goes here
  3. % Detailed explanation goes here
  4. if nargin < 3
  5. max_node_index = 957359;
  6. end
  7. if node_index >= max_node_index
  8. neighbors = -1;
  9. return;
  10. end
  11. fid = fopen(fileName);
  12. fseek(fid, 0, 'eof');
  13. fileSize = ftell(fid);
  14. line = FindLineNumber(fid, fileSize, node_index);
  15. fclose(fid);
  16. if line == -1
  17. return;
  18. end
  19. neighbors = str2double(regexp(line, ' +', 'split'));
  20. neighbors(2) = []; %the second number is a timestamp
  21. end