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

Commit

Permalink
22325: preserve algorithm='maxima', add doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
rwst committed Feb 9, 2017
1 parent e04186d commit 7a9eb46
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/sage/functions/orthogonal_polys.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,15 +403,24 @@ def __call__(self, *args, **kwds):
EXAMPLES::
sage: K.<a> = NumberField(x^3-x-1)
sage: chebyshev_T(5, a)
16*a^2 + a - 4
sage: chebyshev_T(5, x)
16*x^5 - 20*x^3 + 5*x
sage: chebyshev_T(5, x, algorithm='pari')
16*x^5 - 20*x^3 + 5*x
sage: chebyshev_T(5, x, algorithm='maxima')
16*x^5 - 20*x^3 + 5*x
sage: chebyshev_T(5, x, algorithm='recursive')
16*x^5 - 20*x^3 + 5*x
"""
algorithm = kwds.get('algorithm', None)
if algorithm == 'pari':
return self.eval_pari(*args, **kwds)
elif algorithm == 'recursive':
return self.eval_recursive(*args, **kwds)
elif algorithm == 'maxima':
from sage.calculus.calculus import maxima
kwds['hold'] = True
return maxima(self._eval_(*args, **kwds))._sage_()

return super(OrthogonalFunction,self).__call__(*args, **kwds)

Expand Down

0 comments on commit 7a9eb46

Please sign in to comment.