Skip to content

Commit

Permalink
do not increase reference count when assigning entries to vectors/mat…
Browse files Browse the repository at this point in the history
…rices
  • Loading branch information
Jonathan Kliem committed Jan 21, 2022
1 parent e2c9824 commit cb2458e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cypari2/gen.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1530,7 +1530,7 @@ cdef class Gen(Gen_base):
raise IndexError("column j(=%s) must be between 0 and %s" % (j, self.ncols()-1))

self.cache((i,j), x)
xt = x.ref_target()
xt = x.fixGEN()
set_gcoeff(self.g, i+1, j+1, xt)
return

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

self.cache(i, x)
xt = x.ref_target()
xt = x.fixGEN()
if typ(self.g) == t_LIST:
listput(self.g, xt, i+1)
else:
Expand Down
4 changes: 2 additions & 2 deletions cypari2/pari_instance.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ cdef class Pari(Pari_auto):
for j in range(n):
sig_check()
x = objtogen(entries[k])
set_gcoeff(A.g, i+1, j+1, x.ref_target())
set_gcoeff(A.g, i+1, j+1, x.fixGEN())
A.cache((i,j), x)
k += 1
return A
Expand All @@ -1318,7 +1318,7 @@ cdef class Pari(Pari_auto):
If the second argument `p` is specified, it must be a prime.
Then only the local information at `p` is computed and returned.
Examples:
>>> import cypari2
Expand Down

0 comments on commit cb2458e

Please sign in to comment.