On 29 Mai, 21:28, SherjilOzair <sherjiloz...@gmail.com> wrote:
> Backend-agnostic is one of my major goals too. One of its cons is that
> being unaware of the type can sometimes lead to lack of performance.
> I don't know if I mentioned this before, but I faced a dilemma with
> sum and Add.
> Add is faster but only works for Sympy objects. sum is general but
> slower.
>
> This maybe the wrong thread to say this, but maybe sum could be
> modified to use Add more smartly when the objects are all Sympy
> objects. Views ?

You can't modify sum(), because it is a Python built-in. It will
always have

a + b + c == a.__add__(b).__add_(c)


You could use Domain.sum, which would be implemented by Domain in
order to do it the most efficient way. So Matrix would only need to
worry about passing all relevant non-zeros.

Vinzent

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

Reply via email to