nmatrix-rowcol 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nmatrix/rowcol.rb +7 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f172ae0882404e527ea835e0f7597f4f44924a76
|
4
|
+
data.tar.gz: 7231558da0a313c1bad3c9fecb542ef3af9749ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 799d81b7e2a82ad99c4b5be3d4462519d003ff0662c268b8dbd0698c35ee2de7e365669513df18ac834c6960a2edaaefb4759d8c62b99c9a9eb52c96829df70d
|
7
|
+
data.tar.gz: 680166c2e3ea365bbae02d7a8b54f7adbf9c5174d0db0e036745d94650713d71406c420b11be9dfc6d6622ad6e18b4a6c499630dfca53c2b1c2a430c6b8eabac
|
data/lib/nmatrix/rowcol.rb
CHANGED
@@ -6,10 +6,14 @@ class NMatrix
|
|
6
6
|
|
7
7
|
def row(row_number, get_by = :copy)
|
8
8
|
if row_numbers = get_row_or_col_index_array(row_number)
|
9
|
-
out = NMatrix.new [row_numbers.length, cols], default_value, dtype: dtype, stype: stype
|
9
|
+
out = NMatrix.new [row_numbers.length, cols].compact, default_value, dtype: dtype, stype: stype
|
10
10
|
|
11
11
|
row_numbers.each_with_index do |rownum, i|
|
12
|
-
|
12
|
+
if dim > 1
|
13
|
+
out[i, 0..-1] = self[rownum, 0..-1]
|
14
|
+
else
|
15
|
+
out[i] = self[rownum]
|
16
|
+
end
|
13
17
|
end
|
14
18
|
|
15
19
|
out
|
@@ -21,7 +25,7 @@ class NMatrix
|
|
21
25
|
alias_method :internal_column, :column
|
22
26
|
|
23
27
|
def column(col_number, get_by = :copy)
|
24
|
-
if col_numbers = get_row_or_col_index_array(col_number)
|
28
|
+
if dim > 1 && col_numbers = get_row_or_col_index_array(col_number)
|
25
29
|
out = NMatrix.new [rows, col_numbers.length], default_value, dtype: dtype, stype: stype
|
26
30
|
|
27
31
|
col_numbers.each_with_index do |colnum, i|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nmatrix-rowcol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Geoff Buesing
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nmatrix
|
@@ -55,6 +55,6 @@ rubyforge_project:
|
|
55
55
|
rubygems_version: 2.4.5
|
56
56
|
signing_key:
|
57
57
|
specification_version: 4
|
58
|
-
summary: Arbitrary row/
|
58
|
+
summary: Arbitrary row/column selection for NMatrix
|
59
59
|
test_files: []
|
60
60
|
has_rdoc:
|