diff --git a/CheckPhiDependency1.m b/CheckPhiDependency1.m index d2c9c8d..34108e7 100644 --- a/CheckPhiDependency1.m +++ b/CheckPhiDependency1.m @@ -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 \ No newline at end of file diff --git a/CheckPhiDependency2.m b/CheckPhiDependency2.m index df237f6..c09a7fc 100644 --- a/CheckPhiDependency2.m +++ b/CheckPhiDependency2.m @@ -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 - diff --git a/CheckPhiDependency3.m b/CheckPhiDependency3.m index e0fa8d1..0e99100 100644 --- a/CheckPhiDependency3.m +++ b/CheckPhiDependency3.m @@ -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 \ No newline at end of file diff --git a/checkPhiDependency4.m b/checkPhiDependency4.m index 488037f..ccdcfc0 100644 --- a/checkPhiDependency4.m +++ b/checkPhiDependency4.m @@ -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 \ No newline at end of file diff --git a/checkPhiDependency5.m b/checkPhiDependency5.m index a117efc..37e4172 100644 --- a/checkPhiDependency5.m +++ b/checkPhiDependency5.m @@ -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 - diff --git a/gui.fig b/gui.fig index c4c330e..f49131b 100644 Binary files a/gui.fig and b/gui.fig differ