Mercurial > hg > octave-lojdl
changeset 7532:493bb0de3199
avoid another xGELSD workspace query bug
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 26 Feb 2008 02:47:56 -0500 |
parents | c9a476b1e664 |
children | ff52243af934 |
files | liboctave/CMatrix.cc liboctave/ChangeLog liboctave/dMatrix.cc |
diffstat | 3 files changed, 20 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/CMatrix.cc +++ b/liboctave/CMatrix.cc @@ -2486,6 +2486,13 @@ if (std::real (work(0)) < lworkaround) work(0) = lworkaround; } + else if (m >= n) + { + octave_idx_type lworkaround = 2*m + m*nrhs; + + if (std::real (work(0)) < lworkaround) + work(0) = lworkaround; + } lwork = static_cast<octave_idx_type> (std::real (work(0))); work.resize (lwork);
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2008-02-26 John W. Eaton <jwe@octave.org> + + * dMatrix.cc (Matrix::lssolve): Avoid another dgelsd lwork query bug. + * CMatrix.cc (ComplexMatrix::lssolve): Likewise, for zgelsd + 2008-02-24 John W. Eaton <jwe@octave.org> * oct-inttypes.h (octave_int_helper): New class. Provide
--- a/liboctave/dMatrix.cc +++ b/liboctave/dMatrix.cc @@ -2095,6 +2095,14 @@ if (work(0) < lworkaround) work(0) = lworkaround; } + else if (m >= n) + { + octave_idx_type lworkaround + = 12*n + 2*n*smlsiz + 8*n*nlvl + n*nrhs + (smlsiz+1)*(smlsiz+1); + + if (work(0) < lworkaround) + work(0) = lworkaround; + } lwork = static_cast<octave_idx_type> (work(0)); work.resize (lwork);