-
Notifications
You must be signed in to change notification settings - Fork 5
/
run_perseus.m
34 lines (30 loc) · 1.15 KB
/
run_perseus.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function run_perseus(filePrefix, perseusDirectory)
% ----------------------------------------------------------------
% RUN PERSEUS
%
% Given a Perseus input file of the form generated by
% count_cliques_and_write_to_file, run the Perseus algorithm to
% compute the persistent homology of the given clique complex.
%
% INPUT:
% filePrefix: Prefix of clique file name
% perseusDirectory: Directory in which the compiled Perseus code
% is located
%
% ----------------------------------------------------------------
if ismac
perseusCommand = 'perseusMac';
system(sprintf('%s/%s nmfsimtop %s_simplices.txt %s_homology',...
perseusDirectory, perseusCommand, filePrefix, filePrefix));
elseif ispc
perseusCommand = 'perseusWin';
system(sprintf('"%s/%s" nmfsimtop %s_simplices.txt %s_homology',...
perseusDirectory, perseusCommand, filePrefix, filePrefix));
elseif isunix
perseusCommand = 'perseusLin';
system(sprintf('%s/%s nmfsimtop %s_simplices.txt %s_homology',...
perseusDirectory, perseusCommand, filePrefix, filePrefix));
else
error('Cannot determine operating system type to run Perseus.');
end
end