What's that `thp` loop doing? Does your julia loop do 50x the work of the matlab code?
--Tim On Monday, January 26, 2015 05:10:47 AM Yuuki Soho wrote: > 1. That's my matlab code, I was hoping to be able to write it with loops > in Julia, because sometimes these vectorize operations can become > a real headache, but it's maybe hopeless to try to beat these highly > optimized libraries. > > > function alpha = testSum(A,B,C,D,E,idx) > alpha = zeros(100,1); > for t=1:100 > tmp = squeeze( sum( bsxfun(@times,A,B(:,t)), 1) ); > tmp = sum( bsxfun(@times,tmp,C(:,t)), 1); > tmp = tmp * D(:,t); > > alpha(t) = tmp * E(t,idx(t)); > end > end
