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

Commit

Permalink
Trac #19540: variable_names for terms
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrenn committed Feb 14, 2016
1 parent 3f0f855 commit eb49c65
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions src/sage/rings/asymptotic/term_monoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -1235,6 +1235,32 @@ def _substitute_(self, rules):
'base class %s.' % (self.parent(),)))


def variable_names(self):
r"""
Return the names of the variables of this term.
OUTPUT:
A tuple of strings.
EXAMPLES::
sage: from sage.rings.asymptotic.term_monoid import TermMonoid
sage: T = TermMonoid('exact', 'QQ^m * m^QQ * log(n)^ZZ', QQ)
sage: T('4 * 2^m * m^4 * log(n)').variable_names()
('m', 'n')
sage: T('4 * 2^m * m^4').variable_names()
('m',)
sage: T('4 * log(n)').variable_names()
('n',)
sage: T('4 * m^3').variable_names()
('m',)
sage: T('4 * m^0').variable_names()
()
"""
return self.growth.variable_names()


class GenericTermMonoid(sage.structure.unique_representation.UniqueRepresentation,
sage.structure.parent.Parent):
r"""
Expand Down

0 comments on commit eb49c65

Please sign in to comment.