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$>
References: <j3bumn$9ts$> <j3cqer$o66$> <j3df6i$jnq$> <j3dftj$lkh$> <j3dk7r$3mp$>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1314552028 28282 (28 Aug 2011 17:20:28 GMT)
NNTP-Posting-Date: Sun, 28 Aug 2011 17:20:28 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: comp.soft-sys.matlab:741499

"Matt J" wrote in message <j3dk7r$3mp$>...
> 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?