-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathratio4speedup.m
195 lines (177 loc) · 3.67 KB
/
ratio4speedup.m
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
clear,clc,close
%%
[random_data,real_world_data]=getdata();
disp("------------for random data---------------");
[ran_SU_all,ran_ratio_of_good,ran_ratio_of_vastly_good]=testSU(random_data);
disp("-------------for real_world data-----------");
[real_SU_all,real_ratio_of_good,real_ratio_of_vastly_good]=testSU(real_world_data);
function [SU_all,ratio_of_good,ratio_of_vastly_good]=testSU(A)
l=length(A)/2;
SU_all = zeros(l,1);
for i=1:l
SU_all(i,1)=SU(A(2*i-1:2*i,:));
end
%
SUvg=SU_all(SU_all>1);
ratio_of_vastly_good = size(SUvg,1)/size(A,1)
SUg=SU_all(SU_all<=1);
ratio_of_good=mean(SUg)
end
function y=SU(A)
t1=A(1,1);t2=A(2,1);e1=A(1,2);e2=A(2,2);
if t1>t2 && e1>e2
y=0;
else
y=abs(t2*e2/t1/e1-1);
end
end
function [data1,data2]=getdata()
f1=[11.878 9.79947E-11
14.648 9.79405E-11
10.671 0.001742481
10.515 0.002392897
12.92 9.74E-11
14.999 9.07699E-11
10.755 0.037303937
10.703 0.036432656
12.059 9.83248E-11
16.47 8.77686E-11
11.121 0.00253867
10.79 0.003969445
13.29 9.34E-11
16.119 9.10619E-11
10.843 0.019558147
10.94 0.026342581];
f2=[
19.868 9.29258E-11
26.881 9.18194E-11
16.406 0.002853987
16.406 0.003916825
24.909 9.19138E-11
29.38 0.000271601
16.547 0.048879634
16.335 0.05587663
17.866 9.91142E-11
23.882 9.87E-11
16.732 0.002893985
16.637 0.003958884
21.198 9.22332E-11
29.026 3.60147E-07
16.691 0.042054807
16.686 0.056297096];
f3=[
72.714 9.00077E-11
77.704 9.98524E-11
65.851 2.31133E-06
65.325 0.000968043
82.742 9.8831E-11
92.234 9.40474E-11
66.262 1.5205E-05
65.65 0.034037656
72.617 9.15108E-11
89.732 9.47697E-11
67.645 0.001337964
67.038 0.00252245
83.51 9.36543E-11
89.575 9.2416E-11
67.455 9.64899E-06
66.984 0.017691741];
f4=[45.458 9.39437E-11
65.164 8.80423E-11
39.786 0.001451066
39.462 0.003358878
29.022 8.27108E-11
29.666 9.71744E-11
37.681 6.55713E-07
37.213 1.25935E-05
44.212 9.14586E-11
51.609 9.28134E-11
41.175 0.001121484
40.643 0.001716615
29.057 8.83626E-11
30.062 8.87418E-11
38.152 1.60009E-06
37.774 9.05142E-06];
f5=[18.152 6.80583E-10
17.932 2.28935E-07
9.627 0.02563741
9.519 0.030814355
18.109 4.41297E-08
18.11 0.000564961
9.667 0.121472377
9.575 0.158418817
18.138 6.66018E-09
18.037 7.71162E-06
10.099 0.02323628
9.794 0.027339948
18.091 2.12846E-09
18.251 7.1886E-08
9.888 0.130148367
9.846 0.167707546];
f6=[26.361 4.92714E-10
26.328 0.004126396
14.622 0.019427473
14.532 0.027355038
26.649 1.2682E-07
27.103 1.31934E-06
14.594 0.074493152
14.586 0.180163871
26.501 3.78745E-07
26.497 0.005689117
14.709 0.019678969
14.685 0.029027619
26.468 0.021888015
26.56 0.029087737
14.887 0.088612299
14.833 0.182029067];
f7=[100.435 9.8561E-11
113.164 9.07984E-08
57.037 0.025216892
56.434 0.02746139
113.187 1.46884E-10
113.887 0.002124462
56.543 0.223365624
56.058 0.242182602
102.269 9.8683E-11
113.39 0.00084024
56.673 0.025853519
56.716 0.028102102
113.525 2.36817E-10
113.251 2.40689E-06
56.961 0.228489279
56.594 0.24749942];
f8=[65.649 2.80292E-09
65.222 0.00204163
35.223 0.027339345
34.956 0.029012085
63.033 9.34129E-11
64.771 1.93579E-07
35.466 0.208692454
35.24 0.220596857
59.895 9.40246E-11
65.023 0.002376444
35.241 0.008941357
35.231 0.02478168
64.889 2.41E-09
65.254 3.0299E-05
35.578 0.209623315
35.305 0.221283228];
f9=[44.704 0.658428502
44.767 0.657683942
21.803 0.678097435
21.683 0.678402546
44.749 0.659058637
44.669 0.659101745
21.756 0.6781346
21.673 0.678402772
44.774 0.49091303
45.02 0.490133395
22.233 0.519107955
22.248 0.51989014
44.807 0.492870026
44.749 0.493855911
22.177 0.519178374
21.958 0.519890242];
data1=[f1;f2;f3;f4;f5;f6;f7;f8];
data2=f9;
end