[SciPy-User] How to efficiently do dot(dot( A.T, diag(d) ), A ) ?

Hugh Perkins hughperkins@gmail....
Mon Sep 10 11:34:18 CDT 2012


> > How to do efficiently do dot(dot( A.T, diag(d) ), A ) ?
>
> dot( A.T * d , A )

This is very good!

Still, the second multiplication looks like it is doing a full
brute-force matrix multiplication:

>>> tic(); d = c.T * a; toc()
Elapsed time: 0.00560903549194
>>> tic(); e = dot( d, c ); toc()
Elapsed time: 0.110434055328


More information about the SciPy-User mailing list