OK Aaron -- thanks for your reply. I'll see if I can generate a patch... On Monday, March 9, 2015 at 8:03:11 PM UTC-4, Aaron Meurer wrote: > > It's probably an unimplemented feature. There are a lot of things that > piecewise_fold can't handle which it could. > > Aaron Meurer > > On Mon, Mar 9, 2015 at 8:45 AM, <[email protected] <javascript:>> > wrote: > > Hello, > > > > From the sympy master, I have tried to simplify a piecewise expression > which > > contains piecewise arguments: > > > > from sympy import Piecewise, Eq, piecewise_fold > > from sympy.abc import x, y > > > > p = Piecewise((Piecewise((5, Eq(y, 0)), (2, True)), Eq(x, 0)), > > (Piecewise((1, Eq(y, 0)), (6, True)), True)) > > print(piecewise_fold(p)) > > > > I would expect that the result has only one "Piecewise" in it, something > > like: > > > > Piecewise((5, And(Eq(y, 0), Eq(x,0))), (2, And(True, Eq(x, 0))), (1, > > And(Eq(y, 0), True)), (6, And(True, True))) # Expected result. > > > > or, if simplified, > > > > Piecewise((5, And(Eq(y, 0), Eq(x,0))), (2, Eq(x, 0)), (1, Eq(y, 0)), (6, > > True)) # Expected result. > > > > But instead, the different piecewise subexpressions are not folded > together. > > Is this a bug, an unimplemented feature, or have I misunderstood the > purpose > > of piecewise_fold? > > > > Thanks, > > Clayton > > > > PS. This testcase arose from a multiple integration which was not fully > > simplified -- so although it looks artificial, something equivalent did > > arise in actual usage. > > > > -- > > You received this message because you are subscribed to the Google > Groups > > "sympy" group. > > To unsubscribe from this group and stop receiving emails from it, send > an > > email to [email protected] <javascript:>. > > To post to this group, send email to [email protected] > <javascript:>. > > Visit this group at http://groups.google.com/group/sympy. > > To view this discussion on the web visit > > > https://groups.google.com/d/msgid/sympy/b98bbb19-b770-49e9-8674-cd394d3447a7%40googlegroups.com. > > > > For more options, visit https://groups.google.com/d/optout. >
-- You received this message because you are subscribed to the Google Groups "sympy" 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/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/852e6972-33b6-47c4-8f7f-db2e45372b99%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
