Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions spec/math_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,6 @@

context "determinants" do
ALL_DTYPES.each do |dtype|
next if dtype == :object
context dtype do
before do
@a = NMatrix.new([2,2], [1,2,
Expand All @@ -968,13 +967,19 @@
end
end
it "computes the determinant of 2x2 matrix" do
expect(@a.det).to be_within(@err).of(-2)
if dtype != :object

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like you're not testing #det with Ruby objects anymore.

@isuruf isuruf May 19, 2016

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not testing #det, only #det_exact. Both were disabled in line 949 before

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh! I see now.

expect(@a.det).to be_within(@err).of(-2)
end
end
it "computes the determinant of 3x3 matrix" do
expect(@b.det).to be_within(@err).of(-8)
if dtype != :object
expect(@b.det).to be_within(@err).of(-8)
end
end
it "computes the determinant of 4x4 matrix" do
expect(@c.det).to be_within(@err).of(-18)
if dtype != :object
expect(@c.det).to be_within(@err).of(-18)
end
end
it "computes the exact determinant of 2x2 matrix" do
if dtype == :byte
Expand Down