We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9abcd14 + ecbd7bf commit dc5820cCopy full SHA for dc5820c
cypari2/gen.pyx
@@ -1522,14 +1522,17 @@ cdef class Gen(Gen_base):
1522
if typ(self.g) != t_MAT:
1523
raise TypeError("cannot index PARI type %s by tuple" % typ(self.g))
1524
1525
+ if len(n) != 2:
1526
+ raise ValueError("matrix index must be [row, column]")
1527
+
1528
i, j = n
1529
1530
if i < 0 or i >= glength(gel(self.g, 1)):
1531
raise IndexError("row i(=%s) must be between 0 and %s" % (i, self.nrows()-1))
1532
if j < 0 or j >= glength(self.g):
1533
raise IndexError("column j(=%s) must be between 0 and %s" % (j, self.ncols()-1))
1534
- self.cache((i,j), x)
1535
+ self.cache((i, j), x)
1536
xt = x.ref_target()
1537
set_gcoeff(self.g, i+1, j+1, xt)
1538
return
0 commit comments