On Jul 23, 2012, at 2:20 AM, Sergiu Ivanov <[email protected]> wrote:
> On Sun, Jul 22, 2012 at 11:44 PM, Aaron Meurer <[email protected]> wrote: >> On Jul 10, 2012, at 9:39 AM, Sergiu Ivanov <[email protected]> >> wrote: >> >>> On Tue, Jul 10, 2012 at 6:10 PM, Chris Smith <[email protected]> wrote: >>>> >>>> Other than printing, what are these situations? Perhaps there is a >>>> non-sorting way to solve the problem. >>> >>> Aside from setting up the sort key, it is about getting the complement >>> of a FiniteSet of reals. >> >> Can you be more specific? Most likely, one of the results is "better" >> than the other, and the algorithm should be fixed to always give it >> regardless of ordering. > > FiniteSet._complement works as follows: > >>>> from sympy import FiniteSet >>>> FiniteSet(1, 2, 3).complement > (-oo, 1) U (1, 2) U (2, 3) U (3, oo) > > I'm not sure this result can be achieved more efficiently by a > different approach then sorting the elements. This is the exact same as FiniteSet itself. Union's args do not need to be sorted except within the printer. Aaron Meurer > > (Note that I have admitted that this seems to be a rather restricted > special case.) > > Sergiu > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/sympy?hl=en. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
