зеркало из https://github.com/github/ruby.git
Fix matrix spec for 7d360efe92
This commit is contained in:
Родитель
5c8bfad078
Коммит
76507bfc3d
|
@ -5,10 +5,15 @@ describe "Matrix.unitary?" do
|
||||||
it "returns false for non unitary matrices" do
|
it "returns false for non unitary matrices" do
|
||||||
Matrix[[0, 1], [1, 2]].unitary?.should == false
|
Matrix[[0, 1], [1, 2]].unitary?.should == false
|
||||||
Matrix[[0, Complex(0, 2)], [Complex(0, 2), 0]].unitary?.should == false
|
Matrix[[0, Complex(0, 2)], [Complex(0, 2), 0]].unitary?.should == false
|
||||||
Matrix[[0, Complex(0, 1)], [Complex(0, -1), 0]].unitary?.should == false
|
|
||||||
Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].unitary?.should == false
|
Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].unitary?.should == false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
ruby_version_is '2.8' do # matrix v0.3.0
|
||||||
|
it "returns false for non unitary matrix" do
|
||||||
|
Matrix[[0, Complex(0, 1)], [Complex(0, -1), 0]].unitary?.should == true
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it "returns true for unitary matrices" do
|
it "returns true for unitary matrices" do
|
||||||
Matrix[[0, Complex(0, 1)], [Complex(0, 1), 0]].unitary?.should == true
|
Matrix[[0, Complex(0, 1)], [Complex(0, 1), 0]].unitary?.should == true
|
||||||
end
|
end
|
||||||
|
|
Загрузка…
Ссылка в новой задаче