|
1 | 1 | cimport cython |
2 | 2 |
|
3 | 3 | from flint.flintlib.flint cimport ulong, mp_limb_t |
4 | | -from flint.flintlib.nmod cimport nmod_t |
5 | 4 |
|
6 | 5 | from flint.flintlib.fmpz_mat cimport fmpz_mat_nrows, fmpz_mat_ncols |
7 | 6 | from flint.flintlib.fmpz_mat cimport fmpz_mat_get_nmod_mat |
@@ -123,7 +122,6 @@ cdef class nmod_mat_ctx: |
123 | 122 | cdef any_as_nmod_mat(self, obj): |
124 | 123 | """Convert obj to nmod_mat or return NotImplemented.""" |
125 | 124 | cdef nmod_mat r |
126 | | - cdef mp_limb_t v |
127 | 125 |
|
128 | 126 | if typecheck(obj, nmod_mat): |
129 | 127 | return obj |
@@ -181,38 +179,38 @@ cdef class nmod_mat_ctx: |
181 | 179 | """ |
182 | 180 | return self._is_prime |
183 | 181 |
|
184 | | - #def zero(self, slong m, slong n): |
185 | | - # """Return the zero ``nmod_mat``. |
186 | | - # |
187 | | - # >>> ctx = nmod_mat_ctx.new(17) |
188 | | - # >>> ctx.zero(2, 3) |
189 | | - # [0, 0, 0] |
190 | | - # [0, 0, 0] |
191 | | - |
192 | | - # """ |
193 | | - # cdef nmod_mat r = self.new_nmod_mat() |
194 | | - # nmod_mat_zero(r.val) |
195 | | - # return r |
196 | | - |
197 | | - #def one(self, slong m, slong n=-1): |
198 | | - # """Return the one ``nmod_mat``. |
199 | | - |
200 | | - # >>> ctx = nmod_mat_ctx.new(17) |
201 | | - # >>> ctx.one(2) |
202 | | - # [1, 0] |
203 | | - # [0, 1] |
204 | | - # >>> ctx.one(2, 3) |
205 | | - # [1, 0, 0] |
206 | | - # [0, 1, 0] |
207 | | - |
208 | | - # """ |
209 | | - # cdef nmod_mat r = self.new_nmod_mat() |
210 | | - # if n == -1: |
211 | | - # n = m |
212 | | - # n = min(m, n) |
213 | | - # for i from 0 <= i < n: |
214 | | - # nmod_mat_set_entry(r.val, i, i, 1) |
215 | | - # return r |
| 182 | + #def zero(self, slong m, slong n): |
| 183 | + # """Return the zero ``nmod_mat``. |
| 184 | + # |
| 185 | + # >>> ctx = nmod_mat_ctx.new(17) |
| 186 | + # >>> ctx.zero(2, 3) |
| 187 | + # [0, 0, 0] |
| 188 | + # [0, 0, 0] |
| 189 | + |
| 190 | + # """ |
| 191 | + # cdef nmod_mat r = self.new_nmod_mat() |
| 192 | + # nmod_mat_zero(r.val) |
| 193 | + # return r |
| 194 | + |
| 195 | + #def one(self, slong m, slong n=-1): |
| 196 | + # """Return the one ``nmod_mat``. |
| 197 | + |
| 198 | + # >>> ctx = nmod_mat_ctx.new(17) |
| 199 | + # >>> ctx.one(2) |
| 200 | + # [1, 0] |
| 201 | + # [0, 1] |
| 202 | + # >>> ctx.one(2, 3) |
| 203 | + # [1, 0, 0] |
| 204 | + # [0, 1, 0] |
| 205 | + |
| 206 | + # """ |
| 207 | + # cdef nmod_mat r = self.new_nmod_mat() |
| 208 | + # if n == -1: |
| 209 | + # n = m |
| 210 | + # n = min(m, n) |
| 211 | + # for i from 0 <= i < n: |
| 212 | + # nmod_mat_set_entry(r.val, i, i, 1) |
| 213 | + # return r |
216 | 214 |
|
217 | 215 | def __str__(self): |
218 | 216 | return f"Context for nmod_mat with modulus: {self.mod.n}" |
@@ -491,9 +489,7 @@ cdef class nmod_mat(flint_mat): |
491 | 489 | return r |
492 | 490 |
|
493 | 491 | def __rmul__(s, t): |
494 | | - cdef nmod_mat_struct *sv |
495 | 492 | cdef mp_limb_t c |
496 | | - sv = &(<nmod_mat>s).val[0] |
497 | 493 | if s.ctx.any_as_nmod(&c, t): |
498 | 494 | return (<nmod_mat>s).__mul_nmod(c) |
499 | 495 | u = s.ctx.any_as_nmod_mat(t) |
|
0 commit comments