Skip to content
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

Eventually retire chol_lower and chol_upper #215

Open
st-- opened this issue Feb 5, 2025 · 1 comment
Open

Eventually retire chol_lower and chol_upper #215

st-- opened this issue Feb 5, 2025 · 1 comment

Comments

@st--
Copy link
Contributor

st-- commented Feb 5, 2025

Now that JuliaLang/LinearAlgebra.jl#1186 is merged, once it can be used by downstream packages, the chol_lower and chol_upper wrappers in chol.jl can probably be retired. :)

@devmotion
Copy link
Member

We could simplify chol_lower and chol_upper but I'm not sure if it's possible to remove them completely: They are also specialized for Matrix and sparse matrices in

PDMats.jl/src/chol.jl

Lines 13 to 25 in 5e7d88e

# For a dense Matrix, the following allows us to avoid the Adjoint wrapper:
chol_lower(a::Matrix) = cholesky(Symmetric(a, :L)).L
# NOTE: Formally, the line above should use Hermitian() instead of Symmetric(),
# but this currently has an AutoDiff issue in Zygote.jl, and PDMat is
# type-restricted to be Real, so they are equivalent.
chol_upper(a::Matrix) = cholesky(Symmetric(a, :U)).U
if HAVE_CHOLMOD
CholTypeSparse{T} = SuiteSparse.CHOLMOD.Factor{T}
# Take into account pivoting!
chol_lower(cf::CholTypeSparse) = cf.PtL
chol_upper(cf::CholTypeSparse) = cf.UP

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants