Comment #16 on issue 2308 by smi...@gmail.com: Should we rename primitive()? (and Expr.primitive() should call primitive())
http://code.google.com/p/sympy/issues/detail?id=2308

...oops, rat_gcd can't take the place of as_coeff_Mul, but as_coeff_Mul could first call rat_gcd to get any buried Rational out in front.


btw since tips in an editor may pop up I prefer having methods that start with the most general aspect first: gcd_rat and gcd_terms (though I would prefer gcd_factor) rather than rat_gcd and terms_gcd. If they are near each other the user gets a little education while using the code in seeing similar terms grouped together.

Summary (as I would like to see it)
--------------------------------------
Expr gets .gcd_rat method that does what .primitive does and does so on all Adds of factors of terms and doesn't destroy structure by expanding

primitive function -> renamed gcd_rat and is a wrapper to that method and thus doesn't have the structure-destructive current behavior, e.g. where `primitive((3+6*x)*y) -> (3, y + 2*x*y)` instead of `y*(1 + 2*x)`.

terms_gcd -> renamed gcd_factor

as_coeff_mul -> renamed as_rat_mul
as_coeff_add -> renamed as_rat_add
as_coeff_Mul -> no change


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

Reply via email to