wow, though my flattening and sorting approach is working but this is cool
..
thanks

On Fri, Nov 11, 2011 at 2:47 PM, Chris Smith <[email protected]> wrote:

> ahh, I see. Do you feel like you've got a working solution, then, with
> your flattening approach? Just another recommendation: you might check
> the results with atoms -- if no terms were combined, then the atoms
> should be the same and the expressions should evaluate to be the same:
>
>    >>> x1=Add(x+y,x,evaluate=0)
>    >>> x2=Add(y,x,evaluate=0)
>    >>> x3=x+y+x
>    >>> def eq(x1,x3):
>    ...     return x3.atoms()==x1.atoms() and simplify(x1)==simplify(x3)
>    ...
>    >>> eq(x1,x2)
>    False
>    >>> eq(x1,x3)
>    False
>    >>> eq(x1,Add(x,y,x,evaluate=False))
>    True
>
> --
> 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.

Reply via email to