Skip to content

Commit 33763a0

Browse files
kshyattararslan
authored andcommitted
Add test, fix bug for chol and test for tridiag (#24411)
1 parent 8cd97c5 commit 33763a0

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

base/linalg/cholesky.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ function show(io::IO, C::Cholesky{<:Any,<:AbstractMatrix})
406406
println(io, "$(typeof(C)) with factor:")
407407
show(io, C[:UL])
408408
else
409-
print("Failed factorization of type $(typeof(C))")
409+
print(io, "Failed factorization of type $(typeof(C))")
410410
end
411411
end
412412

test/linalg/cholesky.jl

+4-2
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ function unary_ops_tests(a, ca, tol; n=size(a, 1))
1313
@test isposdef(ca)
1414
@test_throws KeyError ca[:Z]
1515
@test size(ca) == size(a)
16-
@test Matrix(copy(ca)) a
16+
@test Array(copy(ca)) a
1717
end
1818

1919
function factor_recreation_tests(a_U, a_L)
2020
c_U = cholfact(a_U)
2121
c_L = cholfact(a_L)
2222
cl = chol(a_L)
2323
ls = c_L[:L]
24-
@test Matrix(c_U) Matrix(c_L) a_U
24+
@test Array(c_U) Array(c_L) a_U
2525
@test ls*ls' a_U
2626
@test triu(c_U.factors) c_U[:U]
2727
@test tril(c_L.factors) c_L[:L]
@@ -180,6 +180,8 @@ end
180180
C = cholfact(A)
181181
@test !isposdef(C)
182182
@test !LinAlg.issuccess(C)
183+
Cstr = sprint(show, C)
184+
@test Cstr == "Failed factorization of type $(typeof(C))"
183185
@test_throws PosDefException C\B
184186
@test_throws PosDefException det(C)
185187
@test_throws PosDefException logdet(C)

test/linalg/tridiag.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ guardsrand(123) do
288288
invFsv = Fs\vv
289289
x = Ts\vv
290290
@test x invFsv
291-
@test Array(AbstractArray(Tldlt)) Fs
291+
@test Array(Tldlt) Fs
292292
end
293293

294294
@testset "similar" begin

0 commit comments

Comments
 (0)