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

sparse: Optimize swaprows!, swapcols! #42678

Merged
merged 1 commit into from
Oct 18, 2021
Merged

sparse: Optimize swaprows!, swapcols! #42678

merged 1 commit into from
Oct 18, 2021

Conversation

Keno
Copy link
Member

@Keno Keno commented Oct 18, 2021

We have a swpacols! helper in Base that is used in the permuation
code as well as in the bareiss factorization code. I was working
on extending the latter, among others to sparse arrays and
alternative pivot choices. To that end, this PR, adds swaprows!
in analogy with swapcols! and adds optimized implementations for
SparseMatrixCSC. Note that neither of these functions are currently
exported (though since they are useful, we may want a generic
swapslices! of some sort, but that's for a future PR).

While we're at it, also replace the open-coded in-place circshift!
by one on SubArray, such that they can automatically beneift
if that method is optimized in the future (#42676).

cc also @abraunst who implemented sparse circshift!

@Keno Keno requested review from ViralBShah and stevengj October 18, 2021 01:56
We have a swpacols! helper in Base that is used in the permuation
code as well as in the bareiss factorization code. I was working
on extending the latter, among others to sparse arrays and
alternative pivot choices. To that end, this PR, adds swaprows!
in analogy with swapcols! and adds optimized implementations for
SparseMatrixCSC. Note that neither of these functions are currently
exported (though since they are useful, we may want a generic
swapslices! of some sort, but that's for a future PR).

While we're at it, also replace the open-coded in-place circshift!
by one on SubArray, such that they can automatically beneift
if that method is optimized in the future (#42676).
@ViralBShah
Copy link
Member

@andreasnoack @KristofferC

@Keno Keno merged commit 225c543 into master Oct 18, 2021
@Keno Keno deleted the kf/sparseswap branch October 18, 2021 16:57
@ViralBShah ViralBShah added the sparse Sparse arrays label Oct 18, 2021
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
We have a swpacols! helper in Base that is used in the permuation
code as well as in the bareiss factorization code. I was working
on extending the latter, among others to sparse arrays and
alternative pivot choices. To that end, this PR, adds swaprows!
in analogy with swapcols! and adds optimized implementations for
SparseMatrixCSC. Note that neither of these functions are currently
exported (though since they are useful, we may want a generic
swapslices! of some sort, but that's for a future PR).

While we're at it, also replace the open-coded in-place circshift!
by one on SubArray, such that they can automatically beneift
if that method is optimized in the future (JuliaLang#42676).
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
We have a swpacols! helper in Base that is used in the permuation
code as well as in the bareiss factorization code. I was working
on extending the latter, among others to sparse arrays and
alternative pivot choices. To that end, this PR, adds swaprows!
in analogy with swapcols! and adds optimized implementations for
SparseMatrixCSC. Note that neither of these functions are currently
exported (though since they are useful, we may want a generic
swapslices! of some sort, but that's for a future PR).

While we're at it, also replace the open-coded in-place circshift!
by one on SubArray, such that they can automatically beneift
if that method is optimized in the future (JuliaLang#42676).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sparse Sparse arrays
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants