Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Permutation of sparse matrices
Date: Wed, 14 Jan 2009 03:41:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 12
Message-ID: <gkjmse$anf$1@fred.mathworks.com>
References: <19825854.1231902490721.JavaMail.jakarta@nitrogen.mathforum.org>
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 1231904462 10991 172.30.248.35 (14 Jan 2009 03:41:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 14 Jan 2009 03:41:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:511352

John Montgomery <experimentmonty@gmail.com> wrote in message <19825854.1231902490721.JavaMail.jakarta@nitrogen.mathforum.org>...
> ......
> Is there any faster way to change the given matrix in this way that wouldn't require such huge multiplications?  The matrices that I'm using have tens of thousands of rows and columns.  Thanks for the help in advance.
> .....

  You are apparently permuting the rows and columns of your matrix in the same way, though I can't be sure since your examples are all symmetric.  If so, you can do it this way:

 p = [4 3 2 1];
 B = A(p,p);

Roger Stafford