Skip to content

Commit 5bf0e1b

Browse files
committed
Updated Checks
1 parent 655c812 commit 5bf0e1b

6 files changed

Lines changed: 152 additions & 131 deletions

File tree

CheckPhiDependency1.m

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
11
% Validate whether there is any dependency of the bit allocation problem
22
% with the phi in function 1 when omega is integer and when not
33
for i=1:1:10,
4-
A = rand * 15;
5-
B = 12379;
6-
omega = rand * 10;
7-
floor_omega = floor(omega);
8-
phi = rand*2*pi;
9-
[b_org,N_org,] = func1Numerically(omega,phi,A,B);
10-
[b_org_floor,N_org_floor,] = func1Numerically(floor_omega,phi,A,B);
11-
for j=1:1:10,
12-
phi = rand*2*pi;
13-
b = func1Numerically( omega,phi,j,B);
14-
if abs(b-b_org)>0.001
15-
disp('General Dependent !!!');
16-
end
17-
if abs(b-b_org)>0.1
18-
disp('Significant General Dependent !!!');
19-
end
20-
b_floor = func1Numerically(floor(omega),phi,j,B);
21-
if abs(b_floor-b_org_floor)>0.001
22-
disp('Integer Dependent !!!');
23-
end
24-
end
25-
fprintf('done: %d \n',i);
26-
end
27-
4+
epsilon = 0.001;
5+
A = rand * 15 + epsilon;
6+
B = 2048;
7+
omega = rand * 10 + epsilon;
8+
floor_omega = ceil(omega);
9+
[b_org,N_org,] = func1Numerically(omega,phi,A,B);
10+
[b_org_floor,N_org_floor,] = func1Numerically(floor_omega,phi,A,B);
11+
for j=1:1:10,
12+
phi = rand*2*pi;
13+
b = func1Numerically( omega,phi,j,B);
14+
b_floor = func1Numerically(ceil(omega),phi,j,B);
15+
if abs(b_floor-b_org_floor)>0.1
16+
disp('Significant Integer Dependent !!!');
17+
break;
18+
end
19+
if abs(b_floor-b_org_floor)>epsilon
20+
disp('Integer Dependent !!!');
21+
break;
22+
end
23+
if abs(b-b_org)>0.1
24+
disp('Significant General Dependent !!!');
25+
break;
26+
end
27+
if abs(b-b_org)>epsilon
28+
disp('General Dependent !!!');
29+
break;
30+
end
31+
end
32+
fprintf('done: %d \n',i);
33+
end

CheckPhiDependency2.m

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,33 @@
11
% Validate whether there is any dependency of the bit allocation problem
22
% with the phi in function 2 when omega is integer and when not
33
for i=1:1:10,
4-
A = rand * 15;
5-
B = 12379;
6-
omega = rand * 10;
7-
floor_omega = floor(omega);
8-
phi = rand*2*pi;
9-
[b_org,N_org,] = func2Numerically(omega,phi,A,B);
10-
[b_org_floor,N_org_floor,] = func2Numerically(floor_omega,phi,A,B);
11-
for j=1:1:10,
12-
phi = rand*2*pi;
13-
b = func2Numerically(omega,phi,j,B);
14-
if abs(b-b_org)>0.001
15-
disp('General Dependent !!!');
16-
end
17-
if abs(b-b_org)>0.1
18-
disp('Significant General Dependent !!!');
19-
end
20-
b_floor = func2Numerically(floor(omega),phi,j,B);
21-
if abs(b_floor-b_org_floor)>0.001
22-
disp('Integer Dependent !!!');
23-
end
24-
end
25-
fprintf('done: %d \n',i);
4+
epsilon = 0.001;
5+
A = rand * 15 + epsilon;
6+
B = 12379;
7+
omega = rand * 10 + epsilon;
8+
floor_omega = ceil(omega);
9+
[b_org,N_org,] = func2Numerically(omega,phi,A,B);
10+
[b_org_floor,N_org_floor,] = func2Numerically(floor_omega,phi,A,B);
11+
for j=1:1:10,
12+
phi = rand*2*pi;
13+
b = func2Numerically(omega,phi,j,B);
14+
b_floor = func2Numerically(ceil(omega),phi,j,B);
15+
if abs(b_floor-b_org_floor)>0.1
16+
disp('Significant Integer Dependent !!!');
17+
break;
18+
end
19+
if abs(b_floor-b_org_floor)>epsilon
20+
disp('Integer Dependent !!!');
21+
break;
22+
end
23+
if abs(b-b_org)>0.1
24+
disp('Significant General Dependent !!!');
25+
break;
26+
end
27+
if abs(b-b_org)>epsilon
28+
disp('General Dependent !!!');
29+
break;
30+
end
31+
end
32+
fprintf('done: %d \n',i);
2633
end
27-

CheckPhiDependency3.m

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
% Validate whether there is any dependency of the bit allocation problem
22
% with the phi in function 3 when omega is integer and when not
33
for i=1:1:10,
4-
A = rand * 15;
5-
B = 12379;
6-
alpha = rand*5;
7-
omega = rand * 10;
8-
floor_omega = floor(omega);
9-
phi = rand*2*pi;
10-
[b_org,N_org,] = func3Numerically(omega,phi,A,alpha,B);
11-
[b_org_floor,N_org_floor,] = func3Numerically(floor_omega,phi,A,floor(alpha),B);
12-
for j=1:1:10,
13-
phi = rand*2*pi;
14-
b = func3Numerically(omega,phi,j,alpha,B);
15-
if abs(b-b_org)>0.001
16-
disp('General Dependent !!!');
17-
end
18-
if abs(b-b_org)>0.1
19-
disp('Significant General Dependent !!!');
20-
end
21-
b_floor = func3Numerically(floor(omega),phi,j,floor(alpha),B);
22-
if abs(b_floor-b_org_floor)>0.001
23-
disp('Integer Dependent !!!');
24-
end
25-
if abs(b_floor-b_org_floor)>0.1
26-
disp('Significant Integer Dependent !!!');
27-
end
28-
end
29-
fprintf('done: %d \n',i);
30-
end
31-
4+
epsilon = 0.001;
5+
A = rand * 15 + epsilon;
6+
B = 2048;
7+
alpha = rand*5 + epsilon;
8+
omega = rand * 10 + epsilon;
9+
floor_omega = ceil(omega);
10+
[b_org,N_org,] = func3Numerically(omega,phi,A,alpha,B);
11+
[b_org_floor,N_org_floor,] = func3Numerically(floor_omega,phi,A,ceil(alpha),B);
12+
for j=1:1:10,
13+
phi = rand*2*pi;
14+
b = func3Numerically(omega,phi,j,alpha,B);
15+
b_floor = func3Numerically(ceil(omega),phi,j,ceil(alpha),B);
16+
if abs(b_floor-b_org_floor)>0.1
17+
disp('Significant Integer Dependent !!!');
18+
break;
19+
end
20+
if abs(b_floor-b_org_floor)>epsilon
21+
disp('Integer Dependent !!!');
22+
break;
23+
end
24+
if abs(b-b_org)>0.1
25+
disp('Significant General Dependent !!!');
26+
break;
27+
end
28+
if abs(b-b_org)>epsilon
29+
disp('General Dependent !!!');
30+
break;
31+
end
32+
end
33+
fprintf('done: %d \n',i);
34+
end

checkPhiDependency4.m

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
11
% Validate whether there is any dependency of the bit allocation problem
22
% with the phi in function 4 when omega is integer and when not
33
for i=1:1:10,
4-
A = rand * 15;
5-
B = 12379;
6-
alpha = rand*5;
7-
omega = rand * 10;
8-
floor_omega = floor(omega);
9-
phi = rand*2*pi;
10-
[b_org,N_org,] = func4Numerically(omega,phi,A,alpha,B);
11-
[b_org_floor,N_org_floor,] = func4Numerically(floor_omega,phi,A,floor(alpha),B);
12-
for j=1:1:10,
13-
phi = rand*2*pi;
14-
b = func4Numerically(omega,phi,j,alpha,B);
15-
if abs(b-b_org)>0.001
16-
disp('General Dependent !!!');
17-
end
18-
if abs(b-b_org)>0.1
19-
disp('Significant General Dependent !!!');
20-
end
21-
b_floor = func4Numerically(floor(omega),phi,j,floor(alpha),B);
22-
if abs(b_floor-b_org_floor)>0.001
23-
disp('Integer Dependent !!!');
24-
end
25-
if abs(b_floor-b_org_floor)>0.1
26-
disp('Significant Integer Dependent !!!');
27-
end
28-
end
29-
fprintf('done: %d \n',i);
30-
end
31-
4+
epsilon = 0.001;
5+
A = rand * 15 + epsilon;
6+
B = 2048;
7+
alpha = rand*5 + epsilon;
8+
omega = rand * 10 + epsilon;
9+
floor_omega = ceil(omega);
10+
[b_org,N_org,] = func4Numerically(omega,phi,A,alpha,B);
11+
[b_org_floor,N_org_floor,] = func4Numerically(floor_omega,phi,A,ceil(alpha),B);
12+
for j=1:1:10,
13+
phi = rand*2*pi;
14+
b = func4Numerically(omega,phi,j,alpha,B);
15+
b_floor = func4Numerically(ceil(omega),phi,j,ceil(alpha),B);
16+
if abs(b_floor-b_org_floor)>0.1
17+
disp('Significant Integer Dependent !!!');
18+
break;
19+
end
20+
if abs(b_floor-b_org_floor)>epsilon
21+
disp('Integer Dependent !!!');
22+
break;
23+
end
24+
if abs(b-b_org)>0.1
25+
disp('Significant General Dependent !!!');
26+
break;
27+
end
28+
if abs(b-b_org)>epsilon
29+
disp('General Dependent !!!');
30+
break;
31+
end
32+
end
33+
fprintf('done: %d \n',i);
34+
end

checkPhiDependency5.m

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
11
% Validate whether there is any dependency of the bit allocation problem
22
% with the phi in function 5 when omega is integer and when not
33
for i=1:1:10,
4-
A = rand * 15;
5-
B = 12379;
6-
alpha = rand*5;
7-
beta = rand*3;
8-
omega = rand * 10;
9-
floor_omega = floor(omega);
10-
phi = rand*2*pi;
11-
[b_org,N_org,] = func5Numerically(omega,phi,A,alpha,beta,B);
12-
[b_org_floor,N_org_floor,] = func5Numerically(floor_omega,phi,A,floor(alpha),beta,B);
13-
for j=1:1:10,
14-
phi = rand*2*pi;
15-
b = func5Numerically(omega,phi,j,alpha,beta,B);
16-
if abs(b-b_org)>0.001
17-
disp('General Dependent !!!');
18-
end
19-
if abs(b-b_org)>0.1
20-
disp('Significant General Dependent !!!');
21-
end
22-
b_floor = func5Numerically(floor(omega),phi,j,floor(alpha),beta,B);
23-
if abs(b_floor-b_org_floor)>0.001
24-
disp('Integer Dependent !!!');
25-
end
26-
if abs(b_floor-b_org_floor)>0.1
27-
disp('Significant Integer Dependent !!!');
28-
end
29-
end
30-
fprintf('done: %d \n',i);
4+
epsilon = 0.001;
5+
A = rand * 15 + epsilon;
6+
B = 12379;
7+
alpha = rand*5 + epsilon;
8+
beta = rand*3 + epsilon;
9+
omega = rand * 10 + epsilon;
10+
floor_omega = ceil(omega);
11+
[b_org,N_org,] = func5Numerically(omega,phi,A,alpha,beta,B);
12+
[b_org_floor,N_org_floor,] = func5Numerically(floor_omega,phi,A,ceil(alpha),beta,B);
13+
for j=1:1:10,
14+
b_floor = func5Numerically(ceil(omega),phi,j,ceil(alpha),beta,B);
15+
phi = rand*2*pi;
16+
b = func5Numerically(omega,phi,j,alpha,beta,B);
17+
if abs(b_floor-b_org_floor)>0.1
18+
disp('Significant Integer Dependent !!!');
19+
break;
20+
end
21+
if abs(b_floor-b_org_floor)>epsilon
22+
disp('Integer Dependent !!!');
23+
break;
24+
end
25+
if abs(b-b_org)>0.1
26+
disp('Significant General Dependent !!!');
27+
break;
28+
end
29+
if abs(b-b_org)>epsilon
30+
disp('General Dependent !!!');
31+
break;
32+
end
33+
end
34+
fprintf('done: %d \n',i);
3135
end
32-

gui.fig

105 KB
Binary file not shown.

0 commit comments

Comments
 (0)