-
Notifications
You must be signed in to change notification settings - Fork 0
/
OExpHarnack.m
36 lines (33 loc) · 1.11 KB
/
OExpHarnack.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
delta = input('Choose error delta, 0 < delta <= 1 ' );
decimal_digits = input('Enter number of decimal digits of delta: ');
trials = input('Enter number of trials to run: ');
size = input('Enter size of grid to compute over: ');
g_min = zeros(1, trials);
g_max = zeros(1, trials);
t_min = zeros(1, trials);
t_max = zeros(1, trials);
H_g = zeros(1, trials);
H_t = zeros(1, trials);
for i = 1:trials
%Generate Tiling Harmonic values on rectangular grid
%Saves both tiling harmonic and graph harmonic inner values
disp('trial '), disp(int2str(i));
B = rand(size);
G = o_graphHarmInner(B, decimal_digits);
M_in = round(G*10^decimal_digits)/(10^decimal_digits);
T = o_findAllInnerVals(M_in, delta);
g_min(i) = min(min(G(2:size-1, 2:size-1)));
g_max(i) = max(max(G(2:size-1, 2:size-1)));
H_g(i) = g_max(i)/g_min(i);
t_min(i) = min(min(T(2:size-1, 2:size-1)));
t_max(i) = max(max(T(2:size-1, 2:size-1)));
if t_min(i) == 0
H_t(i) = NaN;
else
H_t(i) = t_max(i)/t_min(i);
end
end
disp('Graph Harmonic Constants:');
disp(H_g);
disp('Graph Tiling Harmonic Constants:');
disp(H_t);