Comment #9 on issue 2283 by matt...@gmail.com: Non-iterative 'in'
http://code.google.com/p/sympy/issues/detail?id=2283

find(cls) gives all subexpressions that are instances of `cls`, e.g.:

In [1]: var('A,B,C', commutative=False)
Out[1]: (A, B, C)

In [2]: f = x*gamma(x)*sin(x)*exp(x*y)*A*B*C*cot(x*A*B)

In [3]: f.find(Mul)
Out[3]:
   ⎛               x⋅y                             ⎞
set⎝x⋅y, x⋅A⋅B, x⋅ℯ   ⋅Γ(x)⋅sin(x)⋅A⋅B⋅C⋅cot(x⋅A⋅B)⎠

Has this code (contains and ncsplit) been put in any of the commits of polys12?

No, this was invented an hour ago, but requires polys12 because of find(). I will need to polish this code a little bit (e.g. ncsplit() should be implemented an instance method in selected classes) and I will submit a pull request.

If you want to play with this code before this, pull from p12-final branch from https://github.com/mattpap/sympy to obtain implementation of find().

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to