# HG changeset patch # User John W. Eaton # Date 1203119711 18000 # Node ID 6a6d2abe51ff78913838c0bb54a8468ebd9b3a58 # Parent fe2d956d9007c747963939953a809b13866e6b3a more xGELSD workspace fixes diff --git a/liboctave/CMatrix.cc b/liboctave/CMatrix.cc --- a/liboctave/CMatrix.cc +++ b/liboctave/CMatrix.cc @@ -2425,6 +2425,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. @@ -2457,10 +2464,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; diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +2008-02-15 John W. Eaton + + * 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-14 John W. Eaton * CColVector.cc, CMatrix.cc, CRowVector.cc, CSparse.cc, diff --git a/liboctave/dMatrix.cc b/liboctave/dMatrix.cc --- a/liboctave/dMatrix.cc +++ b/liboctave/dMatrix.cc @@ -2036,6 +2036,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 (minmn); @@ -2060,10 +2067,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);