Skip to content

Commit

Permalink
Add test, fix bug for chol and test for tridiag (#24411)
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt authored and ararslan committed Nov 3, 2017
1 parent 8cd97c5 commit 33763a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion base/linalg/cholesky.jl
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ function show(io::IO, C::Cholesky{<:Any,<:AbstractMatrix})
println(io, "$(typeof(C)) with factor:")
show(io, C[:UL])
else
print("Failed factorization of type $(typeof(C))")
print(io, "Failed factorization of type $(typeof(C))")
end
end

Expand Down
6 changes: 4 additions & 2 deletions test/linalg/cholesky.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ function unary_ops_tests(a, ca, tol; n=size(a, 1))
@test isposdef(ca)
@test_throws KeyError ca[:Z]
@test size(ca) == size(a)
@test Matrix(copy(ca)) a
@test Array(copy(ca)) a
end

function factor_recreation_tests(a_U, a_L)
c_U = cholfact(a_U)
c_L = cholfact(a_L)
cl = chol(a_L)
ls = c_L[:L]
@test Matrix(c_U) Matrix(c_L) a_U
@test Array(c_U) Array(c_L) a_U
@test ls*ls' a_U
@test triu(c_U.factors) c_U[:U]
@test tril(c_L.factors) c_L[:L]
Expand Down Expand Up @@ -180,6 +180,8 @@ end
C = cholfact(A)
@test !isposdef(C)
@test !LinAlg.issuccess(C)
Cstr = sprint(show, C)
@test Cstr == "Failed factorization of type $(typeof(C))"
@test_throws PosDefException C\B
@test_throws PosDefException det(C)
@test_throws PosDefException logdet(C)
Expand Down
2 changes: 1 addition & 1 deletion test/linalg/tridiag.jl
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ guardsrand(123) do
invFsv = Fs\vv
x = Ts\vv
@test x invFsv
@test Array(AbstractArray(Tldlt)) Fs
@test Array(Tldlt) Fs
end

@testset "similar" begin
Expand Down

2 comments on commit 33763a0

@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 benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(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.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

Please sign in to comment.