Skip to content

Commit c9a2550

Browse files
author
Marie BONBOIRE
committed
add contiguous block of rows case
1 parent c3f81fd commit c9a2550

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/sage/matrix/matrix_modn_dense_template.pxi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3017,6 +3017,10 @@ cdef class Matrix_modn_dense_template(Matrix_dense):
30173017
if ncols < 0 or col < 0 or col + ncols > self._ncols:
30183018
raise IndexError("columns out of range")
30193019

3020+
if col == 0 and ncols == self._ncols:
3021+
cdef Matrix_modn_dense_template M = self.new_matrix(nrows=nrows, ncols=self._ncols)
3022+
memcpy(M._entries, self._entries+row*ncols, sizeof(celement)*ncols*nrows)
3023+
30203024
cdef Matrix_modn_dense_template M = self.new_matrix(nrows=nrows, ncols=ncols)
30213025
cdef Py_ssize_t i,r
30223026
for i,r in enumerate(range(row, row+nrows)) :

0 commit comments

Comments
 (0)