Linear Algebra issues
In this page, we gather some linear algebra computations which are know to fail in Scilab. These are not proper bugs, neither for Scilab, nor for Lapack: these are limitations of the algorithm used by Lapack to perform the computation. In other words, most of these issues are more or less open research problems. This page is an echo to the page by Julien Langou "Lapack known issues":
http://www-math.ucdenver.edu/~langou/lapack-3.2/lapack_known_issues.html
We focus on difficult numerical computations and do not pretend to check the linear algebra functions as a software (this is the purpose of the unit tests in Scilab).
These tests may serve as simple computations to make Lapack crash on purpose. There are several settings which may affect the results of the following computations :
- debug/release compilation option,
- Ref-BLAS, Ref-LAPACK, ATLAS or Intel MKL libraries.
Eigenvalue problems
Here are several pencils where LAPACK fails.
A1 = [ 0 0 1 ; 0 1 0 ; 1 0 0]; B1 = [ 2 0 0 ; 0 0 1 ; 0 1 0]; spec(A1,B1)
The result in Scilab 5.3.0-beta-2 (ref-blas, ref-lapack).
-->spec(A1,B1) Warning : Non convergence in the QZ algorithm. The top 3 x 26142804 blocks may not be in generalized Schur form. ans = Nan + Nan Nan + Nan Inf + Nan
"Pencil (A1,B1) has been sent to us by Zbigniew Leyk, Senior Lecturer,Department of Computer Science, Texas A & M University on Jan 30 2007."
See: http://icl.cs.utk.edu/lapack-forum/viewtopic.php?t=317
A2 = [ 0 0 0 1 ; 1 0 0 0 ; 0 1 0 0 ; 0 0 1 0]; B2 = [ 1 0 0 0 ; 0 1 0 0 ; 0 0 1 0 ; 0 0 0 1]; spec(A2,B2)
The result in Scilab 5.3.0-beta-2 (ref-blas, ref-lapack).
-->spec(A2,B2) Warning : Non convergence in the QZ algorithm. The top 4 x 26142804 blocks may not be in generalized Schur form. ans = Infi Infi 6.36D-314 + i 2.12D-314
"Pencil (A2,B2) has been sent to us by Daniel Kressner in 2005 who quote VasileSima. "
A3 = [ 1 1 0; 0 0 -1; 1 0 0]; B3 = [-1 0 -1; 0 -1 0;-1 0 -1]; spec(A3,B3)
The result in Scilab 5.3.0-beta-2 (ref-blas, ref-lapack).
-->spec(A3,B3) ans = - 1. - Inf + Nan - Inf + Nan
"Pencil (A3,B3) has been sent to us by Patrick Alken from University ofColorado at Boulder on Apr 24 2007. "
See: http://icl.cs.utk.edu/lapack-forum/viewtopic.php?t=382
A4 = [ 1 1e-9 0; 1e-9 1 0; 0 0 1]; B4 = [ 1 0 0; 0 1 0; 0 0 1]; spec(A4,B4) spec(A4+0*%i,B4+0*%i)
The result in Scilab 5.3.0-beta-2 (ref-blas, ref-lapack).
-->spec(A4,B4) ans = 1. 1. 1. -->spec(A4+0*%i,B4+0*%i) ans = 1. 1. 1.
By contrast, here was the result in Scilab 4.1.2:
-->spec(A4,B4) ans = 1. 1. 1. -->spec(A4+0*%i,B4+0*%i) Warning: Non convergence in the QZ algorithm. The top 2 x 2 blocks may not be in generalized Schur form. ans = Inf -Infi Inf -Infi 1.
"Pencil (A4,B4) has been sent to us by Michael Baudin from the Scilab project on Tu Oct 28th 2008. This one pencil make ZGGEV fail. DGGEV handles it correctly."
http://bugzilla.scilab.org/show_bug.cgi?id=3652
The reason behind this change of behavior is the introduction of a modification in Scilab v5. If the matrix is made of complex values, but the imaginary part is zero, then the real routine of Lapack is used (and not the complex one). This makes the test pass.