|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r63830 - in sandbox/numeric_bindings: boost/numeric/bindings/lapack/computational libs/numeric/bindings/tools/templates/computational
From: thomas.klimpel_at_[hidden]
Date: 2010-07-10 18:23:09
Author: klimpel
Date: 2010-07-10 18:23:07 EDT (Sat, 10 Jul 2010)
New Revision: 63830
URL: http://svn.boost.org/trac/boost/changeset/63830
Log:
added templates to override detected workspace size for ormrz, unmrz, upmtr, ggbal, tgsen and tgsna.
tgsen still contains a FIXME (compute m from select is missing).
Added:
sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/ggbal.hpp (contents, props changed)
sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgsen.hpp (contents, props changed)
sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgsna.hpp (contents, props changed)
sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/upmtr.hpp (contents, props changed)
Text files modified:
sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ggbal.hpp | 30 ++++++++++-------
sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ormrz.hpp | 16 ++++++---
sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgsen.hpp | 66 ++++++++++++++++++++++++++-------------
sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgsna.hpp | 58 +++++++++++++++++++++-------------
sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmrz.hpp | 16 ++++++---
sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/upmtr.hpp | 13 ++++---
sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/orm.hpp | 6 +++
sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/un.hpp | 6 +++
8 files changed, 137 insertions(+), 74 deletions(-)
Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ggbal.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ggbal.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ggbal.hpp 2010-07-10 18:23:07 EDT (Sat, 10 Jul 2010)
@@ -157,7 +157,7 @@
BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorLSCALE >::value) );
BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorRSCALE >::value) );
BOOST_ASSERT( bindings::size(work.select(real_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
+ min_size_work( job, bindings::size_column(a) ));
BOOST_ASSERT( bindings::size_column(a) >= 0 );
BOOST_ASSERT( bindings::size_minor(a) == 1 ||
bindings::stride_minor(a) == 1 );
@@ -188,8 +188,8 @@
fortran_int_t& ilo, fortran_int_t& ihi,
VectorLSCALE& lscale, VectorRSCALE& rscale, 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,
+ bindings::size_column(a) ) );
return invoke( job, a, b, ilo, ihi, lscale, rscale,
workspace( tmp_work ) );
}
@@ -215,9 +215,12 @@
// 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 ) {
+ if ( job == 'S' || job == 'B' )
+ return std::max< std::ptrdiff_t >(1, 6*n);
+ else // if ( job == 'N' || job == 'P' )
+ return 1;
}
};
@@ -257,7 +260,7 @@
BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorLSCALE >::value) );
BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorRSCALE >::value) );
BOOST_ASSERT( bindings::size(work.select(real_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
+ min_size_work( job, bindings::size_column(a) ));
BOOST_ASSERT( bindings::size_column(a) >= 0 );
BOOST_ASSERT( bindings::size_minor(a) == 1 ||
bindings::stride_minor(a) == 1 );
@@ -288,8 +291,8 @@
fortran_int_t& ilo, fortran_int_t& ihi,
VectorLSCALE& lscale, VectorRSCALE& rscale, 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,
+ bindings::size_column(a) ) );
return invoke( job, a, b, ilo, ihi, lscale, rscale,
workspace( tmp_work ) );
}
@@ -315,9 +318,12 @@
// 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 ) {
+ if ( job == 'S' || job == 'B' )
+ return std::max< std::ptrdiff_t >(1, 6*n);
+ else // if ( job == 'N' || job == 'P' )
+ return 1;
}
};
Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ormrz.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ormrz.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ormrz.hpp 2010-07-10 18:23:07 EDT (Sat, 10 Jul 2010)
@@ -18,6 +18,7 @@
#include <boost/numeric/bindings/begin.hpp>
#include <boost/numeric/bindings/data_order.hpp>
#include <boost/numeric/bindings/detail/array.hpp>
+#include <boost/numeric/bindings/detail/if_left.hpp>
#include <boost/numeric/bindings/is_mutable.hpp>
#include <boost/numeric/bindings/lapack/workspace.hpp>
#include <boost/numeric/bindings/remove_imaginary.hpp>
@@ -119,7 +120,8 @@
BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixC >::value) );
BOOST_ASSERT( bindings::size(tau) >= k );
BOOST_ASSERT( bindings::size(work.select(real_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
+ min_size_work( side, bindings::size_row(c),
+ bindings::size_column(c) ));
BOOST_ASSERT( bindings::size_column(c) >= 0 );
BOOST_ASSERT( bindings::size_minor(a) == 1 ||
bindings::stride_minor(a) == 1 );
@@ -154,8 +156,8 @@
namespace bindings = ::boost::numeric::bindings;
typedef typename result_of::data_order< MatrixC >::type order;
typedef typename result_of::trans_tag< MatrixA, order >::type trans;
- bindings::detail::array< real_type > tmp_work( min_size_work(
- $CALL_MIN_SIZE ) );
+ bindings::detail::array< real_type > tmp_work( min_size_work( side,
+ bindings::size_row(c), bindings::size_column(c) ) );
return invoke( side, k, a, tau, c, workspace( tmp_work ) );
}
@@ -189,9 +191,11 @@
// 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
+ template< typename Side >
+ static std::ptrdiff_t min_size_work( const Side side,
+ const std::ptrdiff_t m, const std::ptrdiff_t n ) {
+ return std::max< std::ptrdiff_t >( 1, bindings::detail::if_left( side,
+ n, m ) );
}
};
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-10 18:23:07 EDT (Sat, 10 Jul 2010)
@@ -212,9 +212,11 @@
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( $CALL_MIN_SIZE ));
+ min_size_iwork( ijob, bindings::size_column(a),
+ bindings::begin_value(select) ));
BOOST_ASSERT( bindings::size(work.select(real_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
+ min_size_work( ijob, bindings::size_column(a),
+ bindings::begin_value(select) ));
BOOST_ASSERT( bindings::size_column(a) >= 0 );
BOOST_ASSERT( bindings::size_minor(a) == 1 ||
bindings::stride_minor(a) == 1 );
@@ -260,10 +262,11 @@
MatrixQ& q, MatrixZ& z, fortran_int_t& m, real_type& pl,
real_type& pr, VectorDIF& dif, 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( ijob,
+ bindings::size_column(a), bindings::begin_value(select) ) );
bindings::detail::array< fortran_int_t > tmp_iwork(
- min_size_iwork( $CALL_MIN_SIZE ) );
+ min_size_iwork( ijob, bindings::size_column(a),
+ bindings::begin_value(select) ) );
return invoke( ijob, wantq, wantz, select, a, b, alphar, alphai, beta,
q, z, m, pl, pr, dif, workspace( tmp_work, tmp_iwork ) );
}
@@ -308,18 +311,26 @@
// 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 std::ptrdiff_t ijob,
+ const std::ptrdiff_t n, const logical_t* select ) {
+ std::ptrdiff_t m = n/2; // FIXME: num_selected( select );
+ 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 )
+ return std::max< std::ptrdiff_t >(4*n+16, 4*m*(n-m));
}
//
// 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 std::ptrdiff_t ijob,
+ const std::ptrdiff_t n, const logical_t* select ) {
+ std::ptrdiff_t m = n/2; // FIXME: num_selected( select );
+ if ( ijob == 1 || ijob == 2 || ijob == 4 )
+ return std::max< std::ptrdiff_t >(1, n+6);
+ else // if ( ijob == 3 || ijob == 5 )
+ return std::max< std::ptrdiff_t >(2*m*(n-m), n+6);
}
};
@@ -382,9 +393,11 @@
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( $CALL_MIN_SIZE ));
+ min_size_iwork( ijob, bindings::size_column(a),
+ bindings::begin_value(select) ));
BOOST_ASSERT( bindings::size(work.select(value_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
+ min_size_work( ijob, bindings::size_column(a),
+ bindings::begin_value(select) ));
BOOST_ASSERT( bindings::size_column(a) >= 0 );
BOOST_ASSERT( bindings::size_minor(a) == 1 ||
bindings::stride_minor(a) == 1 );
@@ -429,10 +442,11 @@
fortran_int_t& m, real_type& pl, real_type& pr,
VectorDIF& dif, 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( ijob,
+ bindings::size_column(a), bindings::begin_value(select) ) );
bindings::detail::array< fortran_int_t > tmp_iwork(
- min_size_iwork( $CALL_MIN_SIZE ) );
+ min_size_iwork( ijob, bindings::size_column(a),
+ bindings::begin_value(select) ) );
return invoke( ijob, wantq, wantz, select, a, b, alpha, beta, q, z, m,
pl, pr, dif, workspace( tmp_work, tmp_iwork ) );
}
@@ -477,18 +491,26 @@
// 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 std::ptrdiff_t ijob,
+ const std::ptrdiff_t n, const logical_t* select ) {
+ std::ptrdiff_t m = n/2; // FIXME: num_selected( select );
+ if ( ijob == 1 || ijob == 2 || ijob == 4 )
+ return std::max< std::ptrdiff_t >(1, 2*m*(n-m));
+ else // if ( ijob == 3 || ijob == 5 )
+ return std::max< std::ptrdiff_t >(1, 4*m*(n-m));
}
//
// 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 std::ptrdiff_t ijob,
+ const std::ptrdiff_t n, const logical_t* select ) {
+ std::ptrdiff_t m = n/2; // FIXME: num_selected( select );
+ if ( ijob == 1 || ijob == 2 || ijob == 4 )
+ return std::max< std::ptrdiff_t >(1, n+2);
+ else // if ( ijob == 3 || ijob == 5 )
+ return std::max< std::ptrdiff_t >(2*m*(n-m), n+2);
}
};
Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgsna.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgsna.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/tgsna.hpp 2010-07-10 18:23:07 EDT (Sat, 10 Jul 2010)
@@ -185,9 +185,9 @@
BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorS >::value) );
BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorDIF >::value) );
BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
- min_size_iwork( $CALL_MIN_SIZE ));
+ min_size_iwork( job, n ));
BOOST_ASSERT( bindings::size(work.select(real_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
+ min_size_work( job, n ));
BOOST_ASSERT( bindings::size_minor(a) == 1 ||
bindings::stride_minor(a) == 1 );
BOOST_ASSERT( bindings::size_minor(b) == 1 ||
@@ -231,10 +231,10 @@
const fortran_int_t mm, fortran_int_t& m,
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,
+ n ) );
bindings::detail::array< fortran_int_t > tmp_iwork(
- min_size_iwork( $CALL_MIN_SIZE ) );
+ min_size_iwork( job, n ) );
return invoke( job, howmny, select, n, a, b, vl, vr, s, dif, mm, m,
workspace( tmp_work, tmp_iwork ) );
}
@@ -258,7 +258,7 @@
namespace bindings = ::boost::numeric::bindings;
real_type opt_size_work;
bindings::detail::array< fortran_int_t > tmp_iwork(
- min_size_iwork( $CALL_MIN_SIZE ) );
+ min_size_iwork( job, n ) );
detail::tgsna( job, howmny, bindings::begin_value(select), n,
bindings::begin_value(a), bindings::stride_major(a),
bindings::begin_value(b), bindings::stride_major(b),
@@ -276,18 +276,24 @@
// 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 ) {
+ if ( job == 'V' || job == 'B' )
+ return std::max< std::ptrdiff_t >(1, 2*n*(n+2)+16);
+ else
+ return std::max< std::ptrdiff_t >(1, n);
}
//
// 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 ) {
+ if ( job == 'E')
+ return 1;
+ else
+ return n+6;
}
};
@@ -338,9 +344,9 @@
BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorS >::value) );
BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorDIF >::value) );
BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
- min_size_iwork( $CALL_MIN_SIZE ));
+ min_size_iwork( job, n ));
BOOST_ASSERT( bindings::size(work.select(value_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
+ min_size_work( job, n ));
BOOST_ASSERT( bindings::size_minor(a) == 1 ||
bindings::stride_minor(a) == 1 );
BOOST_ASSERT( bindings::size_minor(b) == 1 ||
@@ -384,10 +390,10 @@
const fortran_int_t mm, fortran_int_t& m,
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,
+ n ) );
bindings::detail::array< fortran_int_t > tmp_iwork(
- min_size_iwork( $CALL_MIN_SIZE ) );
+ min_size_iwork( job, n ) );
return invoke( job, howmny, select, n, a, b, vl, vr, s, dif, mm, m,
workspace( tmp_work, tmp_iwork ) );
}
@@ -417,18 +423,24 @@
// 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 ) {
+ if ( job == 'V' || job == 'B' )
+ return std::max< std::ptrdiff_t >(1, 2*n*n);
+ else
+ return std::max< std::ptrdiff_t >(1, n);
}
//
// 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 ) {
+ if ( job == 'E')
+ return 1;
+ else
+ return n+2;
}
};
Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmrz.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmrz.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmrz.hpp 2010-07-10 18:23:07 EDT (Sat, 10 Jul 2010)
@@ -18,6 +18,7 @@
#include <boost/numeric/bindings/begin.hpp>
#include <boost/numeric/bindings/data_order.hpp>
#include <boost/numeric/bindings/detail/array.hpp>
+#include <boost/numeric/bindings/detail/if_left.hpp>
#include <boost/numeric/bindings/is_mutable.hpp>
#include <boost/numeric/bindings/lapack/workspace.hpp>
#include <boost/numeric/bindings/remove_imaginary.hpp>
@@ -121,7 +122,8 @@
BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixC >::value) );
BOOST_ASSERT( bindings::size(tau) >= k );
BOOST_ASSERT( bindings::size(work.select(value_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
+ min_size_work( side, bindings::size_row(c),
+ bindings::size_column(c) ));
BOOST_ASSERT( bindings::size_column(c) >= 0 );
BOOST_ASSERT( bindings::size_minor(a) == 1 ||
bindings::stride_minor(a) == 1 );
@@ -156,8 +158,8 @@
namespace bindings = ::boost::numeric::bindings;
typedef typename result_of::data_order< MatrixC >::type order;
typedef typename result_of::trans_tag< MatrixA, order >::type trans;
- bindings::detail::array< value_type > tmp_work( min_size_work(
- $CALL_MIN_SIZE ) );
+ bindings::detail::array< value_type > tmp_work( min_size_work( side,
+ bindings::size_row(c), bindings::size_column(c) ) );
return invoke( side, k, a, tau, c, workspace( tmp_work ) );
}
@@ -191,9 +193,11 @@
// 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
+ template< typename Side >
+ static std::ptrdiff_t min_size_work( const Side side,
+ const std::ptrdiff_t m, const std::ptrdiff_t n ) {
+ return std::max< std::ptrdiff_t >( 1, bindings::detail::if_left( side,
+ n, m ) );
}
};
Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/upmtr.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/upmtr.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/upmtr.hpp 2010-07-10 18:23:07 EDT (Sat, 10 Jul 2010)
@@ -17,6 +17,7 @@
#include <boost/assert.hpp>
#include <boost/numeric/bindings/begin.hpp>
#include <boost/numeric/bindings/detail/array.hpp>
+#include <boost/numeric/bindings/detail/if_left.hpp>
#include <boost/numeric/bindings/is_column_major.hpp>
#include <boost/numeric/bindings/is_mutable.hpp>
#include <boost/numeric/bindings/lapack/workspace.hpp>
@@ -114,7 +115,8 @@
MatrixC >::type >::type >::value) );
BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixC >::value) );
BOOST_ASSERT( bindings::size(work.select(value_type())) >=
- min_size_work( $CALL_MIN_SIZE ));
+ min_size_work( side, bindings::size_row(c),
+ bindings::size_column(c) ));
BOOST_ASSERT( bindings::size_column(c) >= 0 );
BOOST_ASSERT( bindings::size_minor(c) == 1 ||
bindings::stride_minor(c) == 1 );
@@ -141,8 +143,8 @@
const VectorAP& ap, const VectorTAU& tau, MatrixC& c,
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( side,
+ bindings::size_row(c), bindings::size_column(c) ) );
return invoke( side, uplo, ap, tau, c, workspace( tmp_work ) );
}
@@ -166,8 +168,9 @@
// Static member function that returns the minimum size of
// workspace-array work.
//
- template< $TYPES >
- static std::ptrdiff_t min_size_work( $ARGUMENTS ) {
+ template< typename Side >
+ static std::ptrdiff_t min_size_work( const Side side,
+ const std::ptrdiff_t m, const std::ptrdiff_t n ) {
$MIN_SIZE_IMPLEMENTATION
}
};
Added: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/ggbal.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/ggbal.hpp 2010-07-10 18:23:07 EDT (Sat, 10 Jul 2010)
@@ -0,0 +1,8 @@
+$TEMPLATE[ggbal.all.min_size_work.args]
+JOB,N
+$TEMPLATE[ggbal.all.min_size_work]
+if ( job == 'S' || job == 'B' )
+ return std::max< $INTEGER_TYPE >(1, 6*n);
+else // if ( job == 'N' || job == 'P' )
+ return 1;
+$TEMPLATE[end]
Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/orm.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/orm.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/orm.hpp 2010-07-10 18:23:07 EDT (Sat, 10 Jul 2010)
@@ -24,6 +24,12 @@
#include <boost/numeric/bindings/detail/if_left.hpp>
$TEMPLATE[ormrq.all.min_size_work]
return std::max< $INTEGER_TYPE >( 1, bindings::detail::if_left( side, n, m ) );
+$TEMPLATE[ormrz.all.min_size_work.args]
+SIDE,M,N
+$TEMPLATE[ormrz.includes]
+#include <boost/numeric/bindings/detail/if_left.hpp>
+$TEMPLATE[ormrz.all.min_size_work]
+return std::max< $INTEGER_TYPE >( 1, bindings::detail::if_left( side, n, m ) );
$TEMPLATE[ormtr.all.min_size_work.args]
SIDE,M,N
$TEMPLATE[ormtr.includes]
Added: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgsen.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgsen.hpp 2010-07-10 18:23:07 EDT (Sat, 10 Jul 2010)
@@ -0,0 +1,29 @@
+$TEMPLATE[tgsen.all.min_size_work.args]
+IJOB,N,SELECT
+$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
+$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 )
+ return std::max< $INTEGER_TYPE >(2*m*(n-m), n+2);
+$TEMPLATE[end]
Added: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgsna.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/tgsna.hpp 2010-07-10 18:23:07 EDT (Sat, 10 Jul 2010)
@@ -0,0 +1,25 @@
+$TEMPLATE[tgsna.all.min_size_work.args]
+JOB,N
+$TEMPLATE[tgsna.real.min_size_work]
+if ( job == 'V' || job == 'B' )
+ return std::max< $INTEGER_TYPE >(1, 2*n*(n+2)+16);
+else
+ return std::max< $INTEGER_TYPE >(1, n);
+$TEMPLATE[tgsna.complex.min_size_work]
+if ( job == 'V' || job == 'B' )
+ return std::max< $INTEGER_TYPE >(1, 2*n*n);
+else
+ return std::max< $INTEGER_TYPE >(1, n);
+$TEMPLATE[tgsna.all.min_size_iwork.args]
+JOB,N
+$TEMPLATE[tgsna.real.min_size_iwork]
+if ( job == 'E')
+ return 1;
+else
+ return n+6;
+$TEMPLATE[tgsna.complex.min_size_iwork]
+if ( job == 'E')
+ return 1;
+else
+ return n+2;
+$TEMPLATE[end]
Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/un.hpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/un.hpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/un.hpp 2010-07-10 18:23:07 EDT (Sat, 10 Jul 2010)
@@ -62,6 +62,12 @@
#include <boost/numeric/bindings/detail/if_left.hpp>
$TEMPLATE[unmrq.all.min_size_work]
return std::max< $INTEGER_TYPE >( 1, bindings::detail::if_left( side, n, m ) );
+$TEMPLATE[unmrz.all.min_size_work.args]
+SIDE,M,N
+$TEMPLATE[unmrz.includes]
+#include <boost/numeric/bindings/detail/if_left.hpp>
+$TEMPLATE[unmrz.all.min_size_work]
+return std::max< $INTEGER_TYPE >( 1, bindings::detail::if_left( side, n, m ) );
$TEMPLATE[unmql.all.min_size_work.args]
SIDE,M,N
$TEMPLATE[unmql.includes]
Added: sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/upmtr.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/templates/computational/upmtr.hpp 2010-07-10 18:23:07 EDT (Sat, 10 Jul 2010)
@@ -0,0 +1,6 @@
+$TEMPLATE[upmtr.all.min_size_work.args]
+SIDE,M,N
+$TEMPLATE[upmtr.includes]
+#include <boost/numeric/bindings/detail/if_left.hpp>
+$TEMPLATE[upmtr.all.min_size_work]
+return std::max< $INTEGER_TYPE >( 1, bindings::detail::if_left( side, n, m ) );
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