summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Krenn <devel@danielkrenn.at>2014-12-27 08:48:05 +0100
committerDaniel Krenn <devel@danielkrenn.at>2014-12-27 08:48:05 +0100
commit38b0f7e183f05dad96a326d51d83282bb57a1e7c (patch)
tree8a9b3103bf9d173fe68b01af4d54e5dc8dd771a6
parentimplement equality testing (using coercion model) (diff)
coercion from other FFPD rings implemented
-rw-r--r--src/sage/combinat/asymptotics_multivariate_generating_functions.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/sage/combinat/asymptotics_multivariate_generating_functions.py b/src/sage/combinat/asymptotics_multivariate_generating_functions.py
index 716b17f..94d310e 100644
--- a/src/sage/combinat/asymptotics_multivariate_generating_functions.py
+++ b/src/sage/combinat/asymptotics_multivariate_generating_functions.py
@@ -3228,21 +3228,31 @@ class FractionWithFactoredDenominatorRing(
OUTPUT:
- ``True`` if there is a coercion, otherwise ``None`` (or
- ``False``).
+ ``True`` if there is a coercion, otherwise ``False`` or
+ ``None``.
TESTS::
sage: from sage.combinat.asymptotics_multivariate_generating_functions import FractionWithFactoredDenominatorRing
- sage: R.<x,y> = PolynomialRing(QQ)
- sage: FFPD = FractionWithFactoredDenominatorRing(R)
- sage: FFPD.has_coerce_map_from(R)
+ sage: Q = QQ['x,y']
+ sage: FFPD_QQ = FractionWithFactoredDenominatorRing(Q)
+ sage: FFPD_QQ.has_coerce_map_from(Q)
True
- sage: FFPD.has_coerce_map_from(QQ)
+ sage: FFPD_QQ.has_coerce_map_from(QQ)
True
- sage: FFPD.has_coerce_map_from(ZZ)
+ sage: FFPD_QQ.has_coerce_map_from(ZZ)
True
+ sage: Z = ZZ['x,y']
+ sage: FFPD_ZZ = FractionWithFactoredDenominatorRing(Z)
+ sage: FFPD_ZZ.has_coerce_map_from(FFPD_QQ)
+ False
+ sage: FFPD_QQ.has_coerce_map_from(FFPD_ZZ)
+ True
+ sage: FFPD_ZZ.has_coerce_map_from(QQ)
+ False
"""
+ if is_FractionWithFactoredDenominatorRing(P):
+ return self.base().has_coerce_map_from(P.base())
if self.base().has_coerce_map_from(P):
return True