-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ldlt
failes to check whether input matrix is positive-definite
#30861
Comments
Further investigation shows the first |
In principle, the LDLᵀ decomposition (unlike ordinary Cholesky) doesn't require a positive-definite matrix, but I guess we don't currently support that case? It would be nicer to just fix the code to support indefinite symmetric matrices. |
Our versions don't require the matrix to be PD, e.g. julia> T = SymTridiagonal([1.0,-1,1], ones(2)/2)
3×3 SymTridiagonal{Float64,Array{Float64,1}}:
1.0 0.5 ⋅
0.5 -1.0 0.5
⋅ 0.5 1.0
julia> eigvals(T)
3-element Array{Float64,1}:
-1.2247448713915894
1.0
1.224744871391589
julia> ldlt(T)
LDLt{Float64,SymTridiagonal{Float64,Array{Float64,1}}}([1.0 0.5 0.0; 0.5 -1.25 -0.4; 0.0 -0.4 1.2]) but both versions break down for zero pivots because they don't pivot based on the values of the matrix. The sparse version from CHOLMOD does some pivoting during the symbolic factorization to reduce fill but no pivoting during the numerical factorization and the Julia version for |
Doesn't that also mean that |
I believe it does (but that is also the case for LU with partial pivoting). It would be good to have pivoted version of these factorizations. |
Not sure what you mean here — LU with partial pivoting is backwards stable. (In principle, the constant factor in the stability condition is exponentially large in the matrix size, but in practice this never seems to apply to realistic matrices. Regardless, it is technically stable.) Without pivoting, on the other hand, it is unstable (in both theory and practice). |
|
We expect both
ldlt
calls raise a PosDefException. However, only the second call does so.The text was updated successfully, but these errors were encountered: