On Monday, May 9, 2016 at 2:40:02 PM UTC+2, mmarco wrote: > Right now Sage can convert seamlessly between polynomial rings and symbolic > ring. I am trying to extend this ability to Laurent polynomial rings. > > > I have already worked out the conversion to symbolic ring, by defining a > method called _symbolic_ in the LaurentPolynomial classes. But now I am not > sure which whould be the right way to proceed. I have considered the > following options: > > > 1) Modifying the LaurentPolynomialRing to declare a convert_method_name > during creation, and then implement this convert method in symbolic > expressions. > > > 2) Modify the element constructor of LaurentPolynomials to check if the input > is a symbolic expression and then try to construct the polynomial from it. > > > Which is the recommended one?
I am not sure if either is necessary. My first attempt would be to change Expression.polynomial() to catch all relevant cases, shift right, convert to normal polynomial, convert that to a Laurent polynomial, and finally shift left. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.