Skip to content

Commit

Permalink
Add a few tests for generic LinearAlgebra (#40794)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarrasch authored May 11, 2021
1 parent 6cebd28 commit d6c092d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions stdlib/LinearAlgebra/test/generic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ end
@testset "Scaling with 5-argument mul!" begin
@test mul!(copy(a), 5., a, 10, 100) == a*150
@test mul!(copy(a), a, 5., 10, 100) == a*150
@test mul!(vec(copy(a)), 5., a, 10, 100) == vec(a*150)
@test mul!(vec(copy(a)), a, 5., 10, 100) == vec(a*150)
@test_throws DimensionMismatch mul!([vec(copy(a)); 0], 5., a, 10, 100)
@test_throws DimensionMismatch mul!([vec(copy(a)); 0], a, 5., 10, 100)
@test mul!(copy(a), Diagonal([1.; 2.]), a, 10, 100) == 10a.*[1; 2] .+ 100a
@test mul!(copy(a), Diagonal([1; 2]), a, 10, 100) == 10a.*[1; 2] .+ 100a
@test mul!(copy(a), a, Diagonal(1.:an), 10, 100) == 10a.*Vector(1:an)' .+ 100a
Expand Down Expand Up @@ -189,6 +193,7 @@ end
@test det(a) == a
@test norm(a) == abs(a)
@test norm(a, 0) == 1
@test norm(0, 0) == 0
end

@test !issymmetric(NaN16)
Expand Down Expand Up @@ -241,12 +246,14 @@ end
rotate!(x, y, c, s)
@test x c*x2 + s*y2
@test y -conj(s)*x2 + c*y2
@test_throws DimensionMismatch rotate!([x; x], y, c, s)

x3 = copy(x)
y3 = copy(y)
reflect!(x, y, c, s)
@test x c*x3 + s*y3
@test y conj(s)*x3 - c*y3
@test_throws DimensionMismatch reflect!([x; x], y, c, s)
end

@testset "LinearAlgebra.axp(b)y! for element type without commutative multiplication" begin
Expand All @@ -270,6 +277,7 @@ end
ry = [2 8]
@test LinearAlgebra.axpy!(α, x, rx, y, ry) == [1 1 1 1; 11 1 1 26]
end

@testset "norm and normalize!" begin
vr = [3.0, 4.0]
for Tr in (Float32, Float64)
Expand Down

4 comments on commit d6c092d

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Your package evaluation job has completed - possible new issues were detected. A full report can be found here. cc @maleadt

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

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

Your package evaluation job has completed - possible issues were detected. A full report can be found here. cc @maleadt

Please sign in to comment.