Skip to content

Commit

Permalink
sparsity: ignore negative map indices
Browse files Browse the repository at this point in the history
  • Loading branch information
ksagiyam committed Jan 19, 2024
1 parent ccd81e0 commit c421a49
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions pyop2/sparsity.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,16 @@ def fill_with_zeros(PETSc.Mat mat not None, dims, maps, iteration_regions, set_d
cset_entry = <PetscInt>set_entry
for i in range(nrcomposedmaps):
rset_entry = rcomposedmaps[nrcomposedmaps - 1 - i][rset_entry]
if rset_entry < 0:
break
if rset_entry < 0:
continue
for i in range(nccomposedmaps):
cset_entry = ccomposedmaps[nccomposedmaps - 1 - i][cset_entry]
if cset_entry < 0:
break
if cset_entry < 0:
continue
CHKERR(MatSetValuesBlockedLocal(mat.mat, rarity, &rmap[<int>rset_entry, 0],
carity, &cmap[<int>cset_entry, 0],
values, PETSC_INSERT_VALUES))
Expand Down Expand Up @@ -321,8 +329,16 @@ def fill_with_zeros(PETSc.Mat mat not None, dims, maps, iteration_regions, set_d
cset_entry = <PetscInt>set_entry
for i in range(nrcomposedmaps):
rset_entry = rcomposedmaps[nrcomposedmaps - 1 - i][rset_entry]
if rset_entry < 0:
break
if rset_entry < 0:
continue
for i in range(nccomposedmaps):
cset_entry = ccomposedmaps[nccomposedmaps - 1 - i][cset_entry]
if cset_entry < 0:
break
if cset_entry < 0:
continue
if constant_layers:
layer_start = layers[0, 0]
layer_end = layers[0, 1] - 1
Expand Down

0 comments on commit c421a49

Please sign in to comment.