Hi Hans,
I see you made p_Invers static in e6c82d85aac825e8a
We used to use that function in Sage (though for a dubious purpose, it seems it only computes inverses of units in polynomial rings, so of constants...)
I've tentatively replaced it with this change:
*
https://git.sagemath.org/sage.git/commit/?h=85d00244d0db1cce5933bd6ee46114c58bb32fbb&id=0d6f025a6bf3ac858f331de21b4d9dc298c5c7ec
sig_on()
- cdef MPolynomial_libsingular r = new_MP(self._parent, pInvers(0, self._poly, NULL))
+ cdef MPolynomial_libsingular r = new_MP(self._parent, p_Series(0, p_Copy(_one_element_poly, _ring), self._poly, NULL, _ring))
Where _one_element_poly is _ring(1).
It seems to me that the second argument to p_Series gets modified, whence the p_Copy.
By the way, I guess the above snippet leaks the copy of r(1)... do you confirm it?
Any advice on this piece of code?
Or would you consider reexposing p_Invers?
Or have a better solution in mind?
Thanks for your help,
JP