Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
more cleanup and using generalizing methods for cartesian product
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrenn committed Aug 24, 2015
1 parent 3030d88 commit 74f2db0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/sage/rings/asymptotic/asymptotic_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -1078,10 +1078,14 @@ def gens(self):
sage: AR.<x> = AsymptoticRing(growth_group='x^ZZ', coefficient_ring=ZZ)
sage: AR.gens()
(x,)
sage: B.<y,z> = AsymptoticRing(growth_group='y^ZZ * z^ZZ', coefficient_ring=QQ)
sage: B.gens()
(y, z)
"""
from sage.rings.asymptotic.growth_group import MonomialGrowthGroup
if isinstance(self.growth_group, MonomialGrowthGroup):
return self.create_summand('exact', growth=self.growth_group.gen(), coefficient=1),
return tuple(self.create_summand('exact',
growth=g,
coefficient=self.coefficient_ring(1))
for g in self.growth_group.gens_monomial())


def gen(self, n=0):
Expand Down Expand Up @@ -1123,11 +1127,7 @@ def ngens(self):
sage: AR.ngens()
1
"""
from sage.rings.asymptotic.growth_group import MonomialGrowthGroup
if isinstance(self.growth_group, MonomialGrowthGroup):
return 1
else:
return 0
return len(self.growth_group.gens_monomial())


def create_summand(self, type, growth, **kwds):
Expand Down

0 comments on commit 74f2db0

Please sign in to comment.