-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathpprljournal.m
More file actions
70 lines (56 loc) · 2.09 KB
/
pprljournal.m
File metadata and controls
70 lines (56 loc) · 2.09 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
% nohup /p/matlab-7.14/bin/matlab -nodisplay -nodesktop -nojvm -nosplash -r pprljournal > pprlj.txt &
%
filename = 'ljournal';
data_directory = '../data/';
output_directory = '../results/';
addpath ..;
load([data_directory filename]);
load([data_directory filename 'trials']);
numtrials = size(indices,1);
times = zeros(numtrials,4);
conds = zeros(numtrials,4);
cuts = zeros(numtrials,4);
vols = zeros(numtrials,4);
setsizes = zeros(numtrials,4);
n = size(A,1);
fprintf('starting graph = %s\n', filename);
% randseed
etype = 1;
for trial_num=1:numtrials
tic; [dummy,conds(trial_num,etype),cuts(trial_num,etype),vols(trial_num,etype)] = pprgrow(A,indices(trial_num,etype));
times(trial_num,etype) = toc;
setsizes(trial_num,etype) = min(length(dummy), n - length(dummy));
end
fprintf('\t pprrandseed done\n');
% heavyseed
etype = 2;
for trial_num=1:numtrials
tic; [dummy,conds(trial_num,etype),cuts(trial_num,etype),vols(trial_num,etype)] = pprgrow(A,indices(trial_num,etype));
times(trial_num,etype) = toc;
setsizes(trial_num,etype) = min(length(dummy), n - length(dummy));
end
fprintf('\t pprheavyseed done\n');
% randhood
etype = 3;
for trial_num=1:numtrials
tic; [dummy,conds(trial_num,etype),cuts(trial_num,etype),vols(trial_num,etype)] = pprgrow(A,indices(trial_num,etype),'neighborhood',true);
times(trial_num,etype) = toc;
setsizes(trial_num,etype) = min(length(dummy), n - length(dummy));
end
fprintf('\t pprrandhood done\n');
% heavyhood
% etype = 4;
% for trial_num=1:numtrials
% tic; [dummy,conds(trial_num,etype),cuts(trial_num,etype),vols(trial_num,etype)] = pprgrow(A,indices(trial_num,etype),'neighborhood',true);
% times(trial_num,etype) = toc;
% setsizes(trial_num,etype) = min(length(dummy), n - length(dummy));
% end
% fprintf('\t pprheavyhood done\n');
avecond = sum(conds(:,1))./numtrials;
avetime = sum(times(:,1))./numtrials;
fprintf('avecond=%f avetime=%f \n', avecond, avetime);
dataname = 'ppr';
outputname = strcat(dataname,filename,'trials');
save([output_directory outputname '.mat'], 'gsize', 'setsizes', 'vols', 'cuts',...
'indices', 'times', 'conds', 'dataname', 'filename','-v7.3');
exit;