File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 394394end # @static if Base.USE_GPL_LIBS
395395
396396function LinearSolve. pattern_changed (fact, A:: SparseArrays.SparseMatrixCSC )
397- ! (SparseArrays. decrement (SparseArrays. getcolptr (A)) ==
398- fact. colptr && SparseArrays. decrement (SparseArrays. getrowval (A)) ==
399- fact. rowval)
397+ colptr0 = fact. colptr # has 0-based indices
398+ colptr1 = SparseArrays. getcolptr (A) # has 1-based indices
399+ length (colptr0) == length (colptr1) || return true
400+ @inbounds for i in eachindex (colptr0)
401+ colptr0[i] + 1 == colptr1[i] || return true
402+ end
403+ rowval0 = fact. rowval
404+ rowval1 = SparseArrays. getrowval (A)
405+ length (rowval0) == length (rowval1) || return true
406+ @inbounds for i in eachindex (rowval0)
407+ rowval0[i] + 1 == rowval1[i] || return true
408+ end
409+ return false
400410end
401411
402412@static if Base. USE_GPL_LIBS
You can’t perform that action at this time.
0 commit comments