Skip to content

Commit

Permalink
Specify type for i and check sorting of block rows.
Browse files Browse the repository at this point in the history
  • Loading branch information
hodgestar committed Mar 20, 2023
1 parent 031a093 commit da03d45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions qutip/core/data/csr.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -902,15 +902,15 @@ cpdef CSR from_csr_blocks(

cdef base.idxint rowpos, colpos
cdef base.idxint row_idx, col_idx
cdef base.idxint op_i, op_row, op_row_start, op_row_end, op_row_len
cdef base.idxint op_i, op_row, op_row_start, op_row_end, op_row_len, i

out.row_index[0] = 0

for row_idx in range(n_blocks):
prev_op_idx = op_idx
while op_idx < op_len:
#if block_rows[op_idx] < row_idx:
# raise ValueError("Block row indexes (block_rows) are not sorted.")
if block_rows[op_idx] < row_idx:
raise ValueError("Block row indexes (block_rows) are not sorted.")
if block_rows[op_idx] != row_idx:
break
op_idx += 1
Expand Down

0 comments on commit da03d45

Please sign in to comment.