spec/01_enum_spec.rb in nmatrix-0.2.3 vs spec/01_enum_spec.rb in nmatrix-0.2.4
- old
+ new
@@ -33,10 +33,11 @@
let(:n) { create_rectangular_matrix(stype) }
let(:m) { n[1..4,1..3] }
if stype == :yale
it "should iterate properly along each row of a slice" do
+ pending("not yet implemented for sparse matrices for NMatrix-JRuby") if jruby?
vv = []
ii = []
jj = []
m.extend NMatrix::YaleFunctions
m.each_row do |row|
@@ -51,10 +52,11 @@
expect(ii).to eq([0]*12)
expect(jj).to eq([0,1,2]*4)
end
it "should iterate along diagonal portion of A array" do
+ pending("not yet implemented for sparse matrices for NMatrix-JRuby") if jruby?
vv = []
ii = []
jj = []
n.send :__yale_stored_diagonal_each_with_indices__ do |v,i,j|
vv << v
@@ -65,10 +67,11 @@
expect(ii).to eq([0,1,2,3,4])
expect(jj).to eq(ii)
end
it "should iterate along non-diagonal portion of A array" do
+ pending("not yet implemented for sparse matrices for NMatrix-JRuby") if jruby?
vv = []
ii = []
jj = []
n.send :__yale_stored_nondiagonal_each_with_indices__ do |v,i,j|
vv << v
@@ -80,10 +83,11 @@
expect(ii).to eq([[0]*4, [1]*4, [2]*4, [4]*4].flatten)
expect(jj).to eq([1,2,3,4, 0,2,3,5, 0,1,4,5, 0,2,3,5])
end
it "should iterate along a sliced diagonal portion of an A array" do
+ pending("not yet implemented for sparse matrices for NMatrix-JRuby") if jruby?
m = n[0..3,1..3]
vv = []
ii = []
jj = []
m.send :__yale_stored_diagonal_each_with_indices__ do |v,i,j|
@@ -95,10 +99,11 @@
expect(ii).to eq([1,2,3])
expect(jj).to eq([0,1,2])
end
it "should iterate along a sliced non-diagonal portion of a sliced A array" do
+ pending("not yet implemented for sparse matrices for NMatrix-JRuby") if jruby?
vv = []
ii = []
jj = []
n.extend NMatrix::YaleFunctions
m.extend NMatrix::YaleFunctions
@@ -112,10 +117,11 @@
expect(jj).to eq([1,2, 0, 1,2 ])
expect(vv).to eq([8,9, 12, 17,18])
end
it "should visit each stored element of the matrix in order by indices" do
+ pending("not yet implemented for sparse matrices for NMatrix-JRuby") if jruby?
vv = []
ii = []
jj = []
n.each_ordered_stored_with_indices do |v,i,j|
vv << v
@@ -127,10 +133,10 @@
expect(ii).to eq([[0]*5, [1]*5, [2]*5, [3]*1, [4]*5].flatten)
expect(jj).to eq([0,1,2,3,4, 0,1,2,3,5, 0,1,2,4,5, 3, 0,2,3,4,5])
end
it "should visit each stored element of the slice in order by indices" do
-
+ pending("not yet implemented for sparse matrices for NMatrix-JRuby") if jruby?
vv = []
ii = []
jj = []
m.each_ordered_stored_with_indices do |v,i,j|
vv << v