Behavior of mldivide in Octave relative to Matlab

David Bateman David.Bateman at motorola.com
Tue Apr 8 05:57:59 CDT 2008


I was recently contacted by Marco Caliari in particular concerning the
behavior of the mldivide operator in Octave and Matlab for
underdetermined systems. He pointed out the thread

http://icl.cs.utk.edu/lapack-forum/viewtopic.php?p=497&

where the behavior of the Matlab mldivide operator is analyzed. It seems
that Matlab is not using the LAPACK xGEDLD function like Octave does,
but rather a formulation based on the QR factorization. The formulation
can be written as

m=10; n=20; A = randn(m,n); b=rand(m,1); [Q,R,E]=qr(A);
[A\b E(:,1:m)*(R(:,1:m)\(Q'*b))]

Result returned by this is not the minimum 2-norm solution, like in
Octave but is equally valid. It also appears that the matlab method is
faster and uses less memory. Marco points out that values like m=50 and
n=20000 in the above will result in an exhaustion of the memory of the
machine, whereas Matlab is still capable of returning a result.

Another issue is what is the result that is returned by Matlab and
Octave for singular matrices. Consider a case like

A = [eps, 0, -eps; 0, eps, -eps; -eps, 0, 10]; x = A \ ones(3,1)

Octave falls back to using xGELSD to solve the matrix in this case
whereas as Matlab returns the result based on LU factorization with a
warning of its inaccuracy.

Should we duplicate Matlab's behavior for the two cases above?

Regards
David

-- 
David Bateman                                David.Bateman at motorola.com
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



More information about the Octave-maintainers mailing list