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.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/README.md +47 -0
- data/Rakefile +41 -0
- data/ext/numo/narray/SFMT-params.h +97 -0
- data/ext/numo/narray/SFMT-params19937.h +46 -0
- data/ext/numo/narray/SFMT.c +620 -0
- data/ext/numo/narray/SFMT.h +157 -0
- data/ext/numo/narray/array.c +525 -0
- data/ext/numo/narray/data.c +901 -0
- data/ext/numo/narray/depend.erb +33 -0
- data/ext/numo/narray/extconf.rb +117 -0
- data/ext/numo/narray/gen/bit.erb.c +811 -0
- data/ext/numo/narray/gen/cogen.rb +18 -0
- data/ext/numo/narray/gen/def/dcomplex.rb +32 -0
- data/ext/numo/narray/gen/def/dfloat.rb +30 -0
- data/ext/numo/narray/gen/def/int16.rb +29 -0
- data/ext/numo/narray/gen/def/int32.rb +29 -0
- data/ext/numo/narray/gen/def/int64.rb +29 -0
- data/ext/numo/narray/gen/def/int8.rb +29 -0
- data/ext/numo/narray/gen/def/robject.rb +30 -0
- data/ext/numo/narray/gen/def/scomplex.rb +32 -0
- data/ext/numo/narray/gen/def/sfloat.rb +30 -0
- data/ext/numo/narray/gen/def/uint16.rb +29 -0
- data/ext/numo/narray/gen/def/uint32.rb +29 -0
- data/ext/numo/narray/gen/def/uint64.rb +29 -0
- data/ext/numo/narray/gen/def/uint8.rb +29 -0
- data/ext/numo/narray/gen/dtype.erb.c +328 -0
- data/ext/numo/narray/gen/tmpl/accum.c +36 -0
- data/ext/numo/narray/gen/tmpl/accum_binary.c +75 -0
- data/ext/numo/narray/gen/tmpl/accum_index.c +58 -0
- data/ext/numo/narray/gen/tmpl/allocate.c +35 -0
- data/ext/numo/narray/gen/tmpl/aref.c +51 -0
- data/ext/numo/narray/gen/tmpl/aset.c +61 -0
- data/ext/numo/narray/gen/tmpl/binary.c +53 -0
- data/ext/numo/narray/gen/tmpl/binary2.c +55 -0
- data/ext/numo/narray/gen/tmpl/binary_s.c +34 -0
- data/ext/numo/narray/gen/tmpl/bit_binary.c +94 -0
- data/ext/numo/narray/gen/tmpl/bit_count.c +82 -0
- data/ext/numo/narray/gen/tmpl/bit_unary.c +77 -0
- data/ext/numo/narray/gen/tmpl/cast.c +37 -0
- data/ext/numo/narray/gen/tmpl/cast_array.c +79 -0
- data/ext/numo/narray/gen/tmpl/cast_numeric.c +22 -0
- data/ext/numo/narray/gen/tmpl/coerce_cast.c +8 -0
- data/ext/numo/narray/gen/tmpl/cond_binary.c +51 -0
- data/ext/numo/narray/gen/tmpl/cond_unary.c +45 -0
- data/ext/numo/narray/gen/tmpl/cum.c +42 -0
- data/ext/numo/narray/gen/tmpl/each.c +43 -0
- data/ext/numo/narray/gen/tmpl/each_with_index.c +64 -0
- data/ext/numo/narray/gen/tmpl/extract.c +23 -0
- data/ext/numo/narray/gen/tmpl/eye.c +91 -0
- data/ext/numo/narray/gen/tmpl/fill.c +38 -0
- data/ext/numo/narray/gen/tmpl/format.c +60 -0
- data/ext/numo/narray/gen/tmpl/format_to_a.c +47 -0
- data/ext/numo/narray/gen/tmpl/head.c +25 -0
- data/ext/numo/narray/gen/tmpl/inspect.c +16 -0
- data/ext/numo/narray/gen/tmpl/map_with_index.c +94 -0
- data/ext/numo/narray/gen/tmpl/median.c +44 -0
- data/ext/numo/narray/gen/tmpl/minmax.c +47 -0
- data/ext/numo/narray/gen/tmpl/poly.c +49 -0
- data/ext/numo/narray/gen/tmpl/pow.c +74 -0
- data/ext/numo/narray/gen/tmpl/powint.c +17 -0
- data/ext/numo/narray/gen/tmpl/qsort.c +149 -0
- data/ext/numo/narray/gen/tmpl/rand.c +33 -0
- data/ext/numo/narray/gen/tmpl/rand_norm.c +46 -0
- data/ext/numo/narray/gen/tmpl/robj_allocate.c +32 -0
- data/ext/numo/narray/gen/tmpl/seq.c +61 -0
- data/ext/numo/narray/gen/tmpl/set2.c +56 -0
- data/ext/numo/narray/gen/tmpl/sort.c +36 -0
- data/ext/numo/narray/gen/tmpl/sort_index.c +86 -0
- data/ext/numo/narray/gen/tmpl/store.c +31 -0
- data/ext/numo/narray/gen/tmpl/store_array.c +5 -0
- data/ext/numo/narray/gen/tmpl/store_from.c +53 -0
- data/ext/numo/narray/gen/tmpl/store_numeric.c +22 -0
- data/ext/numo/narray/gen/tmpl/to_a.c +41 -0
- data/ext/numo/narray/gen/tmpl/unary.c +58 -0
- data/ext/numo/narray/gen/tmpl/unary2.c +58 -0
- data/ext/numo/narray/gen/tmpl/unary_s.c +57 -0
- data/ext/numo/narray/index.c +822 -0
- data/ext/numo/narray/kwarg.c +79 -0
- data/ext/numo/narray/math.c +140 -0
- data/ext/numo/narray/narray.c +1539 -0
- data/ext/numo/narray/ndloop.c +1928 -0
- data/ext/numo/narray/numo/compat.h +23 -0
- data/ext/numo/narray/numo/intern.h +112 -0
- data/ext/numo/narray/numo/narray.h +411 -0
- data/ext/numo/narray/numo/ndloop.h +99 -0
- data/ext/numo/narray/numo/template.h +140 -0
- data/ext/numo/narray/numo/types/bit.h +19 -0
- data/ext/numo/narray/numo/types/complex.h +410 -0
- data/ext/numo/narray/numo/types/complex_macro.h +205 -0
- data/ext/numo/narray/numo/types/dcomplex.h +11 -0
- data/ext/numo/narray/numo/types/dfloat.h +12 -0
- data/ext/numo/narray/numo/types/float_def.h +34 -0
- data/ext/numo/narray/numo/types/float_macro.h +277 -0
- data/ext/numo/narray/numo/types/int16.h +12 -0
- data/ext/numo/narray/numo/types/int32.h +12 -0
- data/ext/numo/narray/numo/types/int64.h +12 -0
- data/ext/numo/narray/numo/types/int8.h +12 -0
- data/ext/numo/narray/numo/types/int_macro.h +34 -0
- data/ext/numo/narray/numo/types/robj_macro.h +218 -0
- data/ext/numo/narray/numo/types/robject.h +21 -0
- data/ext/numo/narray/numo/types/scomplex.h +11 -0
- data/ext/numo/narray/numo/types/sfloat.h +13 -0
- data/ext/numo/narray/numo/types/uint16.h +12 -0
- data/ext/numo/narray/numo/types/uint32.h +12 -0
- data/ext/numo/narray/numo/types/uint64.h +12 -0
- data/ext/numo/narray/numo/types/uint8.h +12 -0
- data/ext/numo/narray/numo/types/uint_macro.h +31 -0
- data/ext/numo/narray/numo/types/xint_macro.h +133 -0
- data/ext/numo/narray/rand.c +87 -0
- data/ext/numo/narray/step.c +506 -0
- data/ext/numo/narray/struct.c +872 -0
- data/lib/2.1/numo/narray.so +0 -0
- data/lib/2.2/numo/narray.so +0 -0
- data/lib/2.3/numo/narray.so +0 -0
- data/lib/erbpp/line_number.rb +126 -0
- data/lib/erbpp/narray_def.rb +338 -0
- data/lib/erbpp.rb +286 -0
- data/lib/numo/narray.rb +6 -0
- data/numo-narray.gemspec +35 -0
- data/spec/bit_spec.rb +93 -0
- data/spec/narray_spec.rb +249 -0
- metadata +238 -0
@@ -0,0 +1,33 @@
|
|
1
|
+
TAGSRC = \
|
2
|
+
../../ruby/include/ruby/*.h \
|
3
|
+
../../ruby/*.c \
|
4
|
+
*.h \
|
5
|
+
types/*.h \
|
6
|
+
*.c \
|
7
|
+
types/*.c
|
8
|
+
|
9
|
+
tags : TAGS
|
10
|
+
TAGS : $(TAGSRC)
|
11
|
+
etags $(TAGSRC)
|
12
|
+
|
13
|
+
doc :
|
14
|
+
yard doc *.c types/*.c
|
15
|
+
|
16
|
+
C_TMPL = <%=Dir.glob("#{__dir__}/gen/tmpl/*.c").join(" ")%>
|
17
|
+
|
18
|
+
COGEN = <%= __dir__ %>/gen/cogen.rb
|
19
|
+
DTYPE = <%= __dir__ %>/gen/dtype.erb.c
|
20
|
+
COGEN_DTYPE = $(COGEN) -l $(DTYPE)
|
21
|
+
DEPENDS = $(C_TMPL) $(DTYPE) <%= __dir__ %>/gen/*.rb
|
22
|
+
|
23
|
+
<% Dir.glob("#{__dir__}/gen/def/*.rb") do |s| %>
|
24
|
+
types/<%=File.basename(s,".rb")%>.c: <%=s%> $(DEPENDS)
|
25
|
+
$(MAKEDIRS) $(@D) types
|
26
|
+
ruby $(COGEN_DTYPE) <%=s%> > $@
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
types/bit.c: <%= __dir__ %>/gen/bit.erb.c $(DEPENDS)
|
30
|
+
$(MAKEDIRS) $(@D) types
|
31
|
+
ruby $(COGEN) -l <%= __dir__ %>/gen/bit.erb.c > $@
|
32
|
+
|
33
|
+
CLEANOBJS = *.o */*.o *.bak types/*.c
|
@@ -0,0 +1,117 @@
|
|
1
|
+
require 'rbconfig.rb'
|
2
|
+
|
3
|
+
#RbConfig::MAKEFILE_CONFIG["optflags"] = "-g3 -gdwarf-2"
|
4
|
+
|
5
|
+
require 'mkmf'
|
6
|
+
|
7
|
+
require "erb"
|
8
|
+
|
9
|
+
if RUBY_VERSION < "2.0.0"
|
10
|
+
puts "Numo::NArray requires Ruby version 2.0 or later."
|
11
|
+
exit(1)
|
12
|
+
end
|
13
|
+
|
14
|
+
#$CFLAGS="-g3 -O0 -Wall"
|
15
|
+
#$CFLAGS=" $(cflags) -O3 -m64 -msse2 -funroll-loops"
|
16
|
+
#$CFLAGS=" $(cflags) -O3"
|
17
|
+
$INCFLAGS = "-Itypes #$INCFLAGS"
|
18
|
+
|
19
|
+
$INSTALLFILES = Dir.glob(%w[numo/*.h numo/types/*.h]).map{|x| [x,'$(archdir)'] }
|
20
|
+
if /cygwin|mingw/ =~ RUBY_PLATFORM
|
21
|
+
$INSTALLFILES << ['libnarray.a', '$(archdir)']
|
22
|
+
end
|
23
|
+
|
24
|
+
srcs = %w(
|
25
|
+
narray
|
26
|
+
array
|
27
|
+
step
|
28
|
+
index
|
29
|
+
ndloop
|
30
|
+
data
|
31
|
+
types/bit
|
32
|
+
types/int8
|
33
|
+
types/int16
|
34
|
+
types/int32
|
35
|
+
types/int64
|
36
|
+
types/uint8
|
37
|
+
types/uint16
|
38
|
+
types/uint32
|
39
|
+
types/uint64
|
40
|
+
types/sfloat
|
41
|
+
types/dfloat
|
42
|
+
types/scomplex
|
43
|
+
types/dcomplex
|
44
|
+
types/robject
|
45
|
+
math
|
46
|
+
SFMT
|
47
|
+
struct
|
48
|
+
rand
|
49
|
+
)
|
50
|
+
|
51
|
+
=begin
|
52
|
+
have_header("atlas/cblas.h")
|
53
|
+
have_library("atlas")
|
54
|
+
|
55
|
+
if have_library("blas")
|
56
|
+
if have_library("lapack")
|
57
|
+
srcs.push "linalg"
|
58
|
+
$defs.push "-DHAVE_LAPACK"
|
59
|
+
else
|
60
|
+
#$defs.delete "-DHAVE_LAPACK"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
=end
|
64
|
+
|
65
|
+
if have_header("stdbool.h")
|
66
|
+
stdbool = "stdbool.h"
|
67
|
+
else
|
68
|
+
stdbool = nil
|
69
|
+
end
|
70
|
+
|
71
|
+
if have_header("stdint.h")
|
72
|
+
stdint = "stdint.h"
|
73
|
+
elsif have_header("sys/types.h")
|
74
|
+
stdint = "sys/types.h"
|
75
|
+
else
|
76
|
+
stdint = nil
|
77
|
+
end
|
78
|
+
|
79
|
+
have_type("bool", stdbool)
|
80
|
+
unless have_type("u_int8_t", stdint)
|
81
|
+
have_type("uint8_t",stdint)
|
82
|
+
end
|
83
|
+
unless have_type("u_int16_t", stdint)
|
84
|
+
have_type("uint16_t",stdint)
|
85
|
+
end
|
86
|
+
have_type("int32_t", stdint)
|
87
|
+
unless have_type("u_int32_t", stdint)
|
88
|
+
have_type("uint32_t",stdint)
|
89
|
+
end
|
90
|
+
have_type("int64_t", stdint)
|
91
|
+
unless have_type("u_int64_t", stdint)
|
92
|
+
have_type("uint64_t", stdint)
|
93
|
+
end
|
94
|
+
#have_library("m")
|
95
|
+
#have_func("sincos")
|
96
|
+
#have_func("asinh")
|
97
|
+
have_func("exp10")
|
98
|
+
|
99
|
+
have_var("rb_cComplex")
|
100
|
+
#have_func("rb_alloc_tmp_buffer", "ruby.h")
|
101
|
+
#have_func("rb_free_tmp_buffer", "ruby.h")
|
102
|
+
|
103
|
+
$objs = srcs.collect{|i| i+".o"}
|
104
|
+
|
105
|
+
create_header
|
106
|
+
|
107
|
+
depend_path = File.join(__dir__, "depend")
|
108
|
+
File.open(depend_path, "w") do |depend|
|
109
|
+
depend_erb_path = File.join(__dir__, "depend.erb")
|
110
|
+
File.open(depend_erb_path, "r") do |depend_erb|
|
111
|
+
erb = ERB.new(depend_erb.read)
|
112
|
+
erb.filename = depend_erb_path
|
113
|
+
depend.print(erb.result)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
create_makefile('numo/narray')
|