回答編集履歴
3
Update
answer
CHANGED
@@ -30,7 +30,7 @@
|
|
30
30
|
:
|
31
31
|
```
|
32
32
|
|
33
|
-
以下の環境での実行時間は `N = 1e+7` で `0.66±0.
|
33
|
+
以下の環境での実行時間は `N = 1e+7` で `0.66±0.02` 秒程度になりました(`timeit` モジュールを利用して計測)。
|
34
34
|
```sh
|
35
35
|
$ lscpu | grep -E '^(Architecture|Model name)'
|
36
36
|
Architecture: x86_64
|
2
Update
answer
CHANGED
@@ -9,6 +9,7 @@
|
|
9
9
|
rg = default_rng()
|
10
10
|
orbit = rg.uniform(*num_range, M)
|
11
11
|
|
12
|
+
orbit_org = orbit.copy()
|
12
13
|
orbit.sort()
|
13
14
|
pdcount, bin_edge = np.histogram(orbit, bins=N, range=num_range)
|
14
15
|
bins = np.split(orbit, pdcount.cumsum()[:-1])
|
1
Update
answer
CHANGED
@@ -19,23 +19,29 @@
|
|
19
19
|
ratio[i] = hist[hist>0].size/pdcount[i]
|
20
20
|
|
21
21
|
print(ratio)
|
22
|
-
|
23
22
|
#
|
24
23
|
[0.63314754 0.63316065 0.6325016 0.63304742 0.6318326 0.63409262
|
25
24
|
0.6309113 0.6328047 0.63185449 0.63081087 0.63180382 0.63368009
|
26
25
|
0.63418594 0.63202644 0.630325 0.62935527 0.63230635 0.63173384
|
27
26
|
0.63192124 0.63125318 0.63181714 0.63249917 0.63271949 0.63248817
|
28
27
|
0.63252976 0.63157 0.63182343 0.63087606 0.63256839 0.6310312
|
28
|
+
:
|
29
|
+
:
|
29
|
-
|
30
|
+
```
|
30
|
-
|
31
|
+
|
31
|
-
0.63364018 0.63112059 0.63156005 0.63327901 0.63140728 0.63146173
|
32
|
-
0.6311587 0.63168948 0.63176906 0.63185224 0.63264017 0.63252129
|
33
|
-
0.63105783 0.63270842 0.63198682 0.63040526 0.63040611 0.63211661
|
34
|
-
0.63182223 0.63224523 0.6316447 0.63094144 0.6314832 0.63239629
|
35
|
-
|
32
|
+
以下の環境での実行時間は `N = 1e+7` で `0.66±0.2` 秒程度になりました(`timeit` モジュールを利用して計測)。
|
36
|
-
|
33
|
+
```sh
|
37
|
-
|
34
|
+
$ lscpu | grep -E '^(Architecture|Model name)'
|
35
|
+
Architecture: x86_64
|
38
|
-
|
36
|
+
Model name: Intel(R) Core(TM) i5-8500T CPU @ 2.10GHz
|
37
|
+
|
38
|
+
$ lsb_release -ir
|
39
|
+
Distributor ID: Ubuntu
|
40
|
+
Release: 21.04
|
41
|
+
|
42
|
+
$ python3 --version
|
43
|
+
Python 3.9.5
|
44
|
+
|
39
|
-
|
45
|
+
$ python3 -c 'import numpy;print(numpy.__version__)'
|
40
|
-
|
46
|
+
1.21.4
|
41
47
|
```
|