-
-
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
Rename CHOLMOD.update! -> CHOLMOD.cholfact!/CHOLMOD.ldltfact! #14419
Conversation
Hermitian{Complex{Float64},SparseMatrixCSC{Complex{Float64},SuiteSparse_long}}}; | ||
shift = 0.0) -> CHOLMOD.Factor | ||
|
||
Compute the LDLt factorization of `A` and reusing the symbolic factorization `F`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comma instead of "and"
A better generic name for these would be something like
|
I agree that |
75673a0
to
96c9998
Compare
Even though the sparse factorizations decompose into a symbolic and a numerical factorization step, I'm not sure if it the right separation in applications. I'd expect that, most often, you want to do both the first time you factorize a matrix and then, afterwards, you might want to reuse the symbolic factorization. I.e. I'm not sure having a Therefore, I think the main question is if we want a generic function for the numerical factorization step or if it is fine to overload I'm fine with renaming the |
In nonlinear optimization (e.g. Ipopt), splitting symbolic and numeric is absolutely the right application separation. Same in any other application where you repeatedly do factorizations on a set of matrices with the same structure but different values. This is very common. The nonzero structure is often known well in advance of any of the values, or provided separately. We need a good API for this for doing serious sparse work.
|
I think you missed my point here. I'm aware of this application, but I'm asking if it is really necessary/desirable to do the symbolic factorization in isolation from the first numerical factorization? That might be the case, but you didn't explain why.
We have had variations of this discussion before and I think you underestimate the challenges with your approach. The "algorithm flag" would either give type instability (for symbols), be non-generic (like |
@andreasnoack I have had cases where I know the structure of the sparse symmetric matrix when constructing an instance of a Julia type that should include both the sparse matrix and its Cholesky factor but I don't know the actual values until I begin an optimization using that object. However, it is usually not that big a deal to insert some values that work, as long as transient zeros (i.e. values that are not systematic zeros but happen to take on the value of zero) are not dropped. I think that CHOLMOD symbolic factorization does not check the values of the nonzeros so that should not be a problem. In other words, one can construct situations where the symbolic factorization should be done by itself but it is not difficult to write around them. |
Yes it is, and yes I did:
The symbolic factorization and anything dependent only on structure can often be moved to effectively "offline" in a lot of these applications, done once before any values are known, to preallocate the data structures that will be needed for the numerical factorization. Doing an extra throwaway first-time numerical factorization is not an acceptable overhead for me when I may only need a handful of iterations in some cases.
I'm not so much thinking of the type as an indicator of what the return type should be, but rather an algorithm variant flag. So I wouldn't be using the dense |
How do you store the "nonzero structure"? Would you create a I guess a solution could be to provide a keyword argument, Isn't |
Just the indices part of the CSC structure. I probably wouldn't create the SparseMatrixCSC, or if I did I'd use the constructor directly and make a slightly invalid object first with an empty nzval. A Defining and exporting an |
Move cholfact documentation to source
96c9998
to
3eefb6b
Compare
Rename CHOLMOD.update! -> CHOLMOD.cholfact!/CHOLMOD.ldltfact!
This can be considered a reversion of a renaming of
cholmod!
that I made in the spring. At that time I splitcholfact(SparseMatrixCSC)
intochofact
andldltfact
and thought it would be a good idea to have a generic function for reusing the symbolic factorization.In practice, I don't think it is important to have a generic function for this and we are now using
LinAlg.update!
for rank updates of matrices/factorizations so a renaming was necessary.This also moves the cholfact documentation to the source.