[Scipy-tickets] [SciPy] #1458: lu_factor gives different results, depending on whether the input is C or Fortran contiguous (also affects lu_solve)

SciPy Trac scipy-tickets@scipy....
Thu Jun 9 17:19:39 CDT 2011


#1458: lu_factor gives different results, depending on whether the input is C or
Fortran contiguous (also affects lu_solve)
--------------------------+-------------------------------------------------
 Reporter:  mike.wimmer   |       Owner:  somebody
     Type:  defect        |      Status:  new     
 Priority:  normal        |   Milestone:          
Component:  scipy.linalg  |     Version:  0.9.0   
 Keywords:                |  
--------------------------+-------------------------------------------------

Comment(by mike.wimmer):

 I think I know the reason for the difference now: The reason is that the
 Fortran and the C interface to Lapack compute simply different things.

 Fortran: LU decomposition with L unit diagonal (as described in the help
 text to lu_factor)

 C: LU decomposition with U unit diagonal. See ATLAS documentation:

 {{{
 int clapack ♦getrf ( const enum CBLAS ORDER Order, const int M, const int
 N, TYPE *A, const int lda, int *ipiv )

 using AP = LU , A ← LU , ipiv ← P
 (U is unit diagonal, P pivots columns)
 }}}

 Hence, the way that this is handled now in scipy is in my opinion very
 problematic: Changing the memory layout that changes the meaning of the
 content.

 Also, note that there is not really a standard for the clapack interface
 as provided by ATLAS. (The ATLAS people actually recommend using the
 Fortran interface in their FAQ). Just last year the original Lapack people
 have defined a standard C interface which is however completely different
 from ATLAS's clapack ...

-- 
Ticket URL: <http://projects.scipy.org/scipy/ticket/1458#comment:7>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list