Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58904 - sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver
From: rutger_at_[hidden]
Date: 2010-01-11 08:19:28


Author: rutger
Date: 2010-01-11 08:19:26 EST (Mon, 11 Jan 2010)
New Revision: 58904
URL: http://svn.boost.org/trac/boost/changeset/58904

Log:
Don't rely on workspace queries for minimum size computations

Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/gelsd.hpp | 7 +++----
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/ggesx.hpp | 14 ++++++--------
   2 files changed, 9 insertions(+), 12 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/gelsd.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/gelsd.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/gelsd.hpp 2010-01-11 08:19:26 EST (Mon, 11 Jan 2010)
@@ -219,15 +219,14 @@
             const real_type rcond, fortran_int_t& rank,
             optimal_workspace work ) {
         real_type opt_size_work;
- fortran_int_t opt_size_iwork;
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( minmn, nlvl ) );
         detail::gelsd( size_row(a), size_column(a), size_column(b),
                 begin_value(a), stride_major(a), begin_value(b),
                 stride_major(b), begin_value(s), rcond, rank, &opt_size_work,
- -1, &opt_size_iwork );
+ -1, begin_value(tmp_iwork) );
         bindings::detail::array< real_type > tmp_work(
                 traits::detail::to_int( opt_size_work ) );
- bindings::detail::array< fortran_int_t > tmp_iwork(
- opt_size_iwork );
         return invoke( a, b, s, rcond, rank, workspace( tmp_work,
                 tmp_iwork ) );
     }

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/ggesx.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/ggesx.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/ggesx.hpp 2010-01-11 08:19:26 EST (Mon, 11 Jan 2010)
@@ -282,7 +282,8 @@
             MatrixVSR& vsr, VectorRCONDE& rconde, VectorRCONDV& rcondv,
             optimal_workspace work ) {
         real_type opt_size_work;
- fortran_int_t opt_size_iwork;
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( size_column(a), sense ) );
         bindings::detail::array< bool > tmp_bwork( min_size_bwork(
                 size_column(a), sort ) );
         detail::ggesx( jobvsl, jobvsr, sort, selctg, sense,
@@ -291,11 +292,9 @@
                 begin_value(alphai), begin_value(beta), begin_value(vsl),
                 stride_major(vsl), begin_value(vsr), stride_major(vsr),
                 begin_value(rconde), begin_value(rcondv), &opt_size_work, -1,
- &opt_size_iwork, -1, begin_value(tmp_bwork) );
+ begin_value(tmp_iwork), -1, begin_value(tmp_bwork) );
         bindings::detail::array< real_type > tmp_work(
                 traits::detail::to_int( opt_size_work ) );
- bindings::detail::array< fortran_int_t > tmp_iwork(
- opt_size_iwork );
         return invoke( jobvsl, jobvsr, sort, selctg, sense, a, b, sdim,
                 alphar, alphai, beta, vsl, vsr, rconde, rcondv,
                 workspace( tmp_work, tmp_iwork, tmp_bwork ) );
@@ -483,7 +482,8 @@
         value_type opt_size_work;
         bindings::detail::array< real_type > tmp_rwork( min_size_rwork(
                 size_column(a) ) );
- fortran_int_t opt_size_iwork;
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( size_column(a), sense ) );
         bindings::detail::array< bool > tmp_bwork( min_size_bwork(
                 size_column(a), sort ) );
         detail::ggesx( jobvsl, jobvsr, sort, selctg, sense,
@@ -492,12 +492,10 @@
                 begin_value(beta), begin_value(vsl), stride_major(vsl),
                 begin_value(vsr), stride_major(vsr), begin_value(rconde),
                 begin_value(rcondv), &opt_size_work, -1,
- begin_value(tmp_rwork), &opt_size_iwork, -1,
+ begin_value(tmp_rwork), begin_value(tmp_iwork), -1,
                 begin_value(tmp_bwork) );
         bindings::detail::array< value_type > tmp_work(
                 traits::detail::to_int( opt_size_work ) );
- bindings::detail::array< fortran_int_t > tmp_iwork(
- opt_size_iwork );
         return invoke( jobvsl, jobvsr, sort, selctg, sense, a, b, sdim, alpha,
                 beta, vsl, vsr, rconde, rcondv, workspace( tmp_work,
                 tmp_rwork, tmp_iwork, tmp_bwork ) );


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk