Skip to content

Commit f525070

Browse files
Generalize fast colored iteration on banded matrix to array output
The function already uses 2D indexing so it's fast and safe for array output too, it just needs to make sure to get the sparsity information from sparsity (which it should have done in the first place, it just assumed the two were the same).
1 parent bcf0198 commit f525070

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: ext/FiniteDiffBandedMatricesExt.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ end
1010

1111
FiniteDiff._use_findstructralnz(::BandedMatrices.BandedMatrix) = false
1212

13-
@inline function FiniteDiff._colorediteration!(Jac::BandedMatrices.BandedMatrix,
13+
@inline function FiniteDiff._colorediteration!(Jac::Union{BandedMatrices.BandedMatrix,Array},
1414
sparsity::BandedMatrices.BandedMatrix,
1515
rows_index,cols_index,vfx,colorvec,color_i,ncols)
1616
nrows = size(Jac,1)
17-
l,u = BandedMatrices.bandwidths(Jac)
17+
l,u = BandedMatrices.bandwidths(sparsity)
1818
#data = BandedMatrices.bandeddata(Jac)
1919
for col_index in max(1,1-l):min(ncols,ncols+u)
2020
if colorvec[col_index] == color_i

0 commit comments

Comments
 (0)