From 8e6312e4337f4eda624b7e40885f79f4dfdeafbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20G=C3=B6ttgens?= Date: Mon, 7 Oct 2024 16:30:25 +0200 Subject: [PATCH] Add test --- test/Matrix-test.jl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/Matrix-test.jl b/test/Matrix-test.jl index dd206c6118..e9d24f536b 100644 --- a/test/Matrix-test.jl +++ b/test/Matrix-test.jl @@ -112,6 +112,26 @@ end @test T == matrix(QQ, [42 0 0; 0 42 0; 0 0 42]) end +@testset "Matrix.conversion" begin + U, t = polynomial_ring(QQ, "t") + + R = matrix_ring(U, 2) + S = matrix_space(U, 2, 2) + a = U.([1 2; t^2 (t-1)]) # Matrix + Ra = R(a) # MatRingElem + Sa = S(a) # MatElem + @test Ra == R(Ra) + @test Ra == R(Sa) + @test Sa == S(Sa) + @test Sa == S(Ra) + @test matrix(Ra) == Sa + @test matrix(U, Ra) == Ra + @test matrix(Sa) == Sa + @test matrix(U, Sa) == Sa + @test Matrix(Ra) == a + @test Matrix(Sa) == a +end + @testset "Strassen" begin S = matrix(QQ, rand(-10:10, 100, 100)) T = S*S