Changes between Version 8 and Version 11 of Ticket #11225

Jun 25, 2016, 6:33:21 PM (6 years ago)
Matthias Köppe

Updated description for new piecewise (#14801). Didn't check the xmin/xmax etc. behavior that is mentioned in the description.

This can probably be closed when the old Piecewise (now deprecated) is removed completely.


  • Ticket #11225

    • Property Cc Robert Pollak Karl-Dieter Crisman Volker Braun Samuel Lelièvre Matthias Köppe Eviatar Bach Ralf Stephan added
    • Property Keywords piecewise added
    • Property Dependencies changed from to #14801
  • Ticket #11225 – Description

    v8 v11  
    1 Until we actually totally rewrite piecewise functions, we should improve some things.
     1Until we actually totally rewrite piecewise functions (done in #14801), we should improve some things.
    33For concreteness, here is one thing that should work but doesn't. I'm sure there are more - add to this list, and then whatever isn't fixed in this ticket can be moved to another ticket.  I just want to make sure they're listed in one place, not ten tickets.
    1616AttributeError: PiecewisePolynomial instance has no attribute '__float__'
     19  Both examples work in the new `piecewise` (#14801):
     21sage: f = piecewise([[(0,1),x^3], [(1,2),x^2]], var=x)
     22sage: plot([f,x^3],(x,0,2))
     25sage: f = piecewise([[(-2,1),1],[(1,4),x]])
     26sage: g =  piecewise([[(-2,1),1],[(1,4),2*x]])
     27sage: plot([f,g], xmin=-3, xmax=5)
    1830 * plotting a product of a piecewise with a symbolic (well, the problem is multiplying the two, but still worth putting here - see [ this sage-support thread])
     32  fixed in new `piecewise`
    1934 * Maybe unify with `plot_step_function`, which currently is sort of its own thing?
    2035 * In this example:
    3449   * You can try plot(g), but that turns out to uncover a very strange error that may or may not be a bug.
     51  In new `piecewise` (#14801) 0 is no longer in the domain (open intervals?); and there is now support for unbounded intervals.
     53sage: zero_func(x)=0
     54sage: g = piecewise([[(-1000,1),zero_func],[(1,1000),(x-1)^3]])
     55sage: G = g.plot()
     57Launched png viewer for Graphics object consisting of 1 graphics primitive
     58sage: g(1)
     59ValueError: point 1 is not in the domain
    3662See also #1773.