From 65db5e1f6a0d4a8410f6a1a8305b7c9b94dc3cc7 Mon Sep 17 00:00:00 2001 From: Wimmerer Date: Mon, 13 Dec 2021 21:05:14 -0500 Subject: [PATCH] Properly increment/decrement during pattern check --- src/KLU.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/KLU.jl b/src/KLU.jl index 83eca13..4a64487 100644 --- a/src/KLU.jl +++ b/src/KLU.jl @@ -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