-
-
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
fix (\) SparseVector in SuiteSparse.CHOLMOD #28526
Conversation
stdlib/SuiteSparse/src/cholmod.jl
Outdated
@@ -1714,7 +1714,7 @@ end | |||
(\)(L::Factor{T}, B::StridedMatrix) where {T<:VTypes} = Matrix(L\Dense{T}(B)) | |||
(\)(L::Factor, B::Sparse) = spsolve(CHOLMOD_A, L, B) | |||
# When right hand side is sparse, we have to ensure that the rhs is not marked as symmetric. | |||
(\)(L::Factor, B::SparseVecOrMat) = sparse(spsolve(CHOLMOD_A, L, Sparse(B, 0))) | |||
(\)(L::Factor, B::SparseVecOrMat) = sparse(spsolve(CHOLMOD_A, L, Sparse(B))) |
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.
It's not completely clear but the comment right above is the explanation for the zero so it is wrong to remove it here. Instead, I'd just split the method into one for matrices and one for vectors.
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.
See inline comment.
test for Factor and Symmetric Sparse Matrix
Thanks so much for the comment. I also wrote a test for the symmetric matrix case. |
In case this gets successfully rebased on master, I'd suggest #34989 (review). |
* fix \ SparseVector * split (\) for sparsevector; test for Factor and Symmetric Sparse Matrix Co-authored-by: Chi Po Choi <[email protected]>
I've merged #34989 |
Thank you so much! |
* fix \ SparseVector * split (\) for sparsevector; test for Factor and Symmetric Sparse Matrix Co-authored-by: Chi Po Choi <[email protected]> (cherry picked from commit d2f9677)
* fix \ SparseVector * split (\) for sparsevector; test for Factor and Symmetric Sparse Matrix Co-authored-by: Chi Po Choi <[email protected]>
* fix \ SparseVector * split (\) for sparsevector; test for Factor and Symmetric Sparse Matrix Co-authored-by: Chi Po Choi <[email protected]>
This reverts commit d2f9677.
(\) for Factor and SparseVecOrMat has the following method error:
The method error is due to the call
Sparse(A::SparseMatrixCSC{Tv,SuiteSparse_long}, stype::Integer)
.It should call
Sparse(A::SparseVector{<:VTypes,SuiteSparse_long})
andSparse(A::SparseMatrixCSC{<:VTypes,<:ITypes})
instead.I fixed it and wrote a test: