help-octave
[Top][All Lists]
Advanced

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

Re: underdetermined


From: David Bateman
Subject: Re: underdetermined
Date: Thu, 01 Jul 2010 21:40:50 +0200
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706)

Jordi Gutiérrez Hermoso wrote:
O010/7/1 Jaana Tommiska <address@hidden>:
If Ax=b is underdetermined, does A\b calculate minimum 2-norm solution ?

Yes. Look here for where the division operators are defined:

     http://hg.savannah.gnu.org/hgweb/octave/file/14af8004945d/src/xdiv.cc#l343

The solve functions that do all the work are declared here:

     
http://hg.savannah.gnu.org/hgweb/octave/file/14af8004945d/liboctave/dMatrix.h#l179

If you go look at the definition of solve, you see that it first
checks for some basic matrix types, and if it's singular or
rectangular, it calls lssolve (least squares solve):

     
http://hg.savannah.gnu.org/hgweb/octave/file/14af8004945d/liboctave/dMatrix.cc#l1928

The definition of which is here, further down that file:

     
http://hg.savannah.gnu.org/hgweb/octave/file/14af8004945d/liboctave/dMatrix.cc#l2227

where you can see that it finally calls the Fortran functions DGELSD
(lines 2272 and 2279).

Finally, if you consult a BLAS/LAPACK reference, because Octave no
longer ships versions of those libraries with itself, you'll find:

     http://www.netlib.org/lapack/double/dgelsd.f

So that's your answer. That's the function that it eventually calls in
the situation you describe, and you can look at the code above to see
exactly how and with what parameters it calls it.
Wow thats a lot of code to read to get the answer. You might also read the

http://octave.1599824.n4.nabble.com/Behavior-of-mldivide-in-Octave-relative-to-Matlab-td1650373.html

that explains the differences between Octave and Matlab in this respect and why Octave is better ;-)

D.



reply via email to

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