Path: news.mathworks.com!not-for-mail
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$1@newscl01ah.mathworks.com>
References: <k7u1ju$1e7$1@newscl01ah.mathworks.com> <k7u3e4$8ml$1@newscl01ah.mathworks.com> <k7ulhl$iod$1@newscl01ah.mathworks.com> <k7vfli$da4$1@newscl01ah.mathworks.com> <k80bi9$isp$1@newscl01ah.mathworks.com> <k80l22$qd5$1@newscl01ah.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: www-06-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1352922733 27976 172.30.248.38 (14 Nov 2012 19:52:13 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 14 Nov 2012 19:52:13 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:782796

"Matt J" wrote in message <k80l22$qd5$1@newscl01ah.mathworks.com>...

> 
> 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.

Bruno