bugGNU Octave - Bugs: bug #37336, Incorrect result of rcond with...

 
 

bug #37336: Incorrect result of rcond with Netlib LAPACK

Submitter:  Sébastien Villemot <svillemot>
Submitted:  Wed 12 Sep 2012 04:19:10 PM UTC
 
Category:  Libraries Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.6.2 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment (Rich Markup)
   

( Jump to the original submission )

Fri 14 Sep 2012 10:06:36 AM UTC, comment #6: 

I confirm that this change fixes the issue. Thanks for the prompt reaction.

I am going to upload Octave 3.6.3 with this patch applied to Debian experimental.

Sébastien Villemot <svillemot>
Thu 13 Sep 2012 07:22:28 PM UTC, comment #5: 

I checked in the following change:

http://hg.savannah.gnu.org/hgweb/octave/rev/197774b411ec

Could you please verify that this fixes the problem?

I patched on stable, so this fix will appear in 3.6.4.

John W. Eaton <jwe>
Group administrator
Thu 13 Sep 2012 04:10:42 PM UTC, comment #4: 

Thanks, I can duplicate the error.  I'll take a look to see what I can find about what is causing the difference.

John W. Eaton <jwe>
Group administrator
Thu 13 Sep 2012 01:12:04 PM UTC, comment #3: 


> sudo update-alternatives --display liblapack.so.3


Btw, just because I like to kill unnecessary usages of sudo, this command does not require it. The --config one does.

Jordi Gutiérrez Hermoso <jordigh>
Group administrator
Thu 13 Sep 2012 08:12:27 AM UTC, comment #2: 

Sorry for the missing pieces of information.

By Netlib LAPACK I mean the reference implementation of LAPACK, distributed on www.netlib.org.

By Atlas LAPACK I mean the version created by Atlas: many of its routines directly come from Netlib LAPACK, but some are replaced by optimized versions.

For Netlib LAPACK, I use version 3.4.1 (from Debian wheezy/sid amd64, package liblapack-dev/liblapack3 version 3.4.1-6).

For Atlas LAPACK I use version 3.4.8 (from Debian wheezy/sid amd64, package libatlas3-base version 3.8.4-9).

Note that in Debian we recently switched the default LAPACK flavour: the default used to be Atlas LAPACK, but we recently switched (in atlas 3.8.4-8) to Netlib LAPACK (for reasons which are off-topic here). If you are using Debian wheezy/sid (as I think you do), you can check your current LAPACK flavour with:

 sudo update-alternatives --display liblapack.so.3

and change it with:

 sudo update-alternatives --config liblapack.so.3

Finally, please find attached the C program which directly does the calculation using LAPACK. You need to link it against libmatio (available in package libmatio-dev), with something like:

 gcc rcond-test.c -o rcond-test -lmatio -llapack

The program expects burp.mat in the current directory.


(file #26545)

Sébastien Villemot <svillemot>
Wed 12 Sep 2012 04:29:22 PM UTC, comment #1: 

What is "Netlib LAPACK"?  What version?  How was it compiled?  What architecture?

Can you post the C program that you wrote to do the calculation?

John W. Eaton <jwe>
Group administrator
Wed 12 Sep 2012 04:19:10 PM UTC, original submission:  

I attach a MAT-file containing a 2x2 matrix (Finf), whose rcond is different depending on the flavor of LAPACK that I use.

With Netlib LAPACK:

 octave:2> rcond(Finf)
 ans =  0.40463

With Atlas' LAPACK:

 octave:2> rcond(Finf)
 ans = 0

MATLAB gives 5.5511e-17.

Since the matrix is quasi-singular, the right answer is (almost) zero. A value of 0.4 is plain wrong.

I cannot determine if this is a bug in Netlib LAPACK or Octave. I wrote a C program reading the matrix with libmatio then calling dgetrf+dgecon and I get the right result with both versions of LAPACK, so this points towards a bug in Octave, but I am still unsure.

Sébastien Villemot <svillemot>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #26545:  rcond-test.c added by svillemot (1KiB - text/x-csrc)
file #26542:  burp.mat added by svillemot (216B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by svillemot (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only project members can vote.

     

     

     

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-09-14 jwe StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2012-09-13 jwe StatusNone Ready For Test
    2012-09-13 svillemot Attached File- Added rcond-test.c, #26545
    2012-09-12 svillemot Attached File- Added burp.mat, #26542

    Back to the top

    Powered by Savane 3.12