This is exactly the same thing that I mentioned before. Iterating through a set has absolutely no guaranteed order, even if you do it two times with the same set in the same session. This is not even the same as something producing different results on different machines; that sort of thing is easily solved by testing one of two results. For one thing, in this case, it can be more than two possible results. For example, if you iterate through set([x, y, z]), it could happen in one of six possible ways.
People have been advocating the use of sets for a lot of things lately, but I think that we have to remember that this can happen with them. Even though these things are technically mathematically unordered, it's important for an algorithm for things to be in a deterministic order, even if that order itself doesn't matter. So I think we would really be better of using lists for these computations, with some canonical ordering (which can be any arbitrary thing), at least in the intermediate computations (returning a set is another story, I guess). Aaron Meurer On Nov 12, 2010, at 6:41 PM, smichr wrote: > OK, I see in solve_linear that sometimes the set from which symbols > are picked is in order x, y and other times y, x. And one of those > fails and the other doesn't. So I think this means it's a hashing > issue that directs the branches traversed. Now I have to figure out > why it fails on the one branch direction and not the other. Will post > as I know. > > -- > 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.
