[Scipy-tickets] [SciPy] #1645: incorrect lwork assertion in f2py wrapper for LAPACK xGERQF
SciPy Trac
scipy-tickets@scipy....
Thu Apr 19 14:52:55 CDT 2012
#1645: incorrect lwork assertion in f2py wrapper for LAPACK xGERQF
--------------------------+-------------------------------------------------
Reporter: mike.wimmer | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: Unscheduled
Component: scipy.linalg | Version: devel
Keywords: |
--------------------------+-------------------------------------------------
I noticed that the f2py wrapper for xGERQF has a wrong assertion with
respect to the workspace size: In lines 575-580 of flapack.pyf.src (that's
the name in the current development version, in 0.10.1 where I found the
mistake, it's generic_flapack.pyf.src) we see
{{{
integer intent(hide),depend(a):: m = shape(a,0)
integer intent(hide),depend(a):: n = shape(a,1)
<ftype> dimension(m,n),intent(in,out,copy,out=qr,aligned8) :: a
<ftype> dimension(MIN(m,n)),intent(out) :: tau
integer optional,intent(in),depend(n),check(lwork>=n||lwork==-1) ::
lwork=3*n
}}}
i.e. a requirement that lwork > number of columns of the array. From the
LAPACK documentation however (i.e.
http://www.netlib.org/lapack/double/dgerqf.f ) we find
{{{
* LWORK (input) INTEGER
* The dimension of the array WORK. LWORK >= max(1,M).
}}}
with M the number of rows.
Hence, line 580 of flapack.pyf.src should read instead
{{{
integer optional,intent(in),depend(m),check(lwork>=m||lwork==-1) ::
lwork=3*m
}}}
I discovered this problem while linking scipy to MKL, where some of the RQ
tests failed because of this issue.
--
Ticket URL: <http://projects.scipy.org/scipy/ticket/1645>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.
More information about the Scipy-tickets
mailing list