# Changeset 6221:125ab3b64c6a

Ignore:
Timestamp:
09/06/07 17:59:51 (6 years ago)
Branch:
default
Message:

Further work on #503.

Location:
sage
Files:
4 edited

Unmodified
Removed
• ## sage/categories/morphism.pyx

 r5480 include "../ext/stdsage.pxi" from sage.structure.element cimport Element from sage.structure.element import generic_power def make_morphism(_class, parent, _dict, _slots): raise TypeError, "self must be an endomorphism." # todo -- what about the case n=0 -- need to specify the identity map somehow. import sage.rings.arith as arith return arith.generic_power(self, n) return generic_power(self, n) cdef class FormalCoercionMorphism(Morphism):
• ## sage/rings/power_series_mpoly.pyx

 r5862 return PowerSeries_mpoly(self._parent, self.__f._lmul_c(c), self._prec, check=False) def __pow__(self_t, r, dummy):  # TODO -- too much code duplication with power_series_poly.pyx? cdef PowerSeries_mpoly self = self_t cdef int right = r if right != r: raise ValueError, "exponent must be an integer" if right < 0: return (~self)**(-right) if right == 0: return self._parent(1) if self.__is_gen: return PowerSeries_mpoly(self._parent, self.__f**right, check=False) if self.is_zero(): return self return arith.generic_power(self, right, self._parent(1)) def make_powerseries_mpoly_v0(parent,  f, prec, is_gen):
• ## sage/rings/power_series_poly.pyx

 r5590 sage: loads(q.dumps()) == q True sage: R. = QQ[[]] sage: f = 3 - t^3 + O(t^5) sage: a = f^3; a 27 - 27*t^3 + O(t^5) sage: b = f^-3; b 1/27 + 1/27*t^3 + O(t^5) sage: a*b 1 + O(t^5) """ R = parent._poly_ring() return (left)._richcmp(right, op) def __pow__(self_t, r, dummy): cdef PowerSeries_poly self = self_t cdef int right = r if right != r: raise ValueError, "exponent must be an integer" if right < 0: return (~self)**(-right) if right == 0: return self._parent(1) if self.__is_gen: return PowerSeries_poly(self._parent, self.__f**right, check=False) if self.is_zero(): return self return arith.generic_power(self, right, self._parent(1)) def polynomial(self): """
• ## sage/schemes/generic/morphism.py

 r5498 #***************************************************************************** from sage.structure.element   import AdditiveGroupElement, RingElement, Element from sage.structure.element   import AdditiveGroupElement, RingElement, Element, generic_power from sage.structure.sequence  import Sequence return FormalCompositeMorphism(homset, right, self) def __pow__(self, n, dummy): def __pow__(self, n, dummy=None): if not self.is_endomorphism(): raise TypeError, "self must be an endomorphism." # todo -- what about the case n=0 -- need to specify the identity map somehow. import sage.rings.arith as arith return arith.generic_power(self, n) return generic_power(self, n)
Note: See TracChangeset for help on using the changeset viewer.