numo-narray-alt 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +14 -0
- data/LICENSE +30 -0
- data/README.md +71 -0
- data/Rakefile +24 -0
- data/ext/numo/narray/SFMT-params.h +97 -0
- data/ext/numo/narray/SFMT-params19937.h +48 -0
- data/ext/numo/narray/SFMT.c +602 -0
- data/ext/numo/narray/SFMT.h +147 -0
- data/ext/numo/narray/array.c +575 -0
- data/ext/numo/narray/data.c +958 -0
- data/ext/numo/narray/extconf.rb +84 -0
- data/ext/numo/narray/index.c +1092 -0
- data/ext/numo/narray/kwargs.c +142 -0
- data/ext/numo/narray/math.c +133 -0
- data/ext/numo/narray/narray.c +1976 -0
- data/ext/numo/narray/narray.def +28 -0
- data/ext/numo/narray/ndloop.c +1840 -0
- data/ext/numo/narray/numo/compat.h +23 -0
- data/ext/numo/narray/numo/intern.h +115 -0
- data/ext/numo/narray/numo/narray.h +480 -0
- data/ext/numo/narray/numo/ndloop.h +93 -0
- data/ext/numo/narray/numo/template.h +149 -0
- data/ext/numo/narray/numo/types/bit.h +38 -0
- data/ext/numo/narray/numo/types/complex.h +404 -0
- data/ext/numo/narray/numo/types/complex_macro.h +384 -0
- data/ext/numo/narray/numo/types/dcomplex.h +42 -0
- data/ext/numo/narray/numo/types/dfloat.h +44 -0
- data/ext/numo/narray/numo/types/float_def.h +34 -0
- data/ext/numo/narray/numo/types/float_macro.h +202 -0
- data/ext/numo/narray/numo/types/int16.h +27 -0
- data/ext/numo/narray/numo/types/int32.h +23 -0
- data/ext/numo/narray/numo/types/int64.h +23 -0
- data/ext/numo/narray/numo/types/int8.h +23 -0
- data/ext/numo/narray/numo/types/int_macro.h +66 -0
- data/ext/numo/narray/numo/types/real_accum.h +481 -0
- data/ext/numo/narray/numo/types/robj_macro.h +78 -0
- data/ext/numo/narray/numo/types/robject.h +25 -0
- data/ext/numo/narray/numo/types/scomplex.h +42 -0
- data/ext/numo/narray/numo/types/sfloat.h +45 -0
- data/ext/numo/narray/numo/types/uint16.h +24 -0
- data/ext/numo/narray/numo/types/uint32.h +20 -0
- data/ext/numo/narray/numo/types/uint64.h +20 -0
- data/ext/numo/narray/numo/types/uint8.h +20 -0
- data/ext/numo/narray/numo/types/uint_macro.h +57 -0
- data/ext/numo/narray/numo/types/xint_macro.h +166 -0
- data/ext/numo/narray/rand.c +40 -0
- data/ext/numo/narray/src/t_bit.c +3236 -0
- data/ext/numo/narray/src/t_dcomplex.c +6776 -0
- data/ext/numo/narray/src/t_dfloat.c +9417 -0
- data/ext/numo/narray/src/t_int16.c +5757 -0
- data/ext/numo/narray/src/t_int32.c +5757 -0
- data/ext/numo/narray/src/t_int64.c +5759 -0
- data/ext/numo/narray/src/t_int8.c +5355 -0
- data/ext/numo/narray/src/t_robject.c +5567 -0
- data/ext/numo/narray/src/t_scomplex.c +6731 -0
- data/ext/numo/narray/src/t_sfloat.c +9374 -0
- data/ext/numo/narray/src/t_uint16.c +5753 -0
- data/ext/numo/narray/src/t_uint32.c +5753 -0
- data/ext/numo/narray/src/t_uint64.c +5755 -0
- data/ext/numo/narray/src/t_uint8.c +5351 -0
- data/ext/numo/narray/step.c +266 -0
- data/ext/numo/narray/struct.c +814 -0
- data/lib/numo/narray/extra.rb +1266 -0
- data/lib/numo/narray.rb +4 -0
- metadata +106 -0
@@ -0,0 +1,84 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rbconfig'
|
4
|
+
require 'mkmf'
|
5
|
+
|
6
|
+
if RUBY_VERSION < '2.1.0'
|
7
|
+
puts 'Numo::NArray requires Ruby version 2.1 or later.'
|
8
|
+
exit(1)
|
9
|
+
end
|
10
|
+
|
11
|
+
def d(file)
|
12
|
+
File.join(__dir__, file)
|
13
|
+
end
|
14
|
+
|
15
|
+
rm_f d('numo/extconf.h')
|
16
|
+
|
17
|
+
$INCFLAGS = "-Itypes #{$INCFLAGS}"
|
18
|
+
$VPATH << '$(srcdir)/src'
|
19
|
+
|
20
|
+
$INSTALLFILES = Dir.glob(%w[numo/*.h numo/types/*.h]).map { |x| [x, '$(archdir)'] }
|
21
|
+
$INSTALLFILES << ['numo/extconf.h', '$(archdir)']
|
22
|
+
if /cygwin|mingw/.match?(RUBY_PLATFORM)
|
23
|
+
$DLDFLAGS << ' -Wl,--export-all,--out-implib=libnarray.a'
|
24
|
+
$INSTALLFILES << ['./libnarray.a', '$(archdir)']
|
25
|
+
end
|
26
|
+
|
27
|
+
srcs = %w[
|
28
|
+
narray
|
29
|
+
array
|
30
|
+
step
|
31
|
+
index
|
32
|
+
ndloop
|
33
|
+
data
|
34
|
+
t_bit
|
35
|
+
t_int8
|
36
|
+
t_int16
|
37
|
+
t_int32
|
38
|
+
t_int64
|
39
|
+
t_uint8
|
40
|
+
t_uint16
|
41
|
+
t_uint32
|
42
|
+
t_uint64
|
43
|
+
t_sfloat
|
44
|
+
t_dfloat
|
45
|
+
t_scomplex
|
46
|
+
t_dcomplex
|
47
|
+
t_robject
|
48
|
+
math
|
49
|
+
SFMT
|
50
|
+
struct
|
51
|
+
rand
|
52
|
+
]
|
53
|
+
|
54
|
+
if RUBY_VERSION[0..3] == '2.1.'
|
55
|
+
puts 'add kwargs'
|
56
|
+
srcs << 'kwargs'
|
57
|
+
end
|
58
|
+
|
59
|
+
stdbool = ('stdbool.h' if have_header('stdbool.h'))
|
60
|
+
|
61
|
+
stdint = if have_header('stdint.h')
|
62
|
+
'stdint.h'
|
63
|
+
elsif have_header('sys/types.h')
|
64
|
+
'sys/types.h'
|
65
|
+
end
|
66
|
+
|
67
|
+
have_type('bool', stdbool)
|
68
|
+
have_type('uint8_t', stdint) unless have_type('u_int8_t', stdint)
|
69
|
+
have_type('uint16_t', stdint) unless have_type('u_int16_t', stdint)
|
70
|
+
have_type('int32_t', stdint)
|
71
|
+
have_type('uint32_t', stdint) unless have_type('u_int32_t', stdint)
|
72
|
+
have_type('int64_t', stdint)
|
73
|
+
have_type('uint64_t', stdint) unless have_type('u_int64_t', stdint)
|
74
|
+
have_func('exp10')
|
75
|
+
have_func('rb_arithmetic_sequence_extract')
|
76
|
+
have_func('RTYPEDDATA_GET_DATA')
|
77
|
+
|
78
|
+
have_var('rb_cComplex')
|
79
|
+
|
80
|
+
$objs = srcs.collect { |i| "#{i}.o" }
|
81
|
+
|
82
|
+
create_header d('numo/extconf.h')
|
83
|
+
|
84
|
+
create_makefile('numo/narray')
|