Skip to content

Commit

Permalink
Merge pull request #3 from manuelgpda/main
Browse files Browse the repository at this point in the history
Added a shift to colswap in _perform_row_operations
  • Loading branch information
abdullahkhalids authored Jun 16, 2024
2 parents 63ff879 + 2270213 commit 2428f7c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions stac/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def _perform_row_operations(A: Any,
is a list of length three. The first entry is one of {colswap, rowswap
addrow}. The next two arguments determine which rows to swap or add.
start_row : int, optional
Shift the start row of the operations. The default is 0.
Shift the start row and column of the operations. The default is 0.
Returns
-------
Expand All @@ -211,7 +211,8 @@ def _perform_row_operations(A: Any,

for op in ops:
if op[0] == "colswap":
M[:, [op[1], op[2]]] = M[:, [op[2], op[1]]]
M[:,[start_row + op[1], start_row + op[2]]] = \
M[:,[start_row + op[2], start_row + op[1]]]
elif op[0] == "rowswap":
M[[start_row + op[1], start_row + op[2]], :] = \
M[[start_row + op[2], start_row + op[1]], :]
Expand Down

0 comments on commit 2428f7c

Please sign in to comment.