mp3: Corrections

This commit is contained in:
Claudio Maggioni 2020-10-28 14:04:35 +01:00
parent aa9eb03131
commit 7690f4b23d
6 changed files with 11 additions and 9 deletions

Binary file not shown.

View file

@ -74,7 +74,7 @@ for c = 1:nc
A = params.Adj; A = params.Adj;
coords = params.coords; coords = params.coords;
W = A - diag(diag(A)); W = A;
% 2. Recursive routines % 2. Recursive routines
% i. Spectral % i. Spectral

View file

@ -20,7 +20,7 @@ function [part1,part2] = bisection_inertial(A,xy,picture)
% Steps % Steps
% 1. Calculate the center of mass. % 1. Calculate the center of mass.
m = sum(xy, 1) / size(xy, 1); m = sum(xy, 1) ./ size(xy, 1);
xm = m(1); xm = m(1);
ym = m(2); ym = m(2);

View file

@ -18,9 +18,9 @@ function [part1,part2] = bisection_spectral(A,xy,picture)
% Steps % Steps
% 1. Construct the Laplacian. % 1. Construct the Laplacian.
[i, j, ~] = find(triu(A)); D = diag(sum(A, 1));
G = graph(i, j); W = -1 .* A;
L = laplacian(G); L = D + W;
% 2. Calculate its eigensdecomposition. % 2. Calculate its eigensdecomposition.
[V, ~] = eigs(L,2,'smallestabs'); [V, ~] = eigs(L,2,'smallestabs');

View file

@ -7,6 +7,8 @@ addpaths_GP;
[W4,c4] = gridt(40); [W4,c4] = gridt(40);
[W5,c5] = grid9(30); [W5,c5] = grid9(30);
global W
global c
W = {W1, W2, W3, W4, W5, Smallmesh, Tapir, Eppstein}; W = {W1, W2, W3, W4, W5, Smallmesh, Tapir, Eppstein};
c = {c1, c2, c3, c4, c5, Smallmesh_coords, Tapir_coords, Eppstein_coords}; c = {c1, c2, c3, c4, c5, Smallmesh_coords, Tapir_coords, Eppstein_coords};
@ -24,8 +26,8 @@ function runtest(implementation)
global W global W
global c global c
for i=1:8 for i=1:8
out = implementation(W{i}, c{i}); [part1, ~] = implementation(W{i}, c{i});
ne = cutsize(W{i},out); ne = cutsize(W{i},part1);
fprintf('%d\t', ne); fprintf('%d\t', ne);
end end
fprintf('\n'); fprintf('\n');