A[c|t]_ldiv_B! specializations for UmfpackLU-StridedVecOrMat, less generalized linear indexing and meta-fu#20046
Merged
mbauman merged 1 commit intoJuliaLang:mb/deprecate-17440from Jan 15, 2017
Conversation
…combinations, without generalized linear indexing and meta-fu.
tkelman
reviewed
Jan 15, 2017
| (_AqldivB_checkshapecompat(X, B); _AqldivB_kernel!(X, lu, B, transtype); return X) | ||
|
|
||
| _AqldivB_checkshapecompat(X::StridedVecOrMat, B::StridedVecOrMat) = | ||
| size(X, 2) == size(B, 2) || throw(DimensionMismatch("input and output must have same column count")) |
Contributor
There was a problem hiding this comment.
why the rewording from "number of columns" to "column count" ? was better before IMO
Member
Author
There was a problem hiding this comment.
Reworded to reduce line length overrun, but happy to change that in a collection of fixups? Thanks!
tkelman
reviewed
Jan 15, 2017
| _AqldivB_kernel!{T<:UMFVTypes}(x::StridedVector{T}, lu::UmfpackLU{T}, b::StridedVector{T}, transtype) = | ||
| solve!(x, lu, b, transtype) | ||
| _AqldivB_kernel!{T<:UMFVTypes}(X::StridedMatrix{T}, lu::UmfpackLU{T}, B::StridedMatrix{T}, transtype) = | ||
| for col in 1:size(X, 1) solve!(view(X, :, col), lu, view(B, :, col), transtype) end |
Contributor
There was a problem hiding this comment.
one-liner for loops are not very readable
Member
Author
There was a problem hiding this comment.
Is there a better way to avoid introducing another three primarily empty/extraneous lines? Thanks!
Contributor
There was a problem hiding this comment.
if a one-liner has a nontrivial block of code or is doing multiple things, it shouldn't be a one-liner
Member
Author
There was a problem hiding this comment.
Expanded in #20055, and likewise a few of the other one-liners. Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Towards fixing some generalized linear indexing deprecation warnings in #20040, this pull request rewrites the
A[c|t]_ldiv_B[!]specializations forUmfpackLU-StridedVecOrMatcombinations, leveraging multiple dispatch to remove generalized linear indexing and meta-fu. cc @mbauman. (Crossref. #20045.) Best!