[SciPy-User] Matrix by matrix vs. matrix by vector multiplications are not the same

Alexander Kalinin alec.kalinin at gmail.com
Mon May 6 03:01:02 EDT 2013


Thank you for explanation.

Alexander.


On Sun, May 5, 2013 at 4:00 PM, Pauli Virtanen <pav at iki.fi> wrote:

> 05.05.2013 14:18, Alexander Kalinin kirjoitti:
> [clip]
> > For me it is little bit strange that the results are not the same. Does
> > it mean that  matrix by matrix and matrix by vector multiplications
> > algorithms are different?
>
> Correct, they are different. BLAS libraries typically try to optimize
> for speed and the most appropriate algorithms for each case are
> different. The speed increase gained by this can be quite significant.
>
> The underlying issue is that in floating point, addition and
> multiplication are not associative operations, so that mathematically
> equivalent algorithms may produce somewhat different results due to
> different accumulation of rounding error.
>
> --
> Pauli Virtanen
>
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20130506/a48c2708/attachment.html>


More information about the SciPy-User mailing list