help-octave
[Top][All Lists]
Advanced

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

Re: Using LAPACK in octave


From: David Bateman
Subject: Re: Using LAPACK in octave
Date: Tue, 11 Sep 2007 21:30:40 +0200
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

Quentin Spencer wrote:
> Jean-Baptiste Poullet wrote:
> 
>> I would like to use LAPACK functions (in particular "sgelsy.f" which
>> Computes the minimum norm least squares solution to an over- or
>> under-determined system of linear equations A X=B, using a complete
>> orthogonal factorization of A) in octave. Do I need to generate a .mex
>> or .oct file from the FORTRAN file "sgelsy.f" or is there any more
>> efficient alternative way? 
>>  
>>
> 
> I can't say for sure that it uses the specific LAPACK routine you're 
> talking about, but I think the "left divide" operator does what you 
> want: X=A\B;
> 

Octave ldivide operator uses dgelss in this case and not dgelsy. dgelss
as been in lapack since v1.0, whereas as dgelsy was introduced in v3.0
of lapack, which probably explains the choice.. dgelsy uses QR with
pivoting and is faster than dgelss that uses an SVD to get the solution.

Matlab uses the function dgeqp3 that was introduced before dgelsy but
does the same thing, but needs dormqr as well to multiple by the
householder matrix.

I've often felt that Octave should change to use the same solver as
Matlab, especially now as the sparse matrices in Octave use a QR solver
with pivoting and don't give exactly the same results as the dense solvers..

D.





> Quentin



reply via email to

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