@@ -62,15 +62,25 @@ function test_linalg(AT)
62
62
end
63
63
64
64
@testset " $T gemv y := $f (A) * x * a + y * b" for f in (identity, transpose, adjoint), T in supported_eltypes ()
65
- @test compare (* , AT, f (rand (T, 4 , 4 )), rand (T, 4 ))
66
- @test compare (mul!, AT, rand (T, 4 ), f (rand (T, 4 , 4 )), rand (T, 4 ))
67
- @test compare (mul!, AT, rand (T, 4 ), f (rand (T, 4 , 4 )), rand (T, 4 ), Ref (T (4 )), Ref (T (5 )))
65
+ y, A, x = rand (T, 4 ), rand (T, 4 , 4 ), rand (T, 4 )
66
+
67
+ # workaround for https://github.com/JuliaLang/julia/issues/35163#issue-584248084
68
+ T <: Integer && (y .%= T (10 ); A .%= T (10 ); x .%= T (10 ))
69
+
70
+ @test compare (* , AT, f (A), x)
71
+ @test compare (mul!, AT, y, f (A), x)
72
+ @test compare (mul!, AT, y, f (A), x, Ref (T (4 )), Ref (T (5 )))
68
73
end
69
74
70
75
@testset " $T gemm C := $f (A) * $g (B) * a + C * b" for f in (identity, transpose, adjoint), g in (identity, transpose, adjoint), T in supported_eltypes ()
71
- @test compare (* , AT, f (rand (T, 4 , 4 )), g (rand (T, 4 , 4 )))
72
- @test compare (mul!, AT, rand (T, 4 , 4 ), f (rand (T, 4 , 4 )), g (rand (T, 4 , 4 )))
73
- @test compare (mul!, AT, rand (T, 4 , 4 ), f (rand (T, 4 , 4 )), g (rand (T, 4 , 4 )), Ref (T (4 )), Ref (T (5 )))
76
+ A, B, C = rand (T, 4 , 4 ), rand (T, 4 , 4 ), rand (T, 4 , 4 )
77
+
78
+ # workaround for https://github.com/JuliaLang/julia/issues/35163#issue-584248084
79
+ T <: Integer && (A .%= T (10 ); B .%= T (10 ); C .%= T (10 ))
80
+
81
+ @test compare (* , AT, f (A), g (B))
82
+ @test compare (mul!, AT, C, f (A), g (B))
83
+ @test compare (mul!, AT, C, f (A), g (B), Ref (T (4 )), Ref (T (5 )))
74
84
end
75
85
76
86
@testset " lmul! and rmul!" for (a,b) in [((3 ,4 ),(4 ,3 )), ((3 ,), (1 ,3 )), ((1 ,3 ), (3 ))], T in supported_eltypes ()
0 commit comments