Skip to content

Commit

Permalink
Added tests for diagm for vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
eulerkochy committed Feb 28, 2019
1 parent 68d0edf commit 16c5061
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions stdlib/LinearAlgebra/test/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ 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 16c5061

Please sign in to comment.