Skip to content

Commit

Permalink
Updated Checks
Browse files Browse the repository at this point in the history
  • Loading branch information
dormaayan committed Dec 16, 2016
1 parent 655c812 commit 5bf0e1b
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 131 deletions.
54 changes: 30 additions & 24 deletions CheckPhiDependency1.m
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
% Validate whether there is any dependency of the bit allocation problem
% with the phi in function 1 when omega is integer and when not
for i=1:1:10,
A = rand * 15;
B = 12379;
omega = rand * 10;
floor_omega = floor(omega);
phi = rand*2*pi;
[b_org,N_org,] = func1Numerically(omega,phi,A,B);
[b_org_floor,N_org_floor,] = func1Numerically(floor_omega,phi,A,B);
for j=1:1:10,
phi = rand*2*pi;
b = func1Numerically( omega,phi,j,B);
if abs(b-b_org)>0.001
disp('General Dependent !!!');
end
if abs(b-b_org)>0.1
disp('Significant General Dependent !!!');
end
b_floor = func1Numerically(floor(omega),phi,j,B);
if abs(b_floor-b_org_floor)>0.001
disp('Integer Dependent !!!');
end
end
fprintf('done: %d \n',i);
end

epsilon = 0.001;
A = rand * 15 + epsilon;
B = 2048;
omega = rand * 10 + epsilon;
floor_omega = ceil(omega);
[b_org,N_org,] = func1Numerically(omega,phi,A,B);
[b_org_floor,N_org_floor,] = func1Numerically(floor_omega,phi,A,B);
for j=1:1:10,
phi = rand*2*pi;
b = func1Numerically( omega,phi,j,B);
b_floor = func1Numerically(ceil(omega),phi,j,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
52 changes: 29 additions & 23 deletions CheckPhiDependency2.m
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
% Validate whether there is any dependency of the bit allocation problem
% with the phi in function 2 when omega is integer and when not
for i=1:1:10,
A = rand * 15;
B = 12379;
omega = rand * 10;
floor_omega = floor(omega);
phi = rand*2*pi;
[b_org,N_org,] = func2Numerically(omega,phi,A,B);
[b_org_floor,N_org_floor,] = func2Numerically(floor_omega,phi,A,B);
for j=1:1:10,
phi = rand*2*pi;
b = func2Numerically(omega,phi,j,B);
if abs(b-b_org)>0.001
disp('General Dependent !!!');
end
if abs(b-b_org)>0.1
disp('Significant General Dependent !!!');
end
b_floor = func2Numerically(floor(omega),phi,j,B);
if abs(b_floor-b_org_floor)>0.001
disp('Integer Dependent !!!');
end
end
fprintf('done: %d \n',i);
epsilon = 0.001;
A = rand * 15 + epsilon;
B = 12379;
omega = rand * 10 + epsilon;
floor_omega = ceil(omega);
[b_org,N_org,] = func2Numerically(omega,phi,A,B);
[b_org_floor,N_org_floor,] = func2Numerically(floor_omega,phi,A,B);
for j=1:1:10,
phi = rand*2*pi;
b = func2Numerically(omega,phi,j,B);
b_floor = func2Numerically(ceil(omega),phi,j,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

59 changes: 31 additions & 28 deletions CheckPhiDependency3.m
Original file line number Diff line number Diff line change
@@ -1,31 +1,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,
A = rand * 15;
B = 12379;
alpha = rand*5;
omega = rand * 10;
floor_omega = floor(omega);
phi = rand*2*pi;
[b_org,N_org,] = func3Numerically(omega,phi,A,alpha,B);
[b_org_floor,N_org_floor,] = func3Numerically(floor_omega,phi,A,floor(alpha),B);
for j=1:1:10,
phi = rand*2*pi;
b = func3Numerically(omega,phi,j,alpha,B);
if abs(b-b_org)>0.001
disp('General Dependent !!!');
end
if abs(b-b_org)>0.1
disp('Significant General Dependent !!!');
end
b_floor = func3Numerically(floor(omega),phi,j,floor(alpha),B);
if abs(b_floor-b_org_floor)>0.001
disp('Integer Dependent !!!');
end
if abs(b_floor-b_org_floor)>0.1
disp('Significant Integer Dependent !!!');
end
end
fprintf('done: %d \n',i);
end

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
59 changes: 31 additions & 28 deletions checkPhiDependency4.m
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
% Validate whether there is any dependency of the bit allocation problem
% with the phi in function 4 when omega is integer and when not
for i=1:1:10,
A = rand * 15;
B = 12379;
alpha = rand*5;
omega = rand * 10;
floor_omega = floor(omega);
phi = rand*2*pi;
[b_org,N_org,] = func4Numerically(omega,phi,A,alpha,B);
[b_org_floor,N_org_floor,] = func4Numerically(floor_omega,phi,A,floor(alpha),B);
for j=1:1:10,
phi = rand*2*pi;
b = func4Numerically(omega,phi,j,alpha,B);
if abs(b-b_org)>0.001
disp('General Dependent !!!');
end
if abs(b-b_org)>0.1
disp('Significant General Dependent !!!');
end
b_floor = func4Numerically(floor(omega),phi,j,floor(alpha),B);
if abs(b_floor-b_org_floor)>0.001
disp('Integer Dependent !!!');
end
if abs(b_floor-b_org_floor)>0.1
disp('Significant Integer Dependent !!!');
end
end
fprintf('done: %d \n',i);
end

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,] = func4Numerically(omega,phi,A,alpha,B);
[b_org_floor,N_org_floor,] = func4Numerically(floor_omega,phi,A,ceil(alpha),B);
for j=1:1:10,
phi = rand*2*pi;
b = func4Numerically(omega,phi,j,alpha,B);
b_floor = func4Numerically(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
59 changes: 31 additions & 28 deletions checkPhiDependency5.m
Original file line number Diff line number Diff line change
@@ -1,32 +1,35 @@
% Validate whether there is any dependency of the bit allocation problem
% with the phi in function 5 when omega is integer and when not
for i=1:1:10,
A = rand * 15;
B = 12379;
alpha = rand*5;
beta = rand*3;
omega = rand * 10;
floor_omega = floor(omega);
phi = rand*2*pi;
[b_org,N_org,] = func5Numerically(omega,phi,A,alpha,beta,B);
[b_org_floor,N_org_floor,] = func5Numerically(floor_omega,phi,A,floor(alpha),beta,B);
for j=1:1:10,
phi = rand*2*pi;
b = func5Numerically(omega,phi,j,alpha,beta,B);
if abs(b-b_org)>0.001
disp('General Dependent !!!');
end
if abs(b-b_org)>0.1
disp('Significant General Dependent !!!');
end
b_floor = func5Numerically(floor(omega),phi,j,floor(alpha),beta,B);
if abs(b_floor-b_org_floor)>0.001
disp('Integer Dependent !!!');
end
if abs(b_floor-b_org_floor)>0.1
disp('Significant Integer Dependent !!!');
end
end
fprintf('done: %d \n',i);
epsilon = 0.001;
A = rand * 15 + epsilon;
B = 12379;
alpha = rand*5 + epsilon;
beta = rand*3 + epsilon;
omega = rand * 10 + epsilon;
floor_omega = ceil(omega);
[b_org,N_org,] = func5Numerically(omega,phi,A,alpha,beta,B);
[b_org_floor,N_org_floor,] = func5Numerically(floor_omega,phi,A,ceil(alpha),beta,B);
for j=1:1:10,
b_floor = func5Numerically(ceil(omega),phi,j,ceil(alpha),beta,B);
phi = rand*2*pi;
b = func5Numerically(omega,phi,j,alpha,beta,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

Binary file modified gui.fig
Binary file not shown.

0 comments on commit 5bf0e1b

Please sign in to comment.