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.

DumpDataset.m 1.0KB

4 years ago
12345678910111213141516171819202122232425262728293031
  1. function [] = DumpDataset(dataFilePath, dataFileName, iter, removedNodesList, outPath)
  2. fprintf('reading network information from file %s%s ...\n', dataFilePath, dataFileName);
  3. load(strcat(dataFilePath, dataFileName), 'data');
  4. % save original file only once
  5. %if iter == 1
  6. outFile = sprintf('%s_%d_orig', dataFileName, iter);
  7. SaveAsciiGraph(outPath, outFile, data);
  8. %end
  9. n = size(removedNodesList,1);
  10. m = size(removedNodesList,2);
  11. for i=1:m
  12. removedNodes = removedNodesList{i};
  13. partial_data = data;
  14. partial_data(removedNodes,:) = 0;
  15. partial_data(:,removedNodes) = 0;
  16. outFile = sprintf('%s_%d_%i_part', dataFileName, iter, i);
  17. SaveAsciiGraph(outPath, outFile, partial_data);
  18. outFile = sprintf('%s%s_%d_%i_miss.txt', outPath, dataFileName, iter, i);
  19. SaveIntMatrixToFile(outFile, removedNodes);
  20. LogMsg(sprintf('DumpDataset for %s%s iter %d/%d into %s%s.', dataFilePath, dataFileName, iter, i, outPath, outFile));
  21. end
  22. %fprintf('Completed DumpDataset.\n');