File tree 1 file changed +6
-8
lines changed
1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -447,17 +447,15 @@ cdef class Matrix_modn_dense_template(Matrix_dense):
447
447
raise OverflowError (" p (=%s ) must be < %s ." % (p, MAX_MODULUS))
448
448
449
449
if zeroed_alloc:
450
- self ._entries = < celement * > check_calloc(self ._nrows * self ._ncols, sizeof(celement))
450
+ self ._entries = < celement * > check_calloc(self ._nrows * self ._ncols, sizeof(celement))
451
451
else :
452
- self ._entries = < celement * > check_allocarray(self ._nrows * self ._ncols, sizeof(celement))
452
+ self ._entries = < celement * > check_allocarray(self ._nrows * self ._ncols, sizeof(celement))
453
453
454
- self ._matrix = < celement ** > check_allocarray(self ._nrows, sizeof(celement* ))
455
- cdef unsigned int k
454
+ self ._matrix = < celement ** > check_allocarray(self ._nrows, sizeof(celement* ))
456
455
cdef Py_ssize_t i
457
- k = 0
458
- for i in range (self ._nrows):
459
- self ._matrix[i] = self ._entries + k
460
- k = k + self ._ncols
456
+ self ._matrix[0 ] = self ._entries
457
+ for i in range (self ._nrows - 1 ):
458
+ self ._matrix[i + 1 ] = self ._matrix[i] + self ._ncols
461
459
462
460
def __dealloc__ (self ):
463
461
"""
You can’t perform that action at this time.
0 commit comments