質問編集履歴

2

dkato0077さんとのやりとりにあわせて「test.py」「main.pyx」のコードを変更しました。

2018/03/08 00:30

投稿

Ryupe
Ryupe

スコア426

test CHANGED
File without changes
test CHANGED
@@ -32,7 +32,9 @@
32
32
 
33
33
  if __name__ == '__main__':
34
34
 
35
- hoge(1000)
35
+ ans = hoge(10)
36
+
37
+ print(ans)
36
38
 
37
39
  ```
38
40
 
@@ -56,11 +58,15 @@
56
58
 
57
59
 
58
60
 
61
+ cdef int i
62
+
59
63
  cdef np.ndarray ans = np.zeros(loop, dtype=DTYPE)
60
64
 
61
65
 
62
66
 
63
- ans = [0 for i in range(loop)]
67
+ for i in range(loop):
68
+
69
+ ans[i] = 0
64
70
 
65
71
 
66
72
 

1

題名を変更しました「初期化方法」⇒「宣言方法」

2018/03/08 00:30

投稿

Ryupe
Ryupe

スコア426

test CHANGED
@@ -1 +1 @@
1
- 【Cython】配列の初期化方法
1
+ 【Cython】配列の宣言方法
test CHANGED
File without changes