Skip to content

Commit 02def11

Browse files
author
Marie BONBOIRE
committed
add suggested _matrix
1 parent 3ab7db8 commit 02def11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sage/matrix/matrix_modn_dense_template.pxi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3020,12 +3020,12 @@ cdef class Matrix_modn_dense_template(Matrix_dense):
30203020
cdef Matrix_modn_dense_template M = self.new_matrix(nrows=nrows, ncols=ncols)
30213021

30223022
if col == 0 and ncols == self._ncols:
3023-
memcpy(M._entries, self._entries+row*ncols, sizeof(celement)*ncols*nrows)
3023+
memcpy(M._entries, self._matrix[row], sizeof(celement)*ncols*nrows)
30243024
return M
30253025

30263026
cdef Py_ssize_t i,r
30273027
for i,r in enumerate(range(row, row+nrows)) :
3028-
memcpy(M._entries + (i*ncols), self._entries+self._ncols*r+col, sizeof(celement)*ncols)
3028+
memcpy(M._matrix[i], self._matrix[r]+col, sizeof(celement)*ncols)
30293029

30303030
return M
30313031

0 commit comments

Comments
 (0)