Matt J
Posts:
4,976
Registered:
11/28/09
|
|
Re: Efficiently computing large numbers of vector norms
Posted:
Nov 13, 2012 11:28 AM
|
|
"Harry Commin" wrote in message <k7rpsl$ohp$1@newscl01ah.mathworks.com>... > Sorry, please disregard my last post. I repeated for 1000 iterations instead of 1 and I now get: > > My original loop: 29.3665 secs > Loop-less kron(): 25.209 secs > Loop-less KronProd(): 20.8823 secs > > This looks like a saving of around a third, which could measure in days for me. I guess things settle down after the first iteration(?) ===========
Yes, things settle down after the first iteration. I would have expected a lot more speed-up, though. It would be interesting to know the data dimensions you're working with.
Note also that if A1 and A2 are fixed and X2 is changing in a loop, you should compute K=KronProd({A2',A1'}) only once prior to your loop and reuse it. The same goes for kron(A1.',A2.'), although I still expect KronProd to be faster.
|
|