Skip to content

Commit 7ead710

Browse files
committed
Dependency Checks Over Phi
1 parent 0a67c26 commit 7ead710

10 files changed

Lines changed: 201 additions & 7 deletions

CheckPhiDependency1.m

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
% Validate whether there is any dependency of the bit allocation problem
2+
% with the phi in function 1 when omega is integer and when not
3+
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+

CheckPhiDependency1.m~

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
% Validate whether there is any dependency of the bit allocation problem
2+
% with the phi in function 1 when omega is integer and when not
3+
for i=1:1:10,
4+
B = 12379;
5+
omega = rand * 10;
6+
phi = rand*2*pi;
7+
floor_phi = fl
8+
alpha = rand * 10;
9+
[b_org,N_org,] = func3Numerically( omega,phi,1,alpha,B);
10+
for j=10:10:100,
11+
[b,N,] = func3Numerically( omega,phi,j,alpha,B);
12+
if abs(b-b_org)>0.001
13+
disp('Dependent !!!');
14+
end
15+
end
16+
fprintf('done: %d \n',i);
17+
end
18+

CheckPhiDependency2.m

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
% Validate whether there is any dependency of the bit allocation problem
2+
% with the phi in function 2 when omega is integer and when not
3+
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);
26+
end
27+

CheckPhiDependency3.m

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
% Validate whether there is any dependency of the bit allocation problem
2+
% with the phi in function 3 when omega is integer and when not
3+
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+

CheckPhiDependency3.m~

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
% Validate whether there is any dependency of the bit allocation problem
2+
% with the phi in function 1 when omega is integer and when not
3+
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,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 = funcNumerically(floor(omega),phi,j,B);
22+
if abs(b_floor-b_org_floor)>0.001
23+
disp('Integer Dependent !!!');
24+
end
25+
end
26+
fprintf('done: %d \n',i);
27+
end
28+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
% Validate whether there is any dependency of the bit allocation problem
2-
% with the amplitude in function 1
2+
% with the amplitude in function 3
33
for i=1:1:10,
44
B = 12379;
55
omega = rand * 10;

checkPhiDependency4.m

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
% Validate whether there is any dependency of the bit allocation problem
2+
% with the phi in function 4 when omega is integer and when not
3+
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+

checkPhiDependency5.m

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
% Validate whether there is any dependency of the bit allocation problem
2+
% with the phi in function 5 when omega is integer and when not
3+
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);
31+
end
32+

gui.fig

-556 Bytes
Binary file not shown.

gui.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ function gui_OpeningFcn(hObject, eventdata, handles, varargin)
3131

3232

3333
% --- Outputs from this function are returned to the command line.
34-
function varargout = gui_OutputFcn(hObject, eventdata, handles)
34+
function varargout = gui_OutputFcn(hObject, ~, handles)
3535
varargout{1} = handles.output;
3636

37-
function initialize_gui(fig_handle, handles, isreset)
37+
function initialize_gui(~, handles, isreset)
3838
global s qss;
3939
s = NaN;
4040
qss = NaN;
@@ -151,7 +151,7 @@ function Apply_Callback(hObject, eventdata, handles)
151151

152152

153153
% --- Executes on selection change in FunctionsMenu.
154-
function FunctionsMenu_Callback(hObject, eventdata, handles)
154+
function FunctionsMenu_Callback(hObject, ~, handles)
155155
set(handles.A,'String','');
156156
set(handles.bit_budget,'String','');
157157
set(handles.Omega,'String','');
@@ -292,7 +292,7 @@ function b_Callback(hObject, eventdata, handles)
292292

293293
function N_Callback(hObject, eventdata, handles)
294294

295-
function pushbutton1_Callback(hObject, eventdata, handles)
295+
function pushbutton1_Callback(~, ~, ~)
296296

297297
function popupmenu1_Callback(hObject, eventdata, handles)
298298

@@ -304,7 +304,7 @@ function figure1_WindowButtonDownFcn(hObject, eventdata, handles)
304304

305305
function figure1_WindowButtonUpFcn(hObject, eventdata, handles)
306306

307-
function figure1_WindowKeyPressFcn(hObject, eventdata, handles)
307+
function figure1_WindowKeyPressFcn(~, eventdata, handles)
308308

309309
function figure1_WindowKeyReleaseFcn(hObject, eventdata, handles)
310310

@@ -330,7 +330,7 @@ function edit12_CreateFcn(hObject, eventdata, handles)
330330

331331
function edit10_Callback(hObject, eventdata, handles)
332332

333-
function popupmenu1_CreateFcn(hObject, eventdata, handles)
333+
function popupmenu1_CreateFcn(hObject, ~, handles)
334334
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
335335
set(hObject,'BackgroundColor','white');
336336
end

0 commit comments

Comments
 (0)