octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Improved normest


From: David Bateman
Subject: Re: Improved normest
Date: Sat, 28 Nov 2009 11:04:48 +0100
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706)

Jaroslav Hajek wrote:
I see, thanks. I randomized the guess again. My problem with the previous
code was that a priori forming A'*A is quite costly, especially if you want
just low precision and expect just a dozen iterations:

A = rand (1e3);
tic; [e,c] = normest (A); toc
tic; [e,c] = normest (A, 1e-1); toc

now:

Elapsed time is 0.0229969 seconds.
Elapsed time is 0.0183249 seconds.

previously:

Elapsed time is 0.220653 seconds.
Elapsed time is 0.210241 seconds.
Explicitly forming A'*A seemed the right thing to do for full matrices as it only needed to be done once. I suppose it only makes sense to do so in the case of difficult convergence.. In that case a similar issue probably exists in the code bicgstab where is two preconditioning matrices are given then

precon = @(x) M2 \ (M1 \ x);

if M1 and M2 are sparse or

M = M1 \ M2;
precon @(x) M \ x;

otherwise. Though bicgstab usually has many more iterations than a simple power method as in normest, so perhaps the existing code is the right ting to do..

D.

--
David Bateman                                address@hidden
35 rue Gambetta                              +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE            +33 6 72 01 06 33 (Mob)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]