Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63863 - in sandbox/numeric_bindings: boost/numeric/bindings/lapack/computational libs/numeric/bindings/doc/lapack/computational libs/numeric/bindings/tools/templates/computational
From: thomas.klimpel_at_[hidden]
Date: 2010-07-11 09:40:56


Author: klimpel
Date: 2010-07-11 09:40:55 EDT (Sun, 11 Jul 2010)
New Revision: 63863
URL: http://svn.boost.org/trac/boost/changeset/63863

Log:
added templates to override detected workspace size for some routines in lapack/computational
Added:
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgexc.hpp (contents, props changed)
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/trsen.hpp (contents, props changed)
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/trsna.hpp (contents, props changed)
Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgexc.hpp | 2
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgsen.hpp | 34 +++++----------
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trsen.hpp | 17 +++++--
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trsna.hpp | 81 ++++++++++++++++++++-------------------
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/trsna.qbk | 3
   sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgsen.hpp | 10 +--
   6 files changed, 72 insertions(+), 75 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgexc.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgexc.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgexc.hpp 2010-07-11 09:40:55 EDT (Sun, 11 Jul 2010)
@@ -167,7 +167,7 @@
         BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixQ >::value) );
         BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
         BOOST_ASSERT( bindings::size(work.select(real_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
+ min_size_work( bindings::size_column(a) ));
         BOOST_ASSERT( bindings::size_column(a) >= 0 );
         BOOST_ASSERT( bindings::size_minor(a) == 1 ||
                 bindings::stride_minor(a) == 1 );

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgsen.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgsen.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgsen.hpp 2010-07-11 09:40:55 EDT (Sun, 11 Jul 2010)
@@ -212,11 +212,9 @@
         BOOST_ASSERT( bindings::size(alphar) >= bindings::size_column(a) );
         BOOST_ASSERT( bindings::size(select) >= bindings::size_column(a) );
         BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
- min_size_iwork( ijob, bindings::size_column(a),
- bindings::begin_value(select) ));
+ min_size_iwork( ijob, bindings::size_column(a), m ));
         BOOST_ASSERT( bindings::size(work.select(real_type())) >=
- min_size_work( ijob, bindings::size_column(a),
- bindings::begin_value(select) ));
+ min_size_work( ijob, bindings::size_column(a), m ));
         BOOST_ASSERT( bindings::size_column(a) >= 0 );
         BOOST_ASSERT( bindings::size_minor(a) == 1 ||
                 bindings::stride_minor(a) == 1 );
@@ -263,10 +261,9 @@
             real_type& pr, VectorDIF& dif, minimal_workspace ) {
         namespace bindings = ::boost::numeric::bindings;
         bindings::detail::array< real_type > tmp_work( min_size_work( ijob,
- bindings::size_column(a), bindings::begin_value(select) ) );
+ bindings::size_column(a), m ) );
         bindings::detail::array< fortran_int_t > tmp_iwork(
- min_size_iwork( ijob, bindings::size_column(a),
- bindings::begin_value(select) ) );
+ min_size_iwork( ijob, bindings::size_column(a), m ) );
         return invoke( ijob, wantq, wantz, select, a, b, alphar, alphai, beta,
                 q, z, m, pl, pr, dif, workspace( tmp_work, tmp_iwork ) );
     }
@@ -312,8 +309,7 @@
     // workspace-array work.
     //
     static std::ptrdiff_t min_size_work( const std::ptrdiff_t ijob,
- const std::ptrdiff_t n, const logical_t* select ) {
- std::ptrdiff_t m = n/2; // FIXME: num_selected( select );
+ const std::ptrdiff_t n, std::ptrdiff_t& m ) {
         if ( ijob == 1 || ijob == 2 || ijob == 4 )
             return std::max< std::ptrdiff_t >(4*n+16, 2*m*(n-m));
         else // if ( ijob == 3 || ijob == 5 )
@@ -325,8 +321,7 @@
     // workspace-array iwork.
     //
     static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t ijob,
- const std::ptrdiff_t n, const logical_t* select ) {
- std::ptrdiff_t m = n/2; // FIXME: num_selected( select );
+ const std::ptrdiff_t n, std::ptrdiff_t& m ) {
         if ( ijob == 1 || ijob == 2 || ijob == 4 )
             return std::max< std::ptrdiff_t >(1, n+6);
         else // if ( ijob == 3 || ijob == 5 )
@@ -393,11 +388,9 @@
         BOOST_ASSERT( bindings::size(alpha) >= bindings::size_column(a) );
         BOOST_ASSERT( bindings::size(select) >= bindings::size_column(a) );
         BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
- min_size_iwork( ijob, bindings::size_column(a),
- bindings::begin_value(select) ));
+ min_size_iwork( ijob, bindings::size_column(a), m ));
         BOOST_ASSERT( bindings::size(work.select(value_type())) >=
- min_size_work( ijob, bindings::size_column(a),
- bindings::begin_value(select) ));
+ min_size_work( ijob, bindings::size_column(a), m ));
         BOOST_ASSERT( bindings::size_column(a) >= 0 );
         BOOST_ASSERT( bindings::size_minor(a) == 1 ||
                 bindings::stride_minor(a) == 1 );
@@ -443,10 +436,9 @@
             VectorDIF& dif, minimal_workspace ) {
         namespace bindings = ::boost::numeric::bindings;
         bindings::detail::array< value_type > tmp_work( min_size_work( ijob,
- bindings::size_column(a), bindings::begin_value(select) ) );
+ bindings::size_column(a), m ) );
         bindings::detail::array< fortran_int_t > tmp_iwork(
- min_size_iwork( ijob, bindings::size_column(a),
- bindings::begin_value(select) ) );
+ min_size_iwork( ijob, bindings::size_column(a), m ) );
         return invoke( ijob, wantq, wantz, select, a, b, alpha, beta, q, z, m,
                 pl, pr, dif, workspace( tmp_work, tmp_iwork ) );
     }
@@ -492,8 +484,7 @@
     // workspace-array work.
     //
     static std::ptrdiff_t min_size_work( const std::ptrdiff_t ijob,
- const std::ptrdiff_t n, const logical_t* select ) {
- std::ptrdiff_t m = n/2; // FIXME: num_selected( select );
+ const std::ptrdiff_t n, std::ptrdiff_t& m ) {
         if ( ijob == 1 || ijob == 2 || ijob == 4 )
             return std::max< std::ptrdiff_t >(1, 2*m*(n-m));
         else // if ( ijob == 3 || ijob == 5 )
@@ -505,8 +496,7 @@
     // workspace-array iwork.
     //
     static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t ijob,
- const std::ptrdiff_t n, const logical_t* select ) {
- std::ptrdiff_t m = n/2; // FIXME: num_selected( select );
+ const std::ptrdiff_t n, std::ptrdiff_t& m ) {
         if ( ijob == 1 || ijob == 2 || ijob == 4 )
             return std::max< std::ptrdiff_t >(1, n+2);
         else // if ( ijob == 3 || ijob == 5 )

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trsen.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trsen.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trsen.hpp 2010-07-11 09:40:55 EDT (Sun, 11 Jul 2010)
@@ -120,7 +120,7 @@
         BOOST_ASSERT( bindings::size(select) >= bindings::size_column(t) );
         BOOST_ASSERT( bindings::size(w) >= bindings::size_column(t) );
         BOOST_ASSERT( bindings::size(work.select(value_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
+ min_size_work( job, bindings::size_column(t), m ));
         BOOST_ASSERT( bindings::size_column(t) >= 0 );
         BOOST_ASSERT( bindings::size_minor(q) == 1 ||
                 bindings::stride_minor(q) == 1 );
@@ -152,8 +152,8 @@
             fortran_int_t& m, real_type& s, real_type& sep,
             minimal_workspace ) {
         namespace bindings = ::boost::numeric::bindings;
- bindings::detail::array< value_type > tmp_work( min_size_work(
- $CALL_MIN_SIZE ) );
+ bindings::detail::array< value_type > tmp_work( min_size_work( job,
+ bindings::size_column(t), m ) );
         return invoke( job, compq, select, t, q, w, m, s, sep,
                 workspace( tmp_work ) );
     }
@@ -188,9 +188,14 @@
     // Static member function that returns the minimum size of
     // workspace-array work.
     //
- template< $TYPES >
- static std::ptrdiff_t min_size_work( $ARGUMENTS ) {
- $MIN_SIZE_IMPLEMENTATION
+ static std::ptrdiff_t min_size_work( const char job, const std::ptrdiff_t n,
+ std::ptrdiff_t& m ) {
+ if ( job == 'N' )
+ return 1;
+ else if ( job == 'E' )
+ return std::max< std::ptrdiff_t >(1, m*(n-m));
+ else // if ( job == 'V' || job == 'B' )
+ return std::max< std::ptrdiff_t >(1, 2*m*(n-m));
     }
 };
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trsna.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trsna.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/trsna.hpp 2010-07-11 09:40:55 EDT (Sun, 11 Jul 2010)
@@ -149,7 +149,8 @@
             const VectorSELECT& select, const MatrixT& t, const MatrixVL& vl,
             const MatrixVR& vr, VectorS& s, VectorSEP& sep,
             const fortran_int_t mm, fortran_int_t& m,
- detail::workspace2< WORK, IWORK > work ) {
+ const fortran_int_t ldwork, detail::workspace2< WORK,
+ IWORK > work ) {
         namespace bindings = ::boost::numeric::bindings;
         BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixT >::value) );
         BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixVL >::value) );
@@ -173,9 +174,9 @@
         BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorS >::value) );
         BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorSEP >::value) );
         BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
- min_size_iwork( $CALL_MIN_SIZE ));
+ min_size_iwork( job, bindings::size_column(t) ));
         BOOST_ASSERT( bindings::size(work.select(real_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
+ min_size_work( job, ldwork, bindings::size_column(t) ));
         BOOST_ASSERT( bindings::size_column(t) >= 0 );
         BOOST_ASSERT( bindings::size_minor(t) == 1 ||
                 bindings::stride_minor(t) == 1 );
@@ -193,7 +194,7 @@
                 bindings::stride_major(vl), bindings::begin_value(vr),
                 bindings::stride_major(vr), bindings::begin_value(s),
                 bindings::begin_value(sep), mm, m,
- bindings::begin_value(work), bindings::stride_major(work),
+ bindings::begin_value(work.select(real_type())), ldwork,
                 bindings::begin_value(work.select(fortran_int_t())) );
     }
 
@@ -210,13 +211,13 @@
             const VectorSELECT& select, const MatrixT& t, const MatrixVL& vl,
             const MatrixVR& vr, VectorS& s, VectorSEP& sep,
             const fortran_int_t mm, fortran_int_t& m,
- minimal_workspace ) {
+ const fortran_int_t ldwork, minimal_workspace ) {
         namespace bindings = ::boost::numeric::bindings;
- bindings::detail::array< real_type > tmp_work( min_size_work(
- $CALL_MIN_SIZE ) );
+ bindings::detail::array< real_type > tmp_work( min_size_work( job,
+ ldwork, bindings::size_column(t) ) );
         bindings::detail::array< fortran_int_t > tmp_iwork(
- min_size_iwork( $CALL_MIN_SIZE ) );
- return invoke( job, howmny, select, t, vl, vr, s, sep, mm, m,
+ min_size_iwork( job, bindings::size_column(t) ) );
+ return invoke( job, howmny, select, t, vl, vr, s, sep, mm, m, ldwork,
                 workspace( tmp_work, tmp_iwork ) );
     }
 
@@ -233,9 +234,9 @@
             const VectorSELECT& select, const MatrixT& t, const MatrixVL& vl,
             const MatrixVR& vr, VectorS& s, VectorSEP& sep,
             const fortran_int_t mm, fortran_int_t& m,
- optimal_workspace ) {
+ const fortran_int_t ldwork, optimal_workspace ) {
         namespace bindings = ::boost::numeric::bindings;
- return invoke( job, howmny, select, t, vl, vr, s, sep, mm, m,
+ return invoke( job, howmny, select, t, vl, vr, s, sep, mm, m, ldwork,
                 minimal_workspace() );
     }
 
@@ -243,18 +244,18 @@
     // Static member function that returns the minimum size of
     // workspace-array work.
     //
- template< $TYPES >
- static std::ptrdiff_t min_size_work( $ARGUMENTS ) {
- $MIN_SIZE_IMPLEMENTATION
+ static std::ptrdiff_t min_size_work( const char job,
+ const std::ptrdiff_t ldwork, const std::ptrdiff_t n ) {
+ return job == 'E' ? 1 : ldwork * (n+6);
     }
 
     //
     // Static member function that returns the minimum size of
     // workspace-array iwork.
     //
- template< $TYPES >
- static std::ptrdiff_t min_size_iwork( $ARGUMENTS ) {
- $MIN_SIZE_IMPLEMENTATION
+ static std::ptrdiff_t min_size_iwork( const char job,
+ const std::ptrdiff_t n ) {
+ return std::max< std::ptrdiff_t >( 1, job == 'E' ? 1 : 2 * (n-1));
     }
 };
 
@@ -279,7 +280,8 @@
             const VectorSELECT& select, const MatrixT& t, const MatrixVL& vl,
             const MatrixVR& vr, VectorS& s, VectorSEP& sep,
             const fortran_int_t mm, fortran_int_t& m,
- detail::workspace2< WORK, RWORK > work ) {
+ const fortran_int_t ldwork, detail::workspace2< WORK,
+ RWORK > work ) {
         namespace bindings = ::boost::numeric::bindings;
         BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixT >::value) );
         BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixVL >::value) );
@@ -299,9 +301,9 @@
         BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorS >::value) );
         BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorSEP >::value) );
         BOOST_ASSERT( bindings::size(work.select(real_type())) >=
- min_size_rwork( $CALL_MIN_SIZE ));
+ min_size_rwork( job, bindings::size_column(t) ));
         BOOST_ASSERT( bindings::size(work.select(value_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
+ min_size_work( job, ldwork, bindings::size_column(t) ));
         BOOST_ASSERT( bindings::size_column(t) >= 0 );
         BOOST_ASSERT( bindings::size_minor(t) == 1 ||
                 bindings::stride_minor(t) == 1 );
@@ -319,7 +321,7 @@
                 bindings::stride_major(vl), bindings::begin_value(vr),
                 bindings::stride_major(vr), bindings::begin_value(s),
                 bindings::begin_value(sep), mm, m,
- bindings::begin_value(work), bindings::stride_major(work),
+ bindings::begin_value(work.select(value_type())), ldwork,
                 bindings::begin_value(work.select(real_type())) );
     }
 
@@ -336,13 +338,13 @@
             const VectorSELECT& select, const MatrixT& t, const MatrixVL& vl,
             const MatrixVR& vr, VectorS& s, VectorSEP& sep,
             const fortran_int_t mm, fortran_int_t& m,
- minimal_workspace ) {
+ const fortran_int_t ldwork, minimal_workspace ) {
         namespace bindings = ::boost::numeric::bindings;
- bindings::detail::array< value_type > tmp_work( min_size_work(
- $CALL_MIN_SIZE ) );
- bindings::detail::array< real_type > tmp_rwork( min_size_rwork(
- $CALL_MIN_SIZE ) );
- return invoke( job, howmny, select, t, vl, vr, s, sep, mm, m,
+ bindings::detail::array< value_type > tmp_work( min_size_work( job,
+ ldwork, bindings::size_column(t) ) );
+ bindings::detail::array< real_type > tmp_rwork( min_size_rwork( job,
+ bindings::size_column(t) ) );
+ return invoke( job, howmny, select, t, vl, vr, s, sep, mm, m, ldwork,
                 workspace( tmp_work, tmp_rwork ) );
     }
 
@@ -359,9 +361,9 @@
             const VectorSELECT& select, const MatrixT& t, const MatrixVL& vl,
             const MatrixVR& vr, VectorS& s, VectorSEP& sep,
             const fortran_int_t mm, fortran_int_t& m,
- optimal_workspace ) {
+ const fortran_int_t ldwork, optimal_workspace ) {
         namespace bindings = ::boost::numeric::bindings;
- return invoke( job, howmny, select, t, vl, vr, s, sep, mm, m,
+ return invoke( job, howmny, select, t, vl, vr, s, sep, mm, m, ldwork,
                 minimal_workspace() );
     }
 
@@ -369,18 +371,18 @@
     // Static member function that returns the minimum size of
     // workspace-array work.
     //
- template< $TYPES >
- static std::ptrdiff_t min_size_work( $ARGUMENTS ) {
- $MIN_SIZE_IMPLEMENTATION
+ static std::ptrdiff_t min_size_work( const char job,
+ const std::ptrdiff_t ldwork, const std::ptrdiff_t n ) {
+ return job == 'E' ? 1 : ldwork * (n+6);
     }
 
     //
     // Static member function that returns the minimum size of
     // workspace-array rwork.
     //
- template< $TYPES >
- static std::ptrdiff_t min_size_rwork( $ARGUMENTS ) {
- $MIN_SIZE_IMPLEMENTATION
+ static std::ptrdiff_t min_size_rwork( const char job,
+ const std::ptrdiff_t n ) {
+ return std::max< std::ptrdiff_t >( 1, job == 'E' ? 1 : n);
     }
 };
 
@@ -406,10 +408,10 @@
 trsna( const char job, const char howmny, const VectorSELECT& select,
         const MatrixT& t, const MatrixVL& vl, const MatrixVR& vr, VectorS& s,
         VectorSEP& sep, const fortran_int_t mm, fortran_int_t& m,
- Workspace work ) {
+ const fortran_int_t ldwork, Workspace work ) {
     return trsna_impl< typename bindings::value_type<
             MatrixT >::type >::invoke( job, howmny, select, t, vl, vr, s, sep,
- mm, m, work );
+ mm, m, ldwork, work );
 }
 
 //
@@ -422,10 +424,11 @@
         std::ptrdiff_t >::type
 trsna( const char job, const char howmny, const VectorSELECT& select,
         const MatrixT& t, const MatrixVL& vl, const MatrixVR& vr, VectorS& s,
- VectorSEP& sep, const fortran_int_t mm, fortran_int_t& m ) {
+ VectorSEP& sep, const fortran_int_t mm, fortran_int_t& m,
+ const fortran_int_t ldwork ) {
     return trsna_impl< typename bindings::value_type<
             MatrixT >::type >::invoke( job, howmny, select, t, vl, vr, s, sep,
- mm, m, optimal_workspace() );
+ mm, m, ldwork, optimal_workspace() );
 }
 
 } // namespace lapack

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/trsna.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/trsna.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/trsna.qbk 2010-07-11 09:40:55 EDT (Sun, 11 Jul 2010)
@@ -11,7 +11,8 @@
 ``
 trsna( const char job, const char howmny, const VectorSELECT& select,
         const MatrixT& t, const MatrixVL& vl, const MatrixVR& vr, VectorS& s,
- VectorSEP& sep, const int_t mm, int_t& m );
+ VectorSEP& sep, const int_t mm, int_t& m,
+ const int_t ldwork );
 ``
 
 

Added: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgexc.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgexc.hpp 2010-07-11 09:40:55 EDT (Sun, 11 Jul 2010)
@@ -0,0 +1,10 @@
+$TEMPLATE[tgexc.all.fixme]
+Only the real version uses workspaces, but that currently doesn't work.
+$TEMPLATE[tgexc.real.min_size_work.args]
+N
+$TEMPLATE[tgexc.real.min_size_work]
+if (n <= 1)
+ return 1;
+else
+ return 4*n + 16;
+$TEMPLATE[end]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgsen.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgsen.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgsen.hpp 2010-07-11 09:40:55 EDT (Sun, 11 Jul 2010)
@@ -1,27 +1,25 @@
+$TEMPLATE[tgsen.all.fixme]
+M should be computed from select, because it is an output parameter.
 $TEMPLATE[tgsen.all.min_size_work.args]
-IJOB,N,SELECT
+IJOB,N,M
 $TEMPLATE[tgsen.real.min_size_work]
-$INTEGER_TYPE m = n/2; // FIXME: num_selected( select );
 if ( ijob == 1 || ijob == 2 || ijob == 4 )
     return std::max< $INTEGER_TYPE >(4*n+16, 2*m*(n-m));
 else // if ( ijob == 3 || ijob == 5 )
     return std::max< $INTEGER_TYPE >(4*n+16, 4*m*(n-m));
 $TEMPLATE[tgsen.complex.min_size_work]
-$INTEGER_TYPE m = n/2; // FIXME: num_selected( select );
 if ( ijob == 1 || ijob == 2 || ijob == 4 )
     return std::max< $INTEGER_TYPE >(1, 2*m*(n-m));
 else // if ( ijob == 3 || ijob == 5 )
     return std::max< $INTEGER_TYPE >(1, 4*m*(n-m));
 $TEMPLATE[tgsen.all.min_size_iwork.args]
-IJOB,N,SELECT
+IJOB,N,M
 $TEMPLATE[tgsen.real.min_size_iwork]
-$INTEGER_TYPE m = n/2; // FIXME: num_selected( select );
 if ( ijob == 1 || ijob == 2 || ijob == 4 )
     return std::max< $INTEGER_TYPE >(1, n+6);
 else // if ( ijob == 3 || ijob == 5 )
     return std::max< $INTEGER_TYPE >(2*m*(n-m), n+6);
 $TEMPLATE[tgsen.complex.min_size_iwork]
-$INTEGER_TYPE m = n/2; // FIXME: num_selected( select );
 if ( ijob == 1 || ijob == 2 || ijob == 4 )
     return std::max< $INTEGER_TYPE >(1, n+2);
 else // if ( ijob == 3 || ijob == 5 )

Added: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/trsen.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/trsen.hpp 2010-07-11 09:40:55 EDT (Sun, 11 Jul 2010)
@@ -0,0 +1,26 @@
+$TEMPLATE[trsen.all.fixme]
+M should be computed from select, because it is an output parameter.
+$TEMPLATE[trsen.all.min_size_work.args]
+JOB,N,M
+$TEMPLATE[trsen.real.min_size_work]
+if ( job == 'N' )
+ return std::max< $INTEGER_TYPE >(1, n);
+else if ( job == 'E' )
+ return std::max< $INTEGER_TYPE >(1, m*(n-m));
+else // if ( job == 'V' || job == 'B' )
+ return std::max< $INTEGER_TYPE >(1, 2*m*(n-m));
+$TEMPLATE[trsen.complex.min_size_work]
+if ( job == 'N' )
+ return 1;
+else if ( job == 'E' )
+ return std::max< $INTEGER_TYPE >(1, m*(n-m));
+else // if ( job == 'V' || job == 'B' )
+ return std::max< $INTEGER_TYPE >(1, 2*m*(n-m));
+$TEMPLATE[trsen.real.min_size_iwork.args]
+JOB,N,M
+$TEMPLATE[trsen.real.min_size_iwork]
+if ( job == 'N' || job == 'E' )
+ return 1;
+else // if ( job == 'V' || job == 'B' )
+ return std::max< $INTEGER_TYPE >(1, m*(n-m));
+$TEMPLATE[end]

Added: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/trsna.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/trsna.hpp 2010-07-11 09:40:55 EDT (Sun, 11 Jul 2010)
@@ -0,0 +1,22 @@
+$TEMPLATE[trsna.all.WORK.type]
+vector
+$TEMPLATE[trsna.all.fixme]
+LDWORK isn't handled correctly yet,
+because trsna uses a matrix as workspace instead of a vector.
+$TEMPLATE[trsna.all.extra_variables]
+LDWORK
+$TEMPLATE[trsna.all.LDWORK.init]
+$INTEGER_TYPE ldwork = std::max< $INTEGER_TYPE >( 1, (job == 'V' || job == 'B') ? n : 1 );
+$TEMPLATE[trsna.all.min_size_work.args]
+JOB,LDWORK,N
+$TEMPLATE[trsna.all.min_size_work]
+return job == 'E' ? 1 : ldwork * (n+6);
+$TEMPLATE[trsna.real.min_size_iwork.args]
+JOB,N
+$TEMPLATE[trsna.real.min_size_iwork]
+return std::max< $INTEGER_TYPE >( 1, job == 'E' ? 1 : 2 * (n-1));
+$TEMPLATE[trsna.complex.min_size_rwork.args]
+JOB,N
+$TEMPLATE[trsna.complex.min_size_rwork]
+return std::max< $INTEGER_TYPE >( 1, job == 'E' ? 1 : n);
+$TEMPLATE[end]


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