Skip to content

Commit

Permalink
LinearAlgebra: Add test "matrix x matrix with negative stride". (Juli…
Browse files Browse the repository at this point in the history
…aLang#39849)

(Made while looking at JuliaLang#39836, which is matrix x vector.
Matrix x matrix with negative stride is fine as it is, because
it uses the Julia implementation of matrix multiplication.)
  • Loading branch information
dbrueg authored and antoine-levitt committed May 9, 2021
1 parent e90c51b commit 52f9071
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions stdlib/LinearAlgebra/test/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,14 @@ end
@test *(Asub, adjoint(Asub)) == *(Aref, adjoint(Aref))
end

@testset "matrix x matrix with negative stride" begin
M = reshape(map(Float64,1:77),7,11)
N = reshape(map(Float64,1:63),9,7)
U = view(M,7:-1:1,11:-2:1)
V = view(N,7:-1:2,7:-1:1)
@test U*V Matrix(U) * Matrix(V)
end

@testset "dot product of subarrays of vectors (floats, negative stride, issue #37767)" begin
for T in (Float32, Float64, ComplexF32, ComplexF64)
a = Vector{T}(3:2:7)
Expand Down

0 comments on commit 52f9071

Please sign in to comment.