-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheckSymmetry.m
61 lines (50 loc) · 1.44 KB
/
checkSymmetry.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function [] = checkSymmetry(SparseMatA, filename, testCaseName)
[m n] = size(SparseMatA);
% Get a matrix with only the non-symmetric
F = spSymmetricFilter(SparseMatA);
figure;
hold off;
spy(F, 5);
axis('square');
if (nargin < 3)
titlestr1 = 'Non-symmetric Stencil Edges';
title(titlestr1);
else
titlestr1 = sprintf('[%s] ', testCaseName);
titlestr2 = sprintf('Non-symmetric Stencil Edges');
title({titlestr1, titlestr2});
end
ylabel('Stencil ID (S)');
xlabel('IDs of stencils which do not contain S in the stencil set');
%print('nonSymEdges.png', '-dpng', '-r300');
% 1 = size of marker
figure;
hold off;
spy(SparseMatA, 5);
if (nargin < 3)
label1 = sprintf('Sparsity pattern of %s (Dimensions: %d x %d)', filename, m, n);
title(label1);
else
label1 = sprintf('[%s] ', testCaseName);
label2 = sprintf('Sparsity pattern of %s (Dimensions: %d x %d)', filename, m, n);
title({label1, label2});
end
axis('square');
xlabel('column');
ylabel('row');
%print('fullMatSpy.png', '-dpng', '-r300');
figure;
hold off;
image(full(SparseMatA));
axis('square');
if (nargin < 3)
label1 = 'Stencil weight distribution of full system';
title(label1);
else
label1 = sprintf('[%s] ', testCaseName);
label2 = sprintf('Stencil weight distribution %s (Dimensions: %d x %d)', filename, m, n);
title({label1, label2});
end
%print('fullMatWeights.png', '-dpng', '-r300');
spMeasureSymmetry(SparseMatA);
end