Skip to content

Commit

Permalink
Add tests for diagm for vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
eulerkochy committed Feb 27, 2019
1 parent 7a5e5b4 commit 6f5a7dd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions stdlib/LinearAlgebra/test/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ bimg = randn(n,2)/2
end
end # for eltyb


@testset "Test diagm for vectors" begin
@test diagm(zeros(50)) == diagm(0 => zeros(50))
@test diagm(ones(50)) == diagm(0 => ones(50))
for i = 1:50
v = randn(500)
@test diagm(v) == diagm(0 => v)
end
end

@testset "Test pinv (rtol, atol)" begin
M = [1 0 0; 0 1 0; 0 0 0]
@test pinv(M,atol=1)== zeros(3,3)
Expand Down

0 comments on commit 6f5a7dd

Please sign in to comment.