#14801: Piecewise functions done right
-------------------------------------+-------------------------------------
Reporter: vbraun | Owner: burcin
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.2
Component: symbolics | Resolution:
Keywords: | Merged in:
Authors: Volker Braun, | Reviewers:
Ralf Stephan | Work issues:
Report Upstream: N/A | Commit:
Branch: public/piecewise- | 852ba6f43b97dc143de2a3ec183d6770dfd885bc
alt | Stopgaps:
Dependencies: #14800, #14780, |
#9556, #13125, #14802 |
-------------------------------------+-------------------------------------
Changes (by rws):
* status: new => needs_review
Comment:
Now on to the remaining two errors. This code throws:
{{{
sage: f = piecewise_real([((-1,1), x)]); f; g = f.extension(0); g; g(3)
}}}
It works however if I patch `rings/real_lazy.pyx`:
{{{
diff --git a/src/sage/sets/real_set.py b/src/sage/sets/real_set.py
index adc41d3..1d43cc4 100644
--- a/src/sage/sets/real_set.py
+++ b/src/sage/sets/real_set.py
@@ -582,8 +582,8 @@ class RealInterval(UniqueRepresentation, Parent):
sage: i.contains(2)
True
"""
- cmp_lower = cmp(self._lower, x)
- cmp_upper = cmp(x, self._upper)
+ cmp_lower = cmp(self._lower._value, x)
+ cmp_upper = cmp(x, self._upper._value)
if cmp_lower == cmp_upper == -1:
return True
if cmp_lower == 0:
}}}
So, as this fixes it and passes tests, I'm committing and proposing this
branch for review.
----
New commits:
||[http://git.sagemath.org/sage.git/commit/?id=57e825421ef2fdd12d328e4c92a193db056e6e48
57e8254]||{{{fixes; remove crap}}}||
||[http://git.sagemath.org/sage.git/commit/?id=852ba6f43b97dc143de2a3ec183d6770dfd885bc
852ba6f]||{{{fix doctest; remove crap}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/14801#comment:14>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.