File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,7 +21,11 @@ function MOI.Bridges.Constraint.compute_sparse_sqrt_fallback(
2121) where {F<: MOI.ScalarQuadraticFunction ,S<: MOI.AbstractSet }
2222 n = LinearAlgebra. checksquare (Q)
2323 factor = LDLFactorizations. ldl (Q)
24- if ! LDLFactorizations. factorized (factor) || minimum (factor. D) < 0
24+ # Ideally we should use `LDLFactorizations.factorized(factor)` here, but it
25+ # has some false negatives. Instead we check that the factorization appeared
26+ # to work. This is a heuristic. There might be other cases where check is
27+ # insufficient.
28+ if minimum (factor. D) < 0 || any (issubnormal, factor. D)
2529 msg = """
2630 Unable to transform a quadratic constraint into a SecondOrderCone
2731 constraint because the quadratic constraint is not convex.
Original file line number Diff line number Diff line change @@ -363,11 +363,11 @@ function test_compute_sparse_sqrt_edge_cases()
363363 [1.0 0.0 ; 0.0 2.0 ],
364364 # Cholesky works, with pivoting
365365 [1.0 0.0 1.0 ; 0.0 1.0 1.0 ; 1.0 1.0 3.0 ],
366- # Cholesky fails due to 0 eigen value
366+ # Cholesky fails due to 0 eigen value. LDL works
367367 [1.0 1.0 ; 1.0 1.0 ],
368368 # Cholesky succeeds, even though 0 eigen value
369369 [2.0 2.0 ; 2.0 2.0 ],
370- # Cholesky fails because of 0 column/row
370+ # Cholesky fails because of 0 column/row. LDL works
371371 [2.0 0.0 ; 0.0 0.0 ],
372372 ]
373373 B = SparseArrays. sparse (A)
You can’t perform that action at this time.
0 commit comments