Mercurial > hg > octave-terminal
changeset 11651:74de76325d12 release-3-0-x
more xGELSD workspace fixes
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 15 Feb 2008 18:55:45 -0500 |
parents | a8e0f7184a59 |
children | ef95e842ba81 |
files | liboctave/CMatrix.cc liboctave/ChangeLog liboctave/dMatrix.cc |
diffstat | 3 files changed, 25 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/CMatrix.cc +++ b/liboctave/CMatrix.cc @@ -2507,6 +2507,13 @@ F77_CHAR_ARG_LEN (6) F77_CHAR_ARG_LEN (1)); + octave_idx_type mnthr; + F77_FUNC (xilaenv, XILAENV) (6, F77_CONST_CHAR_ARG2 ("ZGELSD", 6), + F77_CONST_CHAR_ARG2 (" ", 1), + m, n, nrhs, -1, mnthr + F77_CHAR_ARG_LEN (6) + F77_CHAR_ARG_LEN (1)); + // We compute the size of rwork and iwork because ZGELSD in // older versions of LAPACK does not return them on a query // call. @@ -2539,10 +2546,10 @@ lwork, prwork, piwork, info)); // The workspace query is broken in at least LAPACK 3.0.0 - // through 3.1.1 when n > m. The obtuse formula below - // should provide sufficient workspace for DGELSD to operate + // through 3.1.1 when n > mnthr. The obtuse formula below + // should provide sufficient workspace for ZGELSD to operate // efficiently. - if (n > m) + if (n > mnthr) { octave_idx_type addend = m;
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +2008-02-15 John W. Eaton <jwe@octave.org> + + * dMatrix.cc (Matrix::lssolve): Check n > mnthr, not n > m when + deciding whether to calculate workspace size, with mnthr from ILAENV. + * CMatrix.cc (ComplexMatrix::lssolve): Likewise. + 2008-02-12 John W. Eaton <jwe@octave.org> * CMatrix.cc: Declare xilaenv instead of ilaenv.
--- a/liboctave/dMatrix.cc +++ b/liboctave/dMatrix.cc @@ -2118,6 +2118,13 @@ F77_CHAR_ARG_LEN (6) F77_CHAR_ARG_LEN (1)); + octave_idx_type mnthr; + F77_FUNC (xilaenv, XILAENV) (6, F77_CONST_CHAR_ARG2 ("DGELSD", 6), + F77_CONST_CHAR_ARG2 (" ", 1), + m, n, nrhs, -1, mnthr + F77_CHAR_ARG_LEN (6) + F77_CHAR_ARG_LEN (1)); + // We compute the size of iwork because DGELSD in older versions // of LAPACK does not return it on a query call. double dminmn = static_cast<double> (minmn); @@ -2142,10 +2149,10 @@ lwork, piwork, info)); // The workspace query is broken in at least LAPACK 3.0.0 - // through 3.1.1 when n > m. The obtuse formula below + // through 3.1.1 when n > mnthr. The obtuse formula below // should provide sufficient workspace for DGELSD to operate // efficiently. - if (n > m) + if (n > mnthr) { const octave_idx_type wlalsd = 9*m + 2*m*smlsiz + 8*m*nlvl + m*nrhs + (smlsiz+1)*(smlsiz+1);