@@ -67,23 +67,33 @@ using Base.LinAlg: BlasComplex, BlasFloat, BlasReal, QRPivoted, PosDefException
67
67
capds = cholfact (apds)
68
68
@test inv (capds)* apds ≈ eye (n)
69
69
@test abs ((det (capds) - det (apd))/ det (capds)) <= ε* κ* n
70
+ @test logdet (capds) ≈ log (det (capds))
71
+ @test isposdef (capds)
70
72
if eltya <: BlasReal
71
73
capds = cholfact! (copy (apds))
72
74
@test inv (capds)* apds ≈ eye (n)
73
75
@test abs ((det (capds) - det (apd))/ det (capds)) <= ε* κ* n
76
+ @test logdet (capds) ≈ log (det (capds))
77
+ @test isposdef (capds)
74
78
end
75
79
ulstring = sprint (show,capds[:UL ])
76
80
@test sprint (show,capds) == " $(typeof (capds)) with factor:\n $ulstring "
77
81
else
78
82
capdh = cholfact (apdh)
79
83
@test inv (capdh)* apdh ≈ eye (n)
80
84
@test abs ((det (capdh) - det (apd))/ det (capdh)) <= ε* κ* n
85
+ @test logdet (capdh) ≈ log (det (capdh))
86
+ @test isposdef (capdh)
81
87
capdh = cholfact! (copy (apdh))
82
88
@test inv (capdh)* apdh ≈ eye (n)
83
89
@test abs ((det (capdh) - det (apd))/ det (capdh)) <= ε* κ* n
90
+ @test logdet (capdh) ≈ log (det (capdh))
91
+ @test isposdef (capdh)
84
92
capdh = cholfact! (copy (apd))
85
93
@test inv (capdh)* apdh ≈ eye (n)
86
94
@test abs ((det (capdh) - det (apd))/ det (capdh)) <= ε* κ* n
95
+ @test logdet (capdh) ≈ log (det (capdh))
96
+ @test isposdef (capdh)
87
97
ulstring = sprint (show,capdh[:UL ])
88
98
@test sprint (show,capdh) == " $(typeof (capdh)) with factor:\n $ulstring "
89
99
end
270
280
for T in (Float32, Float64, Complex64, Complex128)
271
281
A = T[1 2 ; 2 1 ]; B = T[1 , 1 ]
272
282
C = cholfact (A)
283
+ @test ! isposdef (C)
273
284
@test_throws PosDefException C\ B
274
285
@test_throws PosDefException det (C)
275
286
@test_throws PosDefException logdet (C)
0 commit comments