-
Notifications
You must be signed in to change notification settings - Fork 0
/
shiftProfile.m
39 lines (34 loc) · 953 Bytes
/
shiftProfile.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
35
36
37
38
39
function[] = shiftProfile(A, iterations)
%------------------------------------------------------------------------
%
% shiftProfile.m:
% Profiles the two methods of performing the shift operation:
% kroneckerSliceShift.m and loopShift.m.
%
% Inputs:
% A: The matrix to shift
% iterations: The number of times to perform the operations
%
%------------------------------------------------------------------------
outDir = 'output/';
% A is assumed to be square for the purposes of comparison
length = size(A, 1);
% Profile loopShift
profile on;
for i=1:iterations
loopShift(A);
end
p = profile('info');
profsave(p, [outDir num2str(length) '_' num2str(iterations)...
'_loopShift_profile']);
profile off;
% Profile kroneckerSliceShift
profile on;
for i=1:iterations
kroneckerSliceShift(A);
end
p = profile('info');
profsave(p, [outDir num2str(length) '_' num2str(iterations)...
'_kroneckerSliceShift_profile']);
profile off;
end