numo-narray 0.9.0.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +4 -0
  3. data/README.md +47 -0
  4. data/Rakefile +41 -0
  5. data/ext/numo/narray/SFMT-params.h +97 -0
  6. data/ext/numo/narray/SFMT-params19937.h +46 -0
  7. data/ext/numo/narray/SFMT.c +620 -0
  8. data/ext/numo/narray/SFMT.h +157 -0
  9. data/ext/numo/narray/array.c +525 -0
  10. data/ext/numo/narray/data.c +901 -0
  11. data/ext/numo/narray/depend.erb +33 -0
  12. data/ext/numo/narray/extconf.rb +117 -0
  13. data/ext/numo/narray/gen/bit.erb.c +811 -0
  14. data/ext/numo/narray/gen/cogen.rb +18 -0
  15. data/ext/numo/narray/gen/def/dcomplex.rb +32 -0
  16. data/ext/numo/narray/gen/def/dfloat.rb +30 -0
  17. data/ext/numo/narray/gen/def/int16.rb +29 -0
  18. data/ext/numo/narray/gen/def/int32.rb +29 -0
  19. data/ext/numo/narray/gen/def/int64.rb +29 -0
  20. data/ext/numo/narray/gen/def/int8.rb +29 -0
  21. data/ext/numo/narray/gen/def/robject.rb +30 -0
  22. data/ext/numo/narray/gen/def/scomplex.rb +32 -0
  23. data/ext/numo/narray/gen/def/sfloat.rb +30 -0
  24. data/ext/numo/narray/gen/def/uint16.rb +29 -0
  25. data/ext/numo/narray/gen/def/uint32.rb +29 -0
  26. data/ext/numo/narray/gen/def/uint64.rb +29 -0
  27. data/ext/numo/narray/gen/def/uint8.rb +29 -0
  28. data/ext/numo/narray/gen/dtype.erb.c +328 -0
  29. data/ext/numo/narray/gen/tmpl/accum.c +36 -0
  30. data/ext/numo/narray/gen/tmpl/accum_binary.c +75 -0
  31. data/ext/numo/narray/gen/tmpl/accum_index.c +58 -0
  32. data/ext/numo/narray/gen/tmpl/allocate.c +35 -0
  33. data/ext/numo/narray/gen/tmpl/aref.c +51 -0
  34. data/ext/numo/narray/gen/tmpl/aset.c +61 -0
  35. data/ext/numo/narray/gen/tmpl/binary.c +53 -0
  36. data/ext/numo/narray/gen/tmpl/binary2.c +55 -0
  37. data/ext/numo/narray/gen/tmpl/binary_s.c +34 -0
  38. data/ext/numo/narray/gen/tmpl/bit_binary.c +94 -0
  39. data/ext/numo/narray/gen/tmpl/bit_count.c +82 -0
  40. data/ext/numo/narray/gen/tmpl/bit_unary.c +77 -0
  41. data/ext/numo/narray/gen/tmpl/cast.c +37 -0
  42. data/ext/numo/narray/gen/tmpl/cast_array.c +79 -0
  43. data/ext/numo/narray/gen/tmpl/cast_numeric.c +22 -0
  44. data/ext/numo/narray/gen/tmpl/coerce_cast.c +8 -0
  45. data/ext/numo/narray/gen/tmpl/cond_binary.c +51 -0
  46. data/ext/numo/narray/gen/tmpl/cond_unary.c +45 -0
  47. data/ext/numo/narray/gen/tmpl/cum.c +42 -0
  48. data/ext/numo/narray/gen/tmpl/each.c +43 -0
  49. data/ext/numo/narray/gen/tmpl/each_with_index.c +64 -0
  50. data/ext/numo/narray/gen/tmpl/extract.c +23 -0
  51. data/ext/numo/narray/gen/tmpl/eye.c +91 -0
  52. data/ext/numo/narray/gen/tmpl/fill.c +38 -0
  53. data/ext/numo/narray/gen/tmpl/format.c +60 -0
  54. data/ext/numo/narray/gen/tmpl/format_to_a.c +47 -0
  55. data/ext/numo/narray/gen/tmpl/head.c +25 -0
  56. data/ext/numo/narray/gen/tmpl/inspect.c +16 -0
  57. data/ext/numo/narray/gen/tmpl/map_with_index.c +94 -0
  58. data/ext/numo/narray/gen/tmpl/median.c +44 -0
  59. data/ext/numo/narray/gen/tmpl/minmax.c +47 -0
  60. data/ext/numo/narray/gen/tmpl/poly.c +49 -0
  61. data/ext/numo/narray/gen/tmpl/pow.c +74 -0
  62. data/ext/numo/narray/gen/tmpl/powint.c +17 -0
  63. data/ext/numo/narray/gen/tmpl/qsort.c +149 -0
  64. data/ext/numo/narray/gen/tmpl/rand.c +33 -0
  65. data/ext/numo/narray/gen/tmpl/rand_norm.c +46 -0
  66. data/ext/numo/narray/gen/tmpl/robj_allocate.c +32 -0
  67. data/ext/numo/narray/gen/tmpl/seq.c +61 -0
  68. data/ext/numo/narray/gen/tmpl/set2.c +56 -0
  69. data/ext/numo/narray/gen/tmpl/sort.c +36 -0
  70. data/ext/numo/narray/gen/tmpl/sort_index.c +86 -0
  71. data/ext/numo/narray/gen/tmpl/store.c +31 -0
  72. data/ext/numo/narray/gen/tmpl/store_array.c +5 -0
  73. data/ext/numo/narray/gen/tmpl/store_from.c +53 -0
  74. data/ext/numo/narray/gen/tmpl/store_numeric.c +22 -0
  75. data/ext/numo/narray/gen/tmpl/to_a.c +41 -0
  76. data/ext/numo/narray/gen/tmpl/unary.c +58 -0
  77. data/ext/numo/narray/gen/tmpl/unary2.c +58 -0
  78. data/ext/numo/narray/gen/tmpl/unary_s.c +57 -0
  79. data/ext/numo/narray/index.c +822 -0
  80. data/ext/numo/narray/kwarg.c +79 -0
  81. data/ext/numo/narray/math.c +140 -0
  82. data/ext/numo/narray/narray.c +1539 -0
  83. data/ext/numo/narray/ndloop.c +1928 -0
  84. data/ext/numo/narray/numo/compat.h +23 -0
  85. data/ext/numo/narray/numo/intern.h +112 -0
  86. data/ext/numo/narray/numo/narray.h +411 -0
  87. data/ext/numo/narray/numo/ndloop.h +99 -0
  88. data/ext/numo/narray/numo/template.h +140 -0
  89. data/ext/numo/narray/numo/types/bit.h +19 -0
  90. data/ext/numo/narray/numo/types/complex.h +410 -0
  91. data/ext/numo/narray/numo/types/complex_macro.h +205 -0
  92. data/ext/numo/narray/numo/types/dcomplex.h +11 -0
  93. data/ext/numo/narray/numo/types/dfloat.h +12 -0
  94. data/ext/numo/narray/numo/types/float_def.h +34 -0
  95. data/ext/numo/narray/numo/types/float_macro.h +277 -0
  96. data/ext/numo/narray/numo/types/int16.h +12 -0
  97. data/ext/numo/narray/numo/types/int32.h +12 -0
  98. data/ext/numo/narray/numo/types/int64.h +12 -0
  99. data/ext/numo/narray/numo/types/int8.h +12 -0
  100. data/ext/numo/narray/numo/types/int_macro.h +34 -0
  101. data/ext/numo/narray/numo/types/robj_macro.h +218 -0
  102. data/ext/numo/narray/numo/types/robject.h +21 -0
  103. data/ext/numo/narray/numo/types/scomplex.h +11 -0
  104. data/ext/numo/narray/numo/types/sfloat.h +13 -0
  105. data/ext/numo/narray/numo/types/uint16.h +12 -0
  106. data/ext/numo/narray/numo/types/uint32.h +12 -0
  107. data/ext/numo/narray/numo/types/uint64.h +12 -0
  108. data/ext/numo/narray/numo/types/uint8.h +12 -0
  109. data/ext/numo/narray/numo/types/uint_macro.h +31 -0
  110. data/ext/numo/narray/numo/types/xint_macro.h +133 -0
  111. data/ext/numo/narray/rand.c +87 -0
  112. data/ext/numo/narray/step.c +506 -0
  113. data/ext/numo/narray/struct.c +872 -0
  114. data/lib/2.1/numo/narray.so +0 -0
  115. data/lib/2.2/numo/narray.so +0 -0
  116. data/lib/2.3/numo/narray.so +0 -0
  117. data/lib/erbpp/line_number.rb +126 -0
  118. data/lib/erbpp/narray_def.rb +338 -0
  119. data/lib/erbpp.rb +286 -0
  120. data/lib/numo/narray.rb +6 -0
  121. data/numo-narray.gemspec +35 -0
  122. data/spec/bit_spec.rb +93 -0
  123. data/spec/narray_spec.rb +249 -0
  124. metadata +238 -0
@@ -0,0 +1,58 @@
1
+ static void
2
+ <%=c_iter%>(na_loop_t *const lp)
3
+ {
4
+ size_t i;
5
+ char *p1, *p2;
6
+ ssize_t s1, s2;
7
+ size_t *idx1, *idx2;
8
+ dtype x;
9
+
10
+ INIT_COUNTER(lp, i);
11
+ INIT_PTR_IDX(lp, 0, p1, s1, idx1);
12
+ INIT_PTR_IDX(lp, 1, p2, s2, idx2);
13
+
14
+ if (idx1) {
15
+ if (idx2) {
16
+ for (; i--;) {
17
+ GET_DATA_INDEX(p1,idx1,dtype,x);
18
+ x = m_<%=method%>(x);
19
+ SET_DATA_INDEX(p2,idx2,dtype,x);
20
+ }
21
+ } else {
22
+ for (; i--;) {
23
+ GET_DATA_INDEX(p1,idx1,dtype,x);
24
+ x = m_<%=method%>(x);
25
+ SET_DATA_STRIDE(p2,s2,dtype,x);
26
+ }
27
+ }
28
+ } else {
29
+ if (idx2) {
30
+ for (; i--;) {
31
+ GET_DATA_STRIDE(p1,s1,dtype,x);
32
+ x = m_<%=method%>(x);
33
+ SET_DATA_INDEX(p2,idx2,dtype,x);
34
+ }
35
+ } else {
36
+ for (; i--;) {
37
+ GET_DATA_STRIDE(p1,s1,dtype,x);
38
+ x = m_<%=method%>(x);
39
+ SET_DATA_STRIDE(p2,s2,dtype,x);
40
+ }
41
+ }
42
+ }
43
+ }
44
+
45
+ /*
46
+ Unary <%=method%>.
47
+ @overload <%=op_map%>
48
+ @return [Numo::<%=class_name%>] <%=method%> of self.
49
+ */
50
+ static VALUE
51
+ <%=c_func%>(VALUE self)
52
+ {
53
+ ndfunc_arg_in_t ain[1] = {{cT,0}};
54
+ ndfunc_arg_out_t aout[1] = {{cT,0}};
55
+ ndfunc_t ndf = {<%=c_iter%>, FULL_LOOP, 1,1, ain,aout};
56
+
57
+ return na_ndloop(&ndf, 1, self);
58
+ }
@@ -0,0 +1,58 @@
1
+ static void
2
+ <%=c_iter%>(na_loop_t *const lp)
3
+ {
4
+ size_t i;
5
+ char *p1, *p2;
6
+ ssize_t s1, s2;
7
+ size_t *idx1, *idx2;
8
+ dtype x;
9
+ <%=dtype%> y;
10
+ INIT_COUNTER(lp, i);
11
+ INIT_PTR_IDX(lp, 0, p1, s1, idx1);
12
+ INIT_PTR_IDX(lp, 1, p2, s2, idx2);
13
+ if (idx1) {
14
+ if (idx2) {
15
+ for (; i--;) {
16
+ GET_DATA_INDEX(p1,idx1,dtype,x);
17
+ y = m_<%=method%>(x);
18
+ SET_DATA_INDEX(p2,idx2,<%=dtype%>,y);
19
+ }
20
+ } else {
21
+ for (; i--;) {
22
+ GET_DATA_INDEX(p1,idx1,dtype,x);
23
+ y = m_<%=method%>(x);
24
+ SET_DATA_STRIDE(p2,s2,<%=dtype%>,y);
25
+ }
26
+ }
27
+ } else {
28
+ if (idx2) {
29
+ for (; i--;) {
30
+ GET_DATA_STRIDE(p1,s1,dtype,x);
31
+ y = m_<%=method%>(x);
32
+ SET_DATA_INDEX(p2,idx2,<%=dtype%>,y);
33
+ }
34
+ } else {
35
+ for (; i--;) {
36
+ GET_DATA_STRIDE(p1,s1,dtype,x);
37
+ y = m_<%=method%>(x);
38
+ SET_DATA_STRIDE(p2,s2,<%=dtype%>,y);
39
+ }
40
+ }
41
+ }
42
+ }
43
+
44
+
45
+ /*
46
+ <%=method%> of self.
47
+ @overload <%=method%>
48
+ @return [Numo::<%=real_class_name%>] <%=method%> of self.
49
+ */
50
+ static VALUE
51
+ <%=c_func%>(VALUE self)
52
+ {
53
+ ndfunc_arg_in_t ain[1] = {{cT,0}};
54
+ ndfunc_arg_out_t aout[1] = {{<%=tpclass%>,0}};
55
+ ndfunc_t ndf = { <%=c_iter%>, FULL_LOOP, 1, 1, ain, aout };
56
+
57
+ return na_ndloop(&ndf, 1, self);
58
+ }
@@ -0,0 +1,57 @@
1
+ static void
2
+ <%=c_iter%>(na_loop_t *const lp)
3
+ {
4
+ size_t i;
5
+ char *p1, *p2;
6
+ ssize_t s1, s2;
7
+ size_t *idx1, *idx2;
8
+ dtype x;
9
+ INIT_COUNTER(lp, i);
10
+ INIT_PTR_IDX(lp, 0, p1, s1, idx1);
11
+ INIT_PTR_IDX(lp, 1, p2, s2, idx2);
12
+ if (idx1) {
13
+ if (idx2) {
14
+ for (; i--;) {
15
+ GET_DATA_INDEX(p1,idx1,dtype,x);
16
+ x = m_<%=method%>(x);
17
+ SET_DATA_INDEX(p2,idx2,dtype,x);
18
+ }
19
+ } else {
20
+ for (; i--;) {
21
+ GET_DATA_INDEX(p1,idx1,dtype,x);
22
+ x = m_<%=method%>(x);
23
+ SET_DATA_STRIDE(p2,s2,dtype,x);
24
+ }
25
+ }
26
+ } else {
27
+ if (idx2) {
28
+ for (; i--;) {
29
+ GET_DATA_STRIDE(p1,s1,dtype,x);
30
+ x = m_<%=method%>(x);
31
+ SET_DATA_INDEX(p2,idx2,dtype,x);
32
+ }
33
+ } else {
34
+ for (; i--;) {
35
+ GET_DATA_STRIDE(p1,s1,dtype,x);
36
+ x = m_<%=method%>(x);
37
+ SET_DATA_STRIDE(p2,s2,dtype,x);
38
+ }
39
+ }
40
+ }
41
+ }
42
+
43
+ /*
44
+ Calculate <%=method%>(x).
45
+ @overload <%=method%>(x)
46
+ @param [Numo::NArray,Numeric] x input value
47
+ @return [Numo::<%=class_name%>] result of <%=method%>(x).
48
+ */
49
+ static VALUE
50
+ <%=c_func%>(VALUE mod, VALUE a1)
51
+ {
52
+ ndfunc_arg_in_t ain[1] = {{cT,0}};
53
+ ndfunc_arg_out_t aout[1] = {{cT,0}};
54
+ ndfunc_t ndf = { <%=c_iter%>, FULL_LOOP, 1, 1, ain, aout };
55
+
56
+ return na_ndloop(&ndf, 1, a1);
57
+ }