numo-narray 0.9.0.3 → 0.9.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -6
- data/Rakefile +2 -10
- data/ext/numo/narray/array.c +1 -6
- data/ext/numo/narray/data.c +3 -9
- data/ext/numo/narray/depend.erb +1 -1
- data/ext/numo/narray/extconf.rb +0 -1
- data/ext/numo/narray/gen/def/bit.rb +2 -0
- data/ext/numo/narray/gen/def/dcomplex.rb +2 -0
- data/ext/numo/narray/gen/def/dfloat.rb +2 -0
- data/ext/numo/narray/gen/def/int16.rb +2 -0
- data/ext/numo/narray/gen/def/int32.rb +2 -0
- data/ext/numo/narray/gen/def/int64.rb +2 -0
- data/ext/numo/narray/gen/def/int8.rb +2 -0
- data/ext/numo/narray/gen/def/robject.rb +2 -0
- data/ext/numo/narray/gen/def/scomplex.rb +2 -0
- data/ext/numo/narray/gen/def/sfloat.rb +2 -0
- data/ext/numo/narray/gen/def/uint16.rb +2 -0
- data/ext/numo/narray/gen/def/uint32.rb +2 -0
- data/ext/numo/narray/gen/def/uint64.rb +2 -0
- data/ext/numo/narray/gen/def/uint8.rb +2 -0
- data/ext/numo/narray/gen/dtype.erb.c +7 -7
- data/ext/numo/narray/gen/spec.rb +24 -2
- data/ext/numo/narray/gen/tmpl/accum_binary.c +6 -0
- data/ext/numo/narray/gen/tmpl/aref.c +6 -4
- data/ext/numo/narray/gen/tmpl/aset.c +6 -4
- data/ext/numo/narray/gen/tmpl/binary.c +4 -0
- data/ext/numo/narray/gen/tmpl/binary2.c +4 -0
- data/ext/numo/narray/gen/tmpl/bincount.c +180 -0
- data/ext/numo/narray/gen/tmpl/cast.c +4 -0
- data/ext/numo/narray/gen/tmpl/cast_array.c +3 -64
- data/ext/numo/narray/gen/tmpl/cond_binary.c +4 -0
- data/ext/numo/narray/gen/tmpl/inspect.c +4 -0
- data/ext/numo/narray/gen/tmpl/pow.c +4 -0
- data/ext/numo/narray/gen/tmpl/qsort.c +1 -7
- data/ext/numo/narray/gen/tmpl/rand.c +13 -2
- data/ext/numo/narray/gen/tmpl/rand_norm.c +89 -16
- data/ext/numo/narray/gen/tmpl/store.c +4 -0
- data/ext/numo/narray/gen/tmpl/store_array.c +99 -2
- data/ext/numo/narray/gen/tmpl_bit/allocate.c +1 -1
- data/ext/numo/narray/gen/tmpl_bit/aref.c +6 -4
- data/ext/numo/narray/gen/tmpl_bit/aset.c +6 -4
- data/ext/numo/narray/gen/tmpl_bit/cast_array.c +3 -65
- data/ext/numo/narray/gen/tmpl_bit/mask.c +16 -1
- data/ext/numo/narray/gen/tmpl_bit/store_array.c +101 -2
- data/ext/numo/narray/gen/tmpl_bit/where.c +7 -23
- data/ext/numo/narray/gen/tmpl_bit/where2.c +58 -4
- data/ext/numo/narray/index.c +168 -166
- data/ext/numo/narray/kwarg.c +1 -6
- data/ext/numo/narray/math.c +8 -12
- data/ext/numo/narray/narray.c +231 -71
- data/ext/numo/narray/ndloop.c +86 -26
- data/ext/numo/narray/numo/intern.h +6 -10
- data/ext/numo/narray/numo/narray.h +83 -54
- data/ext/numo/narray/numo/ndloop.h +0 -5
- data/ext/numo/narray/numo/template.h +0 -5
- data/ext/numo/narray/numo/types/complex.h +1 -6
- data/ext/numo/narray/numo/types/complex_macro.h +30 -3
- data/ext/numo/narray/numo/types/dcomplex.h +18 -0
- data/ext/numo/narray/numo/types/dfloat.h +18 -0
- data/ext/numo/narray/numo/types/float_macro.h +25 -2
- data/ext/numo/narray/numo/types/robj_macro.h +2 -4
- data/ext/numo/narray/numo/types/scomplex.h +18 -0
- data/ext/numo/narray/numo/types/sfloat.h +18 -0
- data/ext/numo/narray/rand.c +0 -15
- data/ext/numo/narray/step.c +0 -5
- data/ext/numo/narray/struct.c +7 -12
- data/lib/erbpp/line_number.rb +4 -4
- data/lib/erbpp/narray_def.rb +16 -7
- data/lib/numo/narray.rb +2 -0
- data/lib/numo/narray/extra.rb +465 -0
- data/numo-narray.gemspec +2 -2
- data/spec/narray_spec.rb +4 -3
- metadata +13 -7
- data/ext/numo/narray/gen/tmpl/head.c +0 -25
data/numo-narray.gemspec
CHANGED
@@ -30,6 +30,6 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.add_development_dependency "bundler", "~> 1.3"
|
31
31
|
spec.add_development_dependency "rake", "~> 0"
|
32
32
|
spec.add_development_dependency "rspec", "~> 3"
|
33
|
-
spec.add_development_dependency
|
34
|
-
spec.add_development_dependency "rake-compiler-dock"
|
33
|
+
spec.add_development_dependency 'rake-compiler', "~> 1.0", ">= 1.0.1"
|
34
|
+
spec.add_development_dependency "rake-compiler-dock", "~> 0"
|
35
35
|
end
|
data/spec/narray_spec.rb
CHANGED
@@ -205,7 +205,7 @@ types.each do |dtype|
|
|
205
205
|
end
|
206
206
|
|
207
207
|
it{expect(@a[0, 1, 1]).to eq 4}
|
208
|
-
|
208
|
+
it{expect(@a[:rest]).to eq @a}
|
209
209
|
it{expect(@a[0, :rest]).to eq [[1,2],[3,4]]}
|
210
210
|
it{expect(@a[0, false]).to eq [[1,2],[3,4]]}
|
211
211
|
it{expect(@a[0, 1, :rest]).to eq [3,4]}
|
@@ -213,9 +213,10 @@ types.each do |dtype|
|
|
213
213
|
it{expect(@a[:rest, 0]).to eq [[1,3],[5,7]]}
|
214
214
|
it{expect(@a[:rest, 0, 1]).to eq [2,6]}
|
215
215
|
it{expect(@a[1, :rest, 0]).to eq [5,7]}
|
216
|
-
it{expect
|
216
|
+
it{expect(@a[1, 1, :rest, 0]).to eq 7}
|
217
217
|
it{expect{@a[1, 1, 1, 1, :rest]}.to raise_error IndexError}
|
218
218
|
it{expect{@a[1, 1, 1, :rest, 1]}.to raise_error IndexError}
|
219
|
+
it{expect{@a[:rest, 1, :rest, 0]}.to raise_error IndexError}
|
219
220
|
end
|
220
221
|
|
221
222
|
describe dtype, "#dot" do
|
@@ -243,7 +244,7 @@ types.each do |dtype|
|
|
243
244
|
it "matrix.dot(matrix) with incorrect shape" do
|
244
245
|
a = dtype[1..6].reshape(3,2)
|
245
246
|
b = dtype[1..9].reshape(3,3)
|
246
|
-
expect{a.dot(b)}.to raise_error(
|
247
|
+
expect{a.dot(b)}.to raise_error(Numo::NArray::ShapeError)
|
247
248
|
end
|
248
249
|
end
|
249
250
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: numo-narray
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.0.
|
4
|
+
version: 0.9.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro TANAKA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -56,6 +56,9 @@ dependencies:
|
|
56
56
|
name: rake-compiler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.0'
|
59
62
|
- - ">="
|
60
63
|
- !ruby/object:Gem::Version
|
61
64
|
version: 1.0.1
|
@@ -63,6 +66,9 @@ dependencies:
|
|
63
66
|
prerelease: false
|
64
67
|
version_requirements: !ruby/object:Gem::Requirement
|
65
68
|
requirements:
|
69
|
+
- - "~>"
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '1.0'
|
66
72
|
- - ">="
|
67
73
|
- !ruby/object:Gem::Version
|
68
74
|
version: 1.0.1
|
@@ -70,14 +76,14 @@ dependencies:
|
|
70
76
|
name: rake-compiler-dock
|
71
77
|
requirement: !ruby/object:Gem::Requirement
|
72
78
|
requirements:
|
73
|
-
- - "
|
79
|
+
- - "~>"
|
74
80
|
- !ruby/object:Gem::Version
|
75
81
|
version: '0'
|
76
82
|
type: :development
|
77
83
|
prerelease: false
|
78
84
|
version_requirements: !ruby/object:Gem::Requirement
|
79
85
|
requirements:
|
80
|
-
- - "
|
86
|
+
- - "~>"
|
81
87
|
- !ruby/object:Gem::Version
|
82
88
|
version: '0'
|
83
89
|
description: Numo::NArray - New NArray class library in Ruby/Numo.
|
@@ -125,6 +131,7 @@ files:
|
|
125
131
|
- ext/numo/narray/gen/tmpl/binary.c
|
126
132
|
- ext/numo/narray/gen/tmpl/binary2.c
|
127
133
|
- ext/numo/narray/gen/tmpl/binary_s.c
|
134
|
+
- ext/numo/narray/gen/tmpl/bincount.c
|
128
135
|
- ext/numo/narray/gen/tmpl/cast.c
|
129
136
|
- ext/numo/narray/gen/tmpl/cast_array.c
|
130
137
|
- ext/numo/narray/gen/tmpl/cast_numeric.c
|
@@ -139,7 +146,6 @@ files:
|
|
139
146
|
- ext/numo/narray/gen/tmpl/fill.c
|
140
147
|
- ext/numo/narray/gen/tmpl/format.c
|
141
148
|
- ext/numo/narray/gen/tmpl/format_to_a.c
|
142
|
-
- ext/numo/narray/gen/tmpl/head.c
|
143
149
|
- ext/numo/narray/gen/tmpl/inspect.c
|
144
150
|
- ext/numo/narray/gen/tmpl/logseq.c
|
145
151
|
- ext/numo/narray/gen/tmpl/map_with_index.c
|
@@ -233,6 +239,7 @@ files:
|
|
233
239
|
- lib/erbpp/line_number.rb
|
234
240
|
- lib/erbpp/narray_def.rb
|
235
241
|
- lib/numo/narray.rb
|
242
|
+
- lib/numo/narray/extra.rb
|
236
243
|
- numo-narray.gemspec
|
237
244
|
- spec/bit_spec.rb
|
238
245
|
- spec/narray_spec.rb
|
@@ -256,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
263
|
version: '0'
|
257
264
|
requirements: []
|
258
265
|
rubyforge_project:
|
259
|
-
rubygems_version: 2.
|
266
|
+
rubygems_version: 2.6.8
|
260
267
|
signing_key:
|
261
268
|
specification_version: 4
|
262
269
|
summary: alpha release of Numo::NArray - New NArray class library in Ruby/Numo (NUmerical
|
@@ -264,4 +271,3 @@ summary: alpha release of Numo::NArray - New NArray class library in Ruby/Numo (
|
|
264
271
|
test_files:
|
265
272
|
- spec/bit_spec.rb
|
266
273
|
- spec/narray_spec.rb
|
267
|
-
has_rdoc:
|
@@ -1,25 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
<%=type_name%>.c
|
3
|
-
Numerical Array Extension for Ruby
|
4
|
-
(C) Copyright 1999-2011,2013 by Masahiro TANAKA
|
5
|
-
|
6
|
-
This program is free software.
|
7
|
-
You can distribute/modify this program
|
8
|
-
under the same terms as Ruby itself.
|
9
|
-
NO WARRANTY.
|
10
|
-
*/
|
11
|
-
|
12
|
-
#include <ruby.h>
|
13
|
-
#include <math.h>
|
14
|
-
#include "narray.h"
|
15
|
-
#include "SFMT.h"
|
16
|
-
#include "template.h"
|
17
|
-
#include "<%=type_name%>.h"
|
18
|
-
|
19
|
-
//#define cT <%=type_var%>
|
20
|
-
VALUE cT;
|
21
|
-
//#define cRT <%=real_type_var%>
|
22
|
-
|
23
|
-
#ifdef mTM
|
24
|
-
VALUE mTM;
|
25
|
-
#endif
|