Skip to content

Commit

Permalink
Properly increment/decrement during pattern check
Browse files Browse the repository at this point in the history
  • Loading branch information
Wimmerer committed Dec 14, 2021
1 parent 2dbb52d commit 65db5e1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/KLU.jl
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,11 @@ end

function klu!(K::KLUFactorization{U}, S::SparseMatrixCSC{U}) where {U}
size(K) == size(S) || throw(ArgumentError("Sizes of K and S must match."))
increment!(K.colptr)
increment!(K.rowval)
K.colptr == S.colptr && K.rowval == S.rowval || throw(ArgumentError("The pattern of the original matrix must match the pattern of the refactor."))
decrement!(K.colptr)
decrement!(K.rowval)
return klu!(K, S.nzval)
end
#B is the modified argument here. To match with the math it should be (klu, B). But convention is
Expand Down

2 comments on commit 65db5e1

@rayegun
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/50493

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.1 -m "<description of version>" 65db5e1f6a0d4a8410f6a1a8305b7c9b94dc3cc7
git push origin v0.2.1

Please sign in to comment.