Skip to content

Commit cb2458e

Browse files
author
Jonathan Kliem
committed
do not increase reference count when assigning entries to vectors/matrices
1 parent e2c9824 commit cb2458e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

cypari2/gen.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@ cdef class Gen(Gen_base):
15301530
raise IndexError("column j(=%s) must be between 0 and %s" % (j, self.ncols()-1))
15311531

15321532
self.cache((i,j), x)
1533-
xt = x.ref_target()
1533+
xt = x.fixGEN()
15341534
set_gcoeff(self.g, i+1, j+1, xt)
15351535
return
15361536

@@ -1554,7 +1554,7 @@ cdef class Gen(Gen_base):
15541554
raise IndexError("index (%s) must be between 0 and %s" % (i, glength(self.g)-1))
15551555

15561556
self.cache(i, x)
1557-
xt = x.ref_target()
1557+
xt = x.fixGEN()
15581558
if typ(self.g) == t_LIST:
15591559
listput(self.g, xt, i+1)
15601560
else:

cypari2/pari_instance.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,7 +1302,7 @@ cdef class Pari(Pari_auto):
13021302
for j in range(n):
13031303
sig_check()
13041304
x = objtogen(entries[k])
1305-
set_gcoeff(A.g, i+1, j+1, x.ref_target())
1305+
set_gcoeff(A.g, i+1, j+1, x.fixGEN())
13061306
A.cache((i,j), x)
13071307
k += 1
13081308
return A
@@ -1318,7 +1318,7 @@ cdef class Pari(Pari_auto):
13181318
13191319
If the second argument `p` is specified, it must be a prime.
13201320
Then only the local information at `p` is computed and returned.
1321-
1321+
13221322
Examples:
13231323
13241324
>>> import cypari2

0 commit comments

Comments
 (0)