From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: speeding up ACCUMARRAY
Date: Wed, 14 Nov 2012 19:52:13 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 12
Message-ID: <k80spd$ra8$>
References: <k7u1ju$1e7$> <k7u3e4$8ml$> <k7ulhl$iod$> <k7vfli$da4$> <k80bi9$isp$> <k80l22$qd5$>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1352922733 27976 (14 Nov 2012 19:52:13 GMT)
NNTP-Posting-Date: Wed, 14 Nov 2012 19:52:13 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: comp.soft-sys.matlab:782796

"Matt J" wrote in message <k80l22$qd5$>...

> Anyway, my point remains. Sparse matrix multiplication has to perform multiplications with the x(j) somewhere, whereas accumarray, in my tests, does not. So sparse mult. is further handicapped.

1) Sparse internally access memory via integer indexing. Your accumarray has to cast doubles (firs input) to integers.

2) Sparse multiplication engine might benefice multi-threading, and other low-level optimization.

Accumarray is not slow. Just sparse is fast.