-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckPhiDependency3.m
More file actions
34 lines (34 loc) · 1.09 KB
/
CheckPhiDependency3.m
File metadata and controls
34 lines (34 loc) · 1.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
% Validate whether there is any dependency of the bit allocation problem
% with the phi in function 3 when omega is integer and when not
for i=1:1:10,
epsilon = 0.001;
A = rand * 15 + epsilon;
B = 2048;
alpha = rand*5 + epsilon;
omega = rand * 10 + epsilon;
floor_omega = ceil(omega);
[b_org,N_org,] = func3Numerically(omega,phi,A,alpha,B);
[b_org_floor,N_org_floor,] = func3Numerically(floor_omega,phi,A,ceil(alpha),B);
for j=1:1:10,
phi = rand*2*pi;
b = func3Numerically(omega,phi,j,alpha,B);
b_floor = func3Numerically(ceil(omega),phi,j,ceil(alpha),B);
if abs(b_floor-b_org_floor)>0.1
disp('Significant Integer Dependent !!!');
break;
end
if abs(b_floor-b_org_floor)>epsilon
disp('Integer Dependent !!!');
break;
end
if abs(b-b_org)>0.1
disp('Significant General Dependent !!!');
break;
end
if abs(b-b_org)>epsilon
disp('General Dependent !!!');
break;
end
end
fprintf('done: %d \n',i);
end