On Sat, Oct 23, 2010 at 3:33 AM, Chris Smith <[email protected]> wrote:
> Chenjie Gu wrote: > >>> Yes to both. I wrote up my notes when trying to understand what was > >>> going on here in Issue 1601: > >>> > >>> http://code.google.com/p/sympy/issues/detail?id=1601 > >>> > >>> Chris, > >> > >> I just went through the above link. > >> In any case, I think what you described is a "deterministic" > >> algorithm, > >> right? > >> What I feel confused is that it gives "random" results in different > >> runs. (on the same machine) > >> Would you explain why that's the case? > >> > > If you show some code showing that result perhaps that would help. > Otherwise, I can't imagine why equivalent expressions would give different > result. But note: the ordering of the args matters, so if variable names or > any other such thing change the ordering of terms then that will change the > match behavior IIRC. > > One example is the script in the first post: x0 = Symbol('x0') x1 = Symbol('x1') p = Wild('p', exclude=[0]) q = Wild('q', exclude=[0]) r = Wild('r') y = exp(40*x0) - exp(-40*x1 + 40*x0) print y.match(p*q+r) I ran exactly the same script for multiple times, but different results were obtained for different runs. Chenjie > -- > 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] <sympy%[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.
