Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Sparse matrix indexing speed -- shape sensitivity
Date: Sun, 28 Aug 2011 17:20:28 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 16
Message-ID: <j3dtcs$rjq$1@newscl01ah.mathworks.com>
References: <j3bumn$9ts$1@newscl01ah.mathworks.com> <j3cqer$o66$1@newscl01ah.mathworks.com> <j3df6i$jnq$1@newscl01ah.mathworks.com> <j3dftj$lkh$1@newscl01ah.mathworks.com> <j3dk7r$3mp$1@newscl01ah.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: www-04-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1314552028 28282 172.30.248.35 (28 Aug 2011 17:20:28 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 28 Aug 2011 17:20:28 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:741499

"Matt J" wrote in message <j3dk7r$3mp$1@newscl01ah.mathworks.com>...
> 
> 
> In fact, if the modified setsparse/getsparse could accept N-dimensional indices that would be even better. Currently, I have to convert the first N-1 subscripts to linear indices, which is quite time/memory consuming.

I don't know Matt. 

1) SETSPARSE/GETSPARSE is designed for regular 2D array, it knows nothing about N-dimensional indexing of ndSparse, it shouldn't has any implementation in this way.

2) As I understand they way ndSparse combine the n-1 index to 1 linear index is a limitation. Are you able to store an ndSparse of dimension [1e6 1e6 1e6 10] (even an empty one)?

It looks to me a more serious implementation and n-dimensional sparse array should have its own real management of indexing using n-subscribed vector to avoid any overflow indexing. And to make it fast, probably a specific C-engine is needed.

Undertake such implementation is quite a big task. I'm not sure how large is the number of people who are truly interested in nd-sparse array and who intend to do any serious work with it. Can it justify the work for volunteer people like you and me?

Bruno