Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: factorize singular symmetric matrix
Date: Tue, 29 Sep 2009 18:28:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 18
Message-ID: <h9tjjh$82h$1@fred.mathworks.com>
References: <h9sqsb$7gk$1@fred.mathworks.com> <h9t8h8$3tp$1@fred.mathworks.com> <h9t9bf$o6b$1@fred.mathworks.com> <h9tabe$2e$1@fred.mathworks.com> <h9tb0k$68o$1@fred.mathworks.com> <h9tbqo$q6v$1@fred.mathworks.com> <h9tgq4$2aa$1@fred.mathworks.com> <h9thjr$onk$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1254248881 8273 172.30.248.38 (29 Sep 2009 18:28:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 29 Sep 2009 18:28:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1979926
Xref: news.mathworks.com comp.soft-sys.matlab:573762


at last, I think I've found a way to get with chol() the same reliability of the rank() function (seems faster, tested with the script at http://tinyurl.com/yevnhmk ):

tol=eps*norm(A)*numel(A);
[L,ignored]=chol(A+tol*eye(M));
rk=sum(abs(diag(L))>sqrt(sqrt(tol)));

in order to get the orthogonal basis, though, I wanted to use the Gram-Schmidt algorithm; now, when the matrix is not block-diagonal, the algorithm results indeed faster than a QR; it turns out that when the matrix is block-diagonal the loop is slower than using the more straightforward QR factorization. In order to get a faster algorithm, a fast way to test for block-diagonality is needed; then it should be trivial to get a faster algorithm.

Stefano 

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <h9thjr$onk$1@fred.mathworks.com>...
> "Stefano " <s.mangione@gmail.com> wrote in message <h9tgq4$2aa$1@fred.mathworks.com>...
> > shame on me, I don't know how to get a good estimate of the rank :(
> > 
> 
> Don't be ashamed, the problem is harder than it seems to be (at least for me).
> 
> Bruno