# Ticket #7578: 7578_basic_arithmetic.patch

File 7578_basic_arithmetic.patch, 1.3 KB (added by SimonKing, 12 years ago)

Improving basic arithmetic of infinite polynomial rings

• ## sage/rings/polynomial/infinite_polynomial_element.py

```# HG changeset patch
# User Simon King <simon.king@nuigalway.ie>
# Date 1259709535 0
# Node ID 3c7f788ea9cf10aa7723a650cbd2162cc34c6367
# Parent  5db805d3bdafb3f79835cff2af6a333f749b500c
Improving performance of basic arithmetic in infinite polynomial rings

diff -r 5db805d3bdaf -r 3c7f788ea9cf sage/rings/polynomial/infinite_polynomial_element.py```
 a x2 + x1 """ P = self.parent() self._p = P._P(self._p) x._p = P._P(x._p) return InfinitePolynomial_dense(self.parent(),self._p + x._p, is_good_poly=True) def _mul_(self, x): x2*x1 """ P = self.parent() self._p = P._P(self._p) x._p = P._P(x._p) return InfinitePolynomial_dense(self.parent(),self._p * x._p, is_good_poly=True) x2 - x1 """ P = self.parent() self._p = P._P(self._p) x._p = P._P(x._p) return InfinitePolynomial_dense(self.parent(), self._p - x._p, is_good_poly=True) def __pow__(self, n):