rmatrix 0.1.19 → 0.1.20
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 +4 -4
- data/lib/rmatrix/indices.rb +4 -4
- data/lib/rmatrix/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 676e1723b0ec4cd51300bb8bfa96f37342dc1a4c
|
4
|
+
data.tar.gz: 131b90477e3719d5f65195de1699f3dc4142b6cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87513c7d13c75f1506910ed50cff4a612d30ab85a230a2028106e205f22a91d4734f1149b8c4e82748325837967be6918ef071e79f88b3153c325759dddd8d90
|
7
|
+
data.tar.gz: fed7922f48d5ea1cbf8a47a0a261f4d7d69ba782f23a96150d48b4def3182798f89b3dbd4cb4416d1447e86573adaa626f42cd03e650200aaab7aea3b2be2b7c
|
data/lib/rmatrix/indices.rb
CHANGED
@@ -61,7 +61,7 @@ module RMatrix
|
|
61
61
|
raw = Struct.new(:narray, :typecode).new(self.narray, self.typecode)
|
62
62
|
def raw.[](*args, column_map: nil, row_map: nil, row_label_map: nil, column_label_map: nil)
|
63
63
|
begin
|
64
|
-
args.all?{|x|
|
64
|
+
args.all?{|x| 1.class === x } ? narray[*args.reverse] : Matrix.new(narray[*args.reverse], typecode, column_map: column_map, row_map: row_map, row_label_map: row_label_map, column_label_map: column_label_map)
|
65
65
|
rescue StandardError => e
|
66
66
|
raise IndexError.new("Error #{e.message} - accessing index at #{args}. Shape is #{narray.shape.reverse}")
|
67
67
|
end
|
@@ -105,7 +105,7 @@ module RMatrix
|
|
105
105
|
(0...size).each do |i|
|
106
106
|
results[i] = i
|
107
107
|
end
|
108
|
-
when
|
108
|
+
when 1.class
|
109
109
|
results[index] ||= total
|
110
110
|
total += 1
|
111
111
|
when Array
|
@@ -132,7 +132,7 @@ module RMatrix
|
|
132
132
|
else
|
133
133
|
row_index = self.row_map ? unmap_index(self.row_map, args[0]) : args[0]
|
134
134
|
column_index = self.column_map ? unmap_index(self.column_map, args[1]) : args[1]
|
135
|
-
column_index = [column_index] if column_index.kind_of?(
|
135
|
+
column_index = [column_index] if column_index.kind_of?(1.class)
|
136
136
|
[
|
137
137
|
row_index,
|
138
138
|
column_index
|
@@ -159,7 +159,7 @@ module RMatrix
|
|
159
159
|
end
|
160
160
|
else
|
161
161
|
index = (map[columns] rescue nil)
|
162
|
-
index = columns if !index && columns.kind_of?(
|
162
|
+
index = columns if !index && columns.kind_of?(1.class)
|
163
163
|
raise "Value not present in index mapping: #{columns}" unless index
|
164
164
|
index
|
165
165
|
end
|
data/lib/rmatrix/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rmatrix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wouter Coppieters
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|