Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: divide and conquer matrix
Date: Fri, 19 Jun 2009 00:59:02 +0000 (UTC)
Organization: 'SpiruHaret' University, Bucharest
Lines: 40
Message-ID: <h1ensm$i4u$1@fred.mathworks.com>
References: <h1e92a$bd7$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1245373142 18590 172.30.248.35 (19 Jun 2009 00:59:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 19 Jun 2009 00:59:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 872427
Xref: news.mathworks.com comp.soft-sys.matlab:548802


-use powers of two as much as possible;
-see blkproc (caution with implicit padding);
-if the matrix is huge, consider mex using;
-column is the "fast dimension"; this could be helpful;

Bodorin

"Diego Lass" <dlISCool@gmail.com> wrote in message <h1e92a$bd7$1@fred.mathworks.com>...
> Hi 
> I have a problem with a large matrix, what I want to do is to divide the matrix into 4 submatrices, do some operation then reassemble the submatrix together.  A toy example
> 
> A = [1 2 3 ; 3 4 5 ; 2 3 4; 5 1 2 ]
> A =
> 
>      1     2     3
>      3     4     5
>      2     3     4
>      5     1     2
>  I want to divide A into ANY approximately equal sized partitions, for example
> 1 2 
> 3 4 
> 
> 3
> 5
> 
> 2 3 
> 5 1 
> 
> 4
> 2
> 
> then do some operation, say add 2 to each element.  Then reassemble them together, to get
> 
>      3     4     5
>      5     6     7
>      4     5     6
>      7     3     4
> What is the most efficient way of doing this?
> Thanks
> Diego