Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Sparse matrix indexing speed -- shape sensitivity
Date: Mon, 29 Aug 2011 14:56:09 +0000 (UTC)
Organization: Boeing Co
Lines: 15
Message-ID: <j3g9a9$rf1$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> <j3dtcs$rjq$1@newscl01ah.mathworks.com> <j3efp3$h5h$1@newscl01ah.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: www-00-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1314629769 28129 172.30.248.45 (29 Aug 2011 14:56:09 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 29 Aug 2011 14:56:09 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 756104
Xref: news.mathworks.com comp.soft-sys.matlab:741594

"Matt J" wrote in message <j3efp3$h5h$1@newscl01ah.mathworks.com>...
> 
> MATLAB already has limitations similar to this presently on its 2D sparse matrices which user's must work around. Why should it be that this all-zero matrix stores perfectly fine
> 
>  A=sparse(1e8,1);
> 
> but not its transpose,
> 
> >> A.';
> ??? Error using ==> transpose
> Out of memory. Type HELP MEMORY for your options.

Because for every sparse matrix, even an empty one, MATLAB allocates memory to hold an index array the size of (number of columns + 1). There will be a bunch of 0's in this index array for an empty matrix, but the memory still gets allocated.

James Tursa