On Wed, Mar 25, 2015 at 1:21 PM, Francesco Bonazzi <[email protected]> wrote: > > > On Wednesday, March 25, 2015 at 5:29:18 PM UTC+1, Aaron Meurer wrote: >> >> Wow, I didn't know integrate supported Intervals. > > > I had a look at the code, I think that behaviour is unintended. > > The point is, the stats module apparently calls integrate with intervals to > determine probabilities. > >> If we are going to >> support sets, we might as well support all of them (at least >> unevaluated). A union of intervals is easy if the values are >> computable (i.e., if you can determine if the union is disjoint). >> Otherwise, it's complicated. Integrate(1, (x, Union(Interval(a, b), >> Interval(c, d)))) depends on the relative order of a, b, c, and d. >> Even the current integrate(1, (x, Interval(a, b))) is wrong if b > a. > > > I guess that if the relative order cannot be determined, the integral should > remain unevaluated. > > Is is worth if I try to create a PR to accept unions of intervals?
If the code is really unintended I suppose we should first sort out if we really want to do this, and with this syntax. But otherwise, +1 for a PR fixing these issues. Aaron Meurer > > -- > 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/361c5845-693a-4e5a-910b-b2abba807e48%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/CAKgW%3D6LdGVxV1HLyEJU7KWRH9Z%2BB-YftN2tpmR7q0pPaFq8OhQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
