Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Why is sparse * 3D full array allowed?
Date: Fri, 16 Oct 2009 07:18:01 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 12
Message-ID: <hb96n9$5og$1@fred.mathworks.com>
References: <hb948j$28q$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1255677481 5904 172.30.248.37 (16 Oct 2009 07:18:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 16 Oct 2009 07:18:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:577733


"James Tursa" <aclassyguy_with_a_k_not_a_c@hotmail.com> wrote in message <hb948j$28q$1@fred.mathworks.com>...
> I noticed that if a sparse matrix is multiplied by a full nD matrix that can be squeezed to a 2D matrix, the multiplication takes place by doing the squeeze. 

To be more precise, the right (multi-dimensional) array F will be reshaped as
F = reshape(F, size(F,1), []) 
before the product S*F takes place.

The same reshaped is carried out with left product full/sparse. F*S is done as following:

F = reshape(F, size(F,1), [])  * S

Bruno