Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r64376 - in sandbox/numeric_bindings: boost/numeric/bindings/lapack/computational boost/numeric/bindings/lapack/driver libs/numeric/bindings/doc/lapack/computational libs/numeric/bindings/doc/lapack/driver libs/numeric/bindings/lapack/test libs/numeric/bindings/tools
From: thomas.klimpel_at_[hidden]
Date: 2010-07-26 21:05:30


Author: klimpel
Date: 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
New Revision: 64376
URL: http://svn.boost.org/trac/boost/changeset/64376

Log:
add real symmetric or orthogonal matrices as special cases of complex hermitian or unitary matrices (just lapack for now)
Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hbgst.hpp | 143 +++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hbtrd.hpp | 144 +++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hecon.hpp | 133 ++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hegst.hpp | 30 +
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/herfs.hpp | 190 ++++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetrd.hpp | 144 +++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetrf.hpp | 123 ++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetri.hpp | 115 +++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetrs.hpp | 30 +
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hpcon.hpp | 126 ++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hprfs.hpp | 177 +++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptrd.hpp | 83 +++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptrf.hpp | 26 +
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptri.hpp | 107 +++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptrs.hpp | 30 +
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungbr.hpp | 127 ++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unghr.hpp | 125 ++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unglq.hpp | 123 ++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungql.hpp | 122 ++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungqr.hpp | 122 ++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungrq.hpp | 123 ++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungtr.hpp | 126 ++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmbr.hpp | 157 ++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmhr.hpp | 156 ++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmlq.hpp | 157 ++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmql.hpp | 155 ++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmqr.hpp | 154 ++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmrq.hpp | 157 ++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmrz.hpp | 159 ++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmtr.hpp | 155 ++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/upgtr.hpp | 122 ++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/upmtr.hpp | 141 +++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbev.hpp | 135 ++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbevd.hpp | 305 ++++++++++++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbevx.hpp | 187 ++++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbgv.hpp | 152 ++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbgvd.hpp | 196 ++++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbgvx.hpp | 201 +++++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heev.hpp | 129 ++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heevd.hpp | 162 ++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heevr.hpp | 187 ++++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heevx.hpp | 188 ++++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hegv.hpp | 147 +++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hegvd.hpp | 181 +++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hegvx.hpp | 601 +++++++++++++++++++++++++++++++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hesv.hpp | 140 +++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hesvx.hpp | 213 ++++++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpev.hpp | 126 ++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpevd.hpp | 165 ++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpevx.hpp | 165 ++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpgv.hpp | 137 +++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpgvd.hpp | 181 +++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpgvx.hpp | 575 ++++++++++++++++++++++++++++++++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpsv.hpp | 30 +
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpsvx.hpp | 184 ++++++++++++
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hbgst.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hbtrd.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hecon.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hegst.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/herfs.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetrd.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetrf.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetri.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetrs.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hpcon.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hprfs.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptrd.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptrf.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptri.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptrs.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungbr.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unghr.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unglq.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungql.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungqr.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungrq.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungtr.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmbr.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmhr.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmlq.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmql.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmqr.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmrq.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmrz.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmtr.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/upgtr.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/upmtr.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbev.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbevd.qbk | 13
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbevx.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbgv.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbgvd.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbgvx.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heev.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heevd.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heevr.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heevx.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hegv.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hegvd.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hegvx.qbk | 16
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hesv.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hesvx.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpev.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpevd.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpevx.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpgv.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpgvd.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpgvx.qbk | 16
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpsv.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpsvx.qbk | 6
   sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_geqrf.cpp | 36 --
   sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hbev.cpp | 28 -
   sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hbevx.cpp | 42 --
   sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_heevd.cpp | 24 -
   sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_heevx.cpp | 41 --
   sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hegv.cpp | 28 -
   sandbox/numeric_bindings/libs/numeric/bindings/tools/bindings.py | 6
   sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py | 35 +
   118 files changed, 8917 insertions(+), 349 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hbgst.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hbgst.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hbgst.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hbgst is the netlib-compatible backend.
@@ -50,6 +53,40 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbgst( const char vect, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t ka, const fortran_int_t kb,
+ float* ab, const fortran_int_t ldab, const float* bb,
+ const fortran_int_t ldbb, float* x, const fortran_int_t ldx,
+ float* work ) {
+ fortran_int_t info(0);
+ LAPACK_SSBGST( &vect, &lapack_option< UpLo >::value, &n, &ka, &kb, ab,
+ &ldab, bb, &ldbb, x, &ldx, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbgst( const char vect, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t ka, const fortran_int_t kb,
+ double* ab, const fortran_int_t ldab, const double* bb,
+ const fortran_int_t ldbb, double* x, const fortran_int_t ldx,
+ double* work ) {
+ fortran_int_t info(0);
+ LAPACK_DSBGST( &vect, &lapack_option< UpLo >::value, &n, &ka, &kb, ab,
+ &ldab, bb, &ldbb, x, &ldx, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -89,8 +126,112 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hbgst.
 //
+template< typename Value, typename Enable = void >
+struct hbgst_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hbgst_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAB, typename MatrixBB, typename MatrixX,
+ typename WORK >
+ static std::ptrdiff_t invoke( const char vect, MatrixAB& ab,
+ const MatrixBB& bb, MatrixX& x, detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixBB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixX >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixBB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixX >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixX >::value) );
+ BOOST_ASSERT( bindings::bandwidth(ab, uplo()) >= 0 );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(ab) ));
+ BOOST_ASSERT( bindings::size_column(ab) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(ab) == 1 ||
+ bindings::stride_minor(ab) == 1 );
+ BOOST_ASSERT( bindings::size_minor(bb) == 1 ||
+ bindings::stride_minor(bb) == 1 );
+ BOOST_ASSERT( bindings::size_minor(x) == 1 ||
+ bindings::stride_minor(x) == 1 );
+ BOOST_ASSERT( bindings::stride_major(ab) >= bindings::bandwidth(ab,
+ uplo())+1 );
+ BOOST_ASSERT( bindings::stride_major(bb) >= bindings::bandwidth(bb,
+ uplo())+1 );
+ BOOST_ASSERT( vect == 'N' || vect == 'V' );
+ return detail::hbgst( vect, uplo(), bindings::size_column(ab),
+ bindings::bandwidth(ab, uplo()), bindings::bandwidth(bb,
+ uplo()), bindings::begin_value(ab),
+ bindings::stride_major(ab), bindings::begin_value(bb),
+ bindings::stride_major(bb), bindings::begin_value(x),
+ bindings::stride_major(x),
+ bindings::begin_value(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAB, typename MatrixBB, typename MatrixX >
+ static std::ptrdiff_t invoke( const char vect, MatrixAB& ab,
+ const MatrixBB& bb, MatrixX& x, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(ab) ) );
+ return invoke( vect, ab, bb, x, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAB, typename MatrixBB, typename MatrixX >
+ static std::ptrdiff_t invoke( const char vect, MatrixAB& ab,
+ const MatrixBB& bb, MatrixX& x, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ return invoke( vect, ab, bb, x, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return 2*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hbgst_impl {
+struct hbgst_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hbtrd.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hbtrd.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hbtrd.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hbtrd is the netlib-compatible backend.
@@ -50,6 +53,38 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbtrd( const char vect, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t kd, float* ab,
+ const fortran_int_t ldab, float* d, float* e, float* q,
+ const fortran_int_t ldq, float* work ) {
+ fortran_int_t info(0);
+ LAPACK_SSBTRD( &vect, &lapack_option< UpLo >::value, &n, &kd, ab, &ldab,
+ d, e, q, &ldq, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbtrd( const char vect, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t kd, double* ab,
+ const fortran_int_t ldab, double* d, double* e, double* q,
+ const fortran_int_t ldq, double* work ) {
+ fortran_int_t info(0);
+ LAPACK_DSBTRD( &vect, &lapack_option< UpLo >::value, &n, &kd, ab, &ldab,
+ d, e, q, &ldq, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -87,8 +122,115 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hbtrd.
 //
+template< typename Value, typename Enable = void >
+struct hbtrd_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hbtrd_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAB, typename VectorD, typename VectorE,
+ typename MatrixQ, typename WORK >
+ static std::ptrdiff_t invoke( const char vect, MatrixAB& ab, VectorD& d,
+ VectorE& e, MatrixQ& q, detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixQ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorD >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorE >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixQ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorD >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorE >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixQ >::value) );
+ BOOST_ASSERT( bindings::bandwidth(ab, uplo()) >= 0 );
+ BOOST_ASSERT( bindings::size(d) >= bindings::size_column(ab) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(ab) ));
+ BOOST_ASSERT( bindings::size_column(ab) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(ab) == 1 ||
+ bindings::stride_minor(ab) == 1 );
+ BOOST_ASSERT( bindings::size_minor(q) == 1 ||
+ bindings::stride_minor(q) == 1 );
+ BOOST_ASSERT( bindings::stride_major(ab) >= bindings::bandwidth(ab,
+ uplo())+1 );
+ BOOST_ASSERT( vect == 'N' || vect == 'V' || vect == 'U' );
+ return detail::hbtrd( vect, uplo(), bindings::size_column(ab),
+ bindings::bandwidth(ab, uplo()), bindings::begin_value(ab),
+ bindings::stride_major(ab), bindings::begin_value(d),
+ bindings::begin_value(e), bindings::begin_value(q),
+ bindings::stride_major(q),
+ bindings::begin_value(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAB, typename VectorD, typename VectorE,
+ typename MatrixQ >
+ static std::ptrdiff_t invoke( const char vect, MatrixAB& ab, VectorD& d,
+ VectorE& e, MatrixQ& q, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(ab) ) );
+ return invoke( vect, ab, d, e, q, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAB, typename VectorD, typename VectorE,
+ typename MatrixQ >
+ static std::ptrdiff_t invoke( const char vect, MatrixAB& ab, VectorD& d,
+ VectorE& e, MatrixQ& q, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ return invoke( vect, ab, d, e, q, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hbtrd_impl {
+struct hbtrd_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hecon.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hecon.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hecon.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hecon is the netlib-compatible backend.
@@ -49,6 +52,37 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hecon( const UpLo uplo, const fortran_int_t n,
+ const float* a, const fortran_int_t lda, const fortran_int_t* ipiv,
+ const float anorm, float& rcond, float* work, fortran_int_t* iwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSYCON( &lapack_option< UpLo >::value, &n, a, &lda, ipiv, &anorm,
+ &rcond, work, iwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hecon( const UpLo uplo, const fortran_int_t n,
+ const double* a, const fortran_int_t lda, const fortran_int_t* ipiv,
+ const double anorm, double& rcond, double* work,
+ fortran_int_t* iwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSYCON( &lapack_option< UpLo >::value, &n, a, &lda, ipiv, &anorm,
+ &rcond, work, iwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -84,8 +118,105 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hecon.
 //
+template< typename Value, typename Enable = void >
+struct hecon_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hecon_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorIPIV, typename WORK,
+ typename IWORK >
+ static std::ptrdiff_t invoke( const MatrixA& a, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, detail::workspace2< WORK,
+ IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_ASSERT( bindings::size(ipiv) >= bindings::size_column(a) );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( bindings::size_column(a) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ 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 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ return detail::hecon( uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(ipiv), anorm, rcond,
+ bindings::begin_value(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorIPIV >
+ static std::ptrdiff_t invoke( const MatrixA& a, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(a) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( bindings::size_column(a) ) );
+ return invoke( a, ipiv, anorm, rcond, workspace( tmp_work,
+ tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorIPIV >
+ static std::ptrdiff_t invoke( const MatrixA& a, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ return invoke( a, ipiv, anorm, rcond, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return 2*n;
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t n ) {
+ return n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hecon_impl {
+struct hecon_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hegst.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hegst.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hegst.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -47,6 +47,36 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hegst( const fortran_int_t itype, const UpLo uplo,
+ const fortran_int_t n, float* a, const fortran_int_t lda,
+ const float* b, const fortran_int_t ldb ) {
+ fortran_int_t info(0);
+ LAPACK_SSYGST( &itype, &lapack_option< UpLo >::value, &n, a, &lda, b,
+ &ldb, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hegst( const fortran_int_t itype, const UpLo uplo,
+ const fortran_int_t n, double* a, const fortran_int_t lda,
+ const double* b, const fortran_int_t ldb ) {
+ fortran_int_t info(0);
+ LAPACK_DSYGST( &itype, &lapack_option< UpLo >::value, &n, a, &lda, b,
+ &ldb, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/herfs.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/herfs.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/herfs.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for herfs is the netlib-compatible backend.
@@ -49,6 +52,42 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t herfs( const UpLo uplo, const fortran_int_t n,
+ const fortran_int_t nrhs, const float* a, const fortran_int_t lda,
+ const float* af, const fortran_int_t ldaf, const fortran_int_t* ipiv,
+ const float* b, const fortran_int_t ldb, float* x,
+ const fortran_int_t ldx, float* ferr, float* berr, float* work,
+ fortran_int_t* iwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSYRFS( &lapack_option< UpLo >::value, &n, &nrhs, a, &lda, af,
+ &ldaf, ipiv, b, &ldb, x, &ldx, ferr, berr, work, iwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t herfs( const UpLo uplo, const fortran_int_t n,
+ const fortran_int_t nrhs, const double* a, const fortran_int_t lda,
+ const double* af, const fortran_int_t ldaf, const fortran_int_t* ipiv,
+ const double* b, const fortran_int_t ldb, double* x,
+ const fortran_int_t ldx, double* ferr, double* berr, double* work,
+ fortran_int_t* iwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSYRFS( &lapack_option< UpLo >::value, &n, &nrhs, a, &lda, af,
+ &ldaf, ipiv, b, &ldb, x, &ldx, ferr, berr, work, iwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -90,8 +129,157 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to herfs.
 //
+template< typename Value, typename Enable = void >
+struct herfs_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct herfs_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename MatrixAF, typename VectorIPIV,
+ typename MatrixB, typename MatrixX, typename VectorFERR,
+ typename VectorBERR, typename WORK, typename IWORK >
+ static std::ptrdiff_t invoke( const MatrixA& a, const MatrixAF& af,
+ const VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ VectorFERR& ferr, VectorBERR& berr, detail::workspace2< WORK,
+ IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixAF >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixX >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixAF >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixX >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorFERR >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorBERR >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixX >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorFERR >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorBERR >::value) );
+ BOOST_ASSERT( bindings::size(berr) >= bindings::size_column(b) );
+ BOOST_ASSERT( bindings::size(ipiv) >= bindings::size_column(a) );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( bindings::size_column(a) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(a) ));
+ BOOST_ASSERT( bindings::size_column(a) >= 0 );
+ BOOST_ASSERT( bindings::size_column(b) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::size_minor(af) == 1 ||
+ bindings::stride_minor(af) == 1 );
+ BOOST_ASSERT( bindings::size_minor(b) == 1 ||
+ bindings::stride_minor(b) == 1 );
+ BOOST_ASSERT( bindings::size_minor(x) == 1 ||
+ bindings::stride_minor(x) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(af) >= std::max<
+ std::ptrdiff_t >(1,bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(x) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ return detail::herfs( uplo(), bindings::size_column(a),
+ bindings::size_column(b), bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(af),
+ bindings::stride_major(af), bindings::begin_value(ipiv),
+ bindings::begin_value(b), bindings::stride_major(b),
+ bindings::begin_value(x), bindings::stride_major(x),
+ bindings::begin_value(ferr), bindings::begin_value(berr),
+ bindings::begin_value(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename MatrixAF, typename VectorIPIV,
+ typename MatrixB, typename MatrixX, typename VectorFERR,
+ typename VectorBERR >
+ static std::ptrdiff_t invoke( const MatrixA& a, const MatrixAF& af,
+ const VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ VectorFERR& ferr, VectorBERR& berr, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(a) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( bindings::size_column(a) ) );
+ return invoke( a, af, ipiv, b, x, ferr, berr, workspace( tmp_work,
+ tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename MatrixAF, typename VectorIPIV,
+ typename MatrixB, typename MatrixX, typename VectorFERR,
+ typename VectorBERR >
+ static std::ptrdiff_t invoke( const MatrixA& a, const MatrixAF& af,
+ const VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ VectorFERR& ferr, VectorBERR& berr, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ return invoke( a, af, ipiv, b, x, ferr, berr, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return 3*n;
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t n ) {
+ return n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct herfs_impl {
+struct herfs_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetrd.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetrd.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetrd.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hetrd is the netlib-compatible backend.
@@ -50,6 +53,36 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hetrd( const UpLo uplo, const fortran_int_t n, float* a,
+ const fortran_int_t lda, float* d, float* e, float* tau, float* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSYTRD( &lapack_option< UpLo >::value, &n, a, &lda, d, e, tau,
+ work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hetrd( const UpLo uplo, const fortran_int_t n, double* a,
+ const fortran_int_t lda, double* d, double* e, double* tau,
+ double* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSYTRD( &lapack_option< UpLo >::value, &n, a, &lda, d, e, tau,
+ work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -85,8 +118,117 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hetrd.
 //
+template< typename Value, typename Enable = void >
+struct hetrd_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hetrd_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorD, typename VectorE,
+ typename VectorTAU, typename WORK >
+ static std::ptrdiff_t invoke( MatrixA& a, VectorD& d, VectorE& e,
+ VectorTAU& tau, detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorD >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorE >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorD >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorE >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorTAU >::value) );
+ BOOST_ASSERT( bindings::size(d) >= bindings::size_column(a) );
+ BOOST_ASSERT( bindings::size(tau) >= bindings::size_column(a)-1 );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work());
+ BOOST_ASSERT( bindings::size_column(a) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ return detail::hetrd( uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(d), bindings::begin_value(e),
+ bindings::begin_value(tau),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorD, typename VectorE,
+ typename VectorTAU >
+ static std::ptrdiff_t invoke( MatrixA& a, VectorD& d, VectorE& e,
+ VectorTAU& tau, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work() );
+ return invoke( a, d, e, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorD, typename VectorE,
+ typename VectorTAU >
+ static std::ptrdiff_t invoke( MatrixA& a, VectorD& d, VectorE& e,
+ VectorTAU& tau, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ real_type opt_size_work;
+ detail::hetrd( uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(d), bindings::begin_value(e),
+ bindings::begin_value(tau), &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( a, d, e, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work() {
+ return 1;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hetrd_impl {
+struct hetrd_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetrf.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetrf.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetrf.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hetrf is the netlib-compatible backend.
@@ -50,6 +53,36 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hetrf( const UpLo uplo, const fortran_int_t n, float* a,
+ const fortran_int_t lda, fortran_int_t* ipiv, float* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSYTRF( &lapack_option< UpLo >::value, &n, a, &lda, ipiv, work,
+ &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hetrf( const UpLo uplo, const fortran_int_t n, double* a,
+ const fortran_int_t lda, fortran_int_t* ipiv, double* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSYTRF( &lapack_option< UpLo >::value, &n, a, &lda, ipiv, work,
+ &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -83,8 +116,96 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hetrf.
 //
+template< typename Value, typename Enable = void >
+struct hetrf_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hetrf_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorIPIV, typename WORK >
+ static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv,
+ detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIPIV >::value) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work());
+ BOOST_ASSERT( bindings::size_column(a) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ return detail::hetrf( uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(ipiv),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorIPIV >
+ static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv,
+ minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work() );
+ return invoke( a, ipiv, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorIPIV >
+ static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ real_type opt_size_work;
+ detail::hetrf( uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(ipiv), &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( a, ipiv, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work() {
+ return 1;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hetrf_impl {
+struct hetrf_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetri.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetri.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetri.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hetri is the netlib-compatible backend.
@@ -49,6 +52,34 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hetri( const UpLo uplo, const fortran_int_t n, float* a,
+ const fortran_int_t lda, const fortran_int_t* ipiv, float* work ) {
+ fortran_int_t info(0);
+ LAPACK_SSYTRI( &lapack_option< UpLo >::value, &n, a, &lda, ipiv, work,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hetri( const UpLo uplo, const fortran_int_t n, double* a,
+ const fortran_int_t lda, const fortran_int_t* ipiv, double* work ) {
+ fortran_int_t info(0);
+ LAPACK_DSYTRI( &lapack_option< UpLo >::value, &n, a, &lda, ipiv, work,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -82,8 +113,90 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hetri.
 //
+template< typename Value, typename Enable = void >
+struct hetri_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hetri_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorIPIV, typename WORK >
+ static std::ptrdiff_t invoke( MatrixA& a, const VectorIPIV& ipiv,
+ detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_ASSERT( bindings::size(ipiv) >= bindings::size_column(a) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ 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 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ return detail::hetri( uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(ipiv),
+ bindings::begin_value(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorIPIV >
+ static std::ptrdiff_t invoke( MatrixA& a, const VectorIPIV& ipiv,
+ minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(a) ) );
+ return invoke( a, ipiv, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorIPIV >
+ static std::ptrdiff_t invoke( MatrixA& a, const VectorIPIV& ipiv,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ return invoke( a, ipiv, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hetri_impl {
+struct hetri_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetrs.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetrs.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hetrs.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -47,6 +47,36 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hetrs( const UpLo uplo, const fortran_int_t n,
+ const fortran_int_t nrhs, const float* a, const fortran_int_t lda,
+ const fortran_int_t* ipiv, float* b, const fortran_int_t ldb ) {
+ fortran_int_t info(0);
+ LAPACK_SSYTRS( &lapack_option< UpLo >::value, &n, &nrhs, a, &lda, ipiv, b,
+ &ldb, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hetrs( const UpLo uplo, const fortran_int_t n,
+ const fortran_int_t nrhs, const double* a, const fortran_int_t lda,
+ const fortran_int_t* ipiv, double* b, const fortran_int_t ldb ) {
+ fortran_int_t info(0);
+ LAPACK_DSYTRS( &lapack_option< UpLo >::value, &n, &nrhs, a, &lda, ipiv, b,
+ &ldb, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hpcon.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hpcon.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hpcon.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,9 @@
 #include <boost/assert.hpp>
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -27,6 +29,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hpcon is the netlib-compatible backend.
@@ -48,6 +51,36 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpcon( const UpLo uplo, const fortran_int_t n,
+ const float* ap, const fortran_int_t* ipiv, const float anorm,
+ float& rcond, float* work, fortran_int_t* iwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSPCON( &lapack_option< UpLo >::value, &n, ap, ipiv, &anorm,
+ &rcond, work, iwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpcon( const UpLo uplo, const fortran_int_t n,
+ const double* ap, const fortran_int_t* ipiv, const double anorm,
+ double& rcond, double* work, fortran_int_t* iwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSPCON( &lapack_option< UpLo >::value, &n, ap, ipiv, &anorm,
+ &rcond, work, iwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -81,8 +114,99 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hpcon.
 //
+template< typename Value, typename Enable = void >
+struct hpcon_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hpcon_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAP, typename VectorIPIV, typename WORK,
+ typename IWORK >
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, detail::workspace2< WORK,
+ IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ BOOST_ASSERT( bindings::size(ipiv) >= bindings::size_column(ap) );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( bindings::size_column(ap) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(ap) ));
+ BOOST_ASSERT( bindings::size_column(ap) >= 0 );
+ return detail::hpcon( uplo(), bindings::size_column(ap),
+ bindings::begin_value(ap), bindings::begin_value(ipiv), anorm,
+ rcond, bindings::begin_value(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAP, typename VectorIPIV >
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(ap) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( bindings::size_column(ap) ) );
+ return invoke( ap, ipiv, anorm, rcond, workspace( tmp_work,
+ tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAP, typename VectorIPIV >
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const VectorIPIV& ipiv,
+ const real_type anorm, real_type& rcond, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ return invoke( ap, ipiv, anorm, rcond, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return 2*n;
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t n ) {
+ return n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hpcon_impl {
+struct hpcon_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hprfs.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hprfs.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hprfs.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hprfs is the netlib-compatible backend.
@@ -49,6 +52,40 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hprfs( const UpLo uplo, const fortran_int_t n,
+ const fortran_int_t nrhs, const float* ap, const float* afp,
+ const fortran_int_t* ipiv, const float* b, const fortran_int_t ldb,
+ float* x, const fortran_int_t ldx, float* ferr, float* berr,
+ float* work, fortran_int_t* iwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSPRFS( &lapack_option< UpLo >::value, &n, &nrhs, ap, afp, ipiv, b,
+ &ldb, x, &ldx, ferr, berr, work, iwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hprfs( const UpLo uplo, const fortran_int_t n,
+ const fortran_int_t nrhs, const double* ap, const double* afp,
+ const fortran_int_t* ipiv, const double* b, const fortran_int_t ldb,
+ double* x, const fortran_int_t ldx, double* ferr, double* berr,
+ double* work, fortran_int_t* iwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSPRFS( &lapack_option< UpLo >::value, &n, &nrhs, ap, afp, ipiv, b,
+ &ldb, x, &ldx, ferr, berr, work, iwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -88,8 +125,146 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hprfs.
 //
+template< typename Value, typename Enable = void >
+struct hprfs_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hprfs_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAP, typename MatrixAFP, typename VectorIPIV,
+ typename MatrixB, typename MatrixX, typename VectorFERR,
+ typename VectorBERR, typename WORK, typename IWORK >
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const MatrixAFP& afp,
+ const VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ VectorFERR& ferr, VectorBERR& berr, detail::workspace2< WORK,
+ IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixX >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixAFP >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixX >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorFERR >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorBERR >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixX >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorFERR >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorBERR >::value) );
+ BOOST_ASSERT( bindings::size(berr) >= bindings::size_column(b) );
+ BOOST_ASSERT( bindings::size(ipiv) >= bindings::size_column(ap) );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( bindings::size_column(ap) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(ap) ));
+ BOOST_ASSERT( bindings::size_column(ap) >= 0 );
+ BOOST_ASSERT( bindings::size_column(b) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(b) == 1 ||
+ bindings::stride_minor(b) == 1 );
+ BOOST_ASSERT( bindings::size_minor(x) == 1 ||
+ bindings::stride_minor(x) == 1 );
+ BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(ap)) );
+ BOOST_ASSERT( bindings::stride_major(x) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(ap)) );
+ return detail::hprfs( uplo(), bindings::size_column(ap),
+ bindings::size_column(b), bindings::begin_value(ap),
+ bindings::begin_value(afp), bindings::begin_value(ipiv),
+ bindings::begin_value(b), bindings::stride_major(b),
+ bindings::begin_value(x), bindings::stride_major(x),
+ bindings::begin_value(ferr), bindings::begin_value(berr),
+ bindings::begin_value(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAP, typename MatrixAFP, typename VectorIPIV,
+ typename MatrixB, typename MatrixX, typename VectorFERR,
+ typename VectorBERR >
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const MatrixAFP& afp,
+ const VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ VectorFERR& ferr, VectorBERR& berr, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(ap) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( bindings::size_column(ap) ) );
+ return invoke( ap, afp, ipiv, b, x, ferr, berr, workspace( tmp_work,
+ tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAP, typename MatrixAFP, typename VectorIPIV,
+ typename MatrixB, typename MatrixX, typename VectorFERR,
+ typename VectorBERR >
+ static std::ptrdiff_t invoke( const MatrixAP& ap, const MatrixAFP& afp,
+ const VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ VectorFERR& ferr, VectorBERR& berr, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ return invoke( ap, afp, ipiv, b, x, ferr, berr, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return 3*n;
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t n ) {
+ return n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hprfs_impl {
+struct hprfs_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptrd.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptrd.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptrd.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,9 @@
 
 #include <boost/assert.hpp>
 #include <boost/numeric/bindings/begin.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
 #include <boost/numeric/bindings/stride.hpp>
@@ -25,6 +27,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hptrd is the netlib-compatible backend.
@@ -46,6 +49,32 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hptrd( const UpLo uplo, const fortran_int_t n, float* ap,
+ float* d, float* e, float* tau ) {
+ fortran_int_t info(0);
+ LAPACK_SSPTRD( &lapack_option< UpLo >::value, &n, ap, d, e, tau, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hptrd( const UpLo uplo, const fortran_int_t n,
+ double* ap, double* d, double* e, double* tau ) {
+ fortran_int_t info(0);
+ LAPACK_DSPTRD( &lapack_option< UpLo >::value, &n, ap, d, e, tau, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -77,8 +106,60 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hptrd.
 //
+template< typename Value, typename Enable = void >
+struct hptrd_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hptrd_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAP, typename VectorD, typename VectorE,
+ typename VectorTAU >
+ static std::ptrdiff_t invoke( MatrixAP& ap, VectorD& d, VectorE& e,
+ VectorTAU& tau ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorD >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorE >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAP >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorD >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorE >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorTAU >::value) );
+ BOOST_ASSERT( bindings::size(d) >= bindings::size_column(ap) );
+ BOOST_ASSERT( bindings::size(tau) >= bindings::size_column(ap)-1 );
+ BOOST_ASSERT( bindings::size_column(ap) >= 0 );
+ return detail::hptrd( uplo(), bindings::size_column(ap),
+ bindings::begin_value(ap), bindings::begin_value(d),
+ bindings::begin_value(e), bindings::begin_value(tau) );
+ }
+
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hptrd_impl {
+struct hptrd_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptrf.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptrf.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptrf.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -46,6 +46,32 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hptrf( const UpLo uplo, const fortran_int_t n, float* ap,
+ fortran_int_t* ipiv ) {
+ fortran_int_t info(0);
+ LAPACK_SSPTRF( &lapack_option< UpLo >::value, &n, ap, ipiv, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hptrf( const UpLo uplo, const fortran_int_t n,
+ double* ap, fortran_int_t* ipiv ) {
+ fortran_int_t info(0);
+ LAPACK_DSPTRF( &lapack_option< UpLo >::value, &n, ap, ipiv, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptri.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptri.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptri.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,9 @@
 #include <boost/assert.hpp>
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -27,6 +29,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hptri is the netlib-compatible backend.
@@ -48,6 +51,32 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hptri( const UpLo uplo, const fortran_int_t n, float* ap,
+ const fortran_int_t* ipiv, float* work ) {
+ fortran_int_t info(0);
+ LAPACK_SSPTRI( &lapack_option< UpLo >::value, &n, ap, ipiv, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hptri( const UpLo uplo, const fortran_int_t n,
+ double* ap, const fortran_int_t* ipiv, double* work ) {
+ fortran_int_t info(0);
+ LAPACK_DSPTRI( &lapack_option< UpLo >::value, &n, ap, ipiv, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -79,8 +108,84 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hptri.
 //
+template< typename Value, typename Enable = void >
+struct hptri_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hptri_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAP, typename VectorIPIV, typename WORK >
+ static std::ptrdiff_t invoke( MatrixAP& ap, const VectorIPIV& ipiv,
+ detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAP >::value) );
+ BOOST_ASSERT( bindings::size(ipiv) >= bindings::size_column(ap) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(ap) ));
+ BOOST_ASSERT( bindings::size_column(ap) >= 0 );
+ return detail::hptri( uplo(), bindings::size_column(ap),
+ bindings::begin_value(ap), bindings::begin_value(ipiv),
+ bindings::begin_value(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAP, typename VectorIPIV >
+ static std::ptrdiff_t invoke( MatrixAP& ap, const VectorIPIV& ipiv,
+ minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(ap) ) );
+ return invoke( ap, ipiv, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAP, typename VectorIPIV >
+ static std::ptrdiff_t invoke( MatrixAP& ap, const VectorIPIV& ipiv,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ return invoke( ap, ipiv, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hptri_impl {
+struct hptri_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptrs.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptrs.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/hptrs.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -47,6 +47,36 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hptrs( const UpLo uplo, const fortran_int_t n,
+ const fortran_int_t nrhs, const float* ap, const fortran_int_t* ipiv,
+ float* b, const fortran_int_t ldb ) {
+ fortran_int_t info(0);
+ LAPACK_SSPTRS( &lapack_option< UpLo >::value, &n, &nrhs, ap, ipiv, b,
+ &ldb, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hptrs( const UpLo uplo, const fortran_int_t n,
+ const fortran_int_t nrhs, const double* ap, const fortran_int_t* ipiv,
+ double* b, const fortran_int_t ldb ) {
+ fortran_int_t info(0);
+ LAPACK_DSPTRS( &lapack_option< UpLo >::value, &n, &nrhs, ap, ipiv, b,
+ &ldb, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungbr.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungbr.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungbr.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for ungbr is the netlib-compatible backend.
@@ -49,6 +52,34 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+inline std::ptrdiff_t ungbr( const char vect, const fortran_int_t m,
+ const fortran_int_t n, const fortran_int_t k, float* a,
+ const fortran_int_t lda, const float* tau, float* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SORGBR( &vect, &m, &n, &k, a, &lda, tau, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+inline std::ptrdiff_t ungbr( const char vect, const fortran_int_t m,
+ const fortran_int_t n, const fortran_int_t k, double* a,
+ const fortran_int_t lda, const double* tau, double* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DORGBR( &vect, &m, &n, &k, a, &lda, tau, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 inline std::ptrdiff_t ungbr( const char vect, const fortran_int_t m,
@@ -80,8 +111,102 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to ungbr.
 //
+template< typename Value, typename Enable = void >
+struct ungbr_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct ungbr_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorTAU, typename WORK >
+ static std::ptrdiff_t invoke( const char vect, const fortran_int_t m,
+ const fortran_int_t n, const fortran_int_t k, MatrixA& a,
+ const VectorTAU& tau, detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( m, n ));
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ m) );
+ BOOST_ASSERT( k >= 0 );
+ BOOST_ASSERT( m >= 0 );
+ BOOST_ASSERT( vect == 'Q' || vect == 'P' );
+ return detail::ungbr( vect, m, n, k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorTAU >
+ static std::ptrdiff_t invoke( const char vect, const fortran_int_t m,
+ const fortran_int_t n, const fortran_int_t k, MatrixA& a,
+ const VectorTAU& tau, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ bindings::detail::array< real_type > tmp_work( min_size_work( m, n ) );
+ return invoke( vect, m, n, k, a, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorTAU >
+ static std::ptrdiff_t invoke( const char vect, const fortran_int_t m,
+ const fortran_int_t n, const fortran_int_t k, MatrixA& a,
+ const VectorTAU& tau, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ real_type opt_size_work;
+ detail::ungbr( vect, m, n, k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( vect, m, n, k, a, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t m,
+ const std::ptrdiff_t n ) {
+ return std::max< std::ptrdiff_t >( 1, std::min< std::ptrdiff_t >( m,
+ n ) );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct ungbr_impl {
+struct ungbr_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unghr.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unghr.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unghr.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for unghr is the netlib-compatible backend.
@@ -49,6 +52,32 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+inline std::ptrdiff_t unghr( const fortran_int_t n, const fortran_int_t ilo,
+ const fortran_int_t ihi, float* a, const fortran_int_t lda,
+ const float* tau, float* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SORGHR( &n, &ilo, &ihi, a, &lda, tau, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+inline std::ptrdiff_t unghr( const fortran_int_t n, const fortran_int_t ilo,
+ const fortran_int_t ihi, double* a, const fortran_int_t lda,
+ const double* tau, double* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DORGHR( &n, &ilo, &ihi, a, &lda, tau, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 inline std::ptrdiff_t unghr( const fortran_int_t n, const fortran_int_t ilo,
@@ -80,8 +109,102 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to unghr.
 //
+template< typename Value, typename Enable = void >
+struct unghr_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct unghr_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorTAU, typename WORK >
+ static std::ptrdiff_t invoke( const fortran_int_t n,
+ const fortran_int_t ilo, const fortran_int_t ihi,
+ MatrixA& a, const VectorTAU& tau, detail::workspace1<
+ WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_ASSERT( bindings::size(tau) >= n-1 );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( ihi, ilo ));
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ n) );
+ BOOST_ASSERT( n >= 0 );
+ return detail::unghr( n, ilo, ihi, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorTAU >
+ static std::ptrdiff_t invoke( const fortran_int_t n,
+ const fortran_int_t ilo, const fortran_int_t ihi,
+ MatrixA& a, const VectorTAU& tau, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ bindings::detail::array< real_type > tmp_work( min_size_work( ihi,
+ ilo ) );
+ return invoke( n, ilo, ihi, a, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorTAU >
+ static std::ptrdiff_t invoke( const fortran_int_t n,
+ const fortran_int_t ilo, const fortran_int_t ihi,
+ MatrixA& a, const VectorTAU& tau, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ real_type opt_size_work;
+ detail::unghr( n, ilo, ihi, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( n, ilo, ihi, a, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t ihi,
+ const std::ptrdiff_t ilo ) {
+ return ihi-ilo;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct unghr_impl {
+struct unghr_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unglq.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unglq.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unglq.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for unglq is the netlib-compatible backend.
@@ -49,6 +52,32 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+inline std::ptrdiff_t unglq( const fortran_int_t m, const fortran_int_t n,
+ const fortran_int_t k, float* a, const fortran_int_t lda,
+ const float* tau, float* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SORGLQ( &m, &n, &k, a, &lda, tau, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+inline std::ptrdiff_t unglq( const fortran_int_t m, const fortran_int_t n,
+ const fortran_int_t k, double* a, const fortran_int_t lda,
+ const double* tau, double* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DORGLQ( &m, &n, &k, a, &lda, tau, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 inline std::ptrdiff_t unglq( const fortran_int_t m, const fortran_int_t n,
@@ -80,8 +109,100 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to unglq.
 //
+template< typename Value, typename Enable = void >
+struct unglq_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct unglq_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorTAU, typename WORK >
+ static std::ptrdiff_t invoke( const fortran_int_t m,
+ const fortran_int_t n, const fortran_int_t k, MatrixA& a,
+ const VectorTAU& tau, detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_ASSERT( bindings::size(tau) >= k );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( m ));
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ m) );
+ BOOST_ASSERT( m >= 0 );
+ BOOST_ASSERT( n >= m );
+ return detail::unglq( m, n, k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorTAU >
+ static std::ptrdiff_t invoke( const fortran_int_t m,
+ const fortran_int_t n, const fortran_int_t k, MatrixA& a,
+ const VectorTAU& tau, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ bindings::detail::array< real_type > tmp_work( min_size_work( m ) );
+ return invoke( m, n, k, a, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorTAU >
+ static std::ptrdiff_t invoke( const fortran_int_t m,
+ const fortran_int_t n, const fortran_int_t k, MatrixA& a,
+ const VectorTAU& tau, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ real_type opt_size_work;
+ detail::unglq( m, n, k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( m, n, k, a, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t m ) {
+ return std::max< std::ptrdiff_t >( 1, m );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct unglq_impl {
+struct unglq_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungql.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungql.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungql.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for ungql is the netlib-compatible backend.
@@ -49,6 +52,32 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+inline std::ptrdiff_t ungql( const fortran_int_t m, const fortran_int_t n,
+ const fortran_int_t k, float* a, const fortran_int_t lda,
+ const float* tau, float* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SORGQL( &m, &n, &k, a, &lda, tau, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+inline std::ptrdiff_t ungql( const fortran_int_t m, const fortran_int_t n,
+ const fortran_int_t k, double* a, const fortran_int_t lda,
+ const double* tau, double* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DORGQL( &m, &n, &k, a, &lda, tau, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 inline std::ptrdiff_t ungql( const fortran_int_t m, const fortran_int_t n,
@@ -80,8 +109,99 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to ungql.
 //
+template< typename Value, typename Enable = void >
+struct ungql_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct ungql_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorTAU, typename WORK >
+ static std::ptrdiff_t invoke( const fortran_int_t m,
+ const fortran_int_t n, const fortran_int_t k, MatrixA& a,
+ const VectorTAU& tau, detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_ASSERT( bindings::size(tau) >= k );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( n ));
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ m) );
+ BOOST_ASSERT( m >= 0 );
+ return detail::ungql( m, n, k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorTAU >
+ static std::ptrdiff_t invoke( const fortran_int_t m,
+ const fortran_int_t n, const fortran_int_t k, MatrixA& a,
+ const VectorTAU& tau, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ bindings::detail::array< real_type > tmp_work( min_size_work( n ) );
+ return invoke( m, n, k, a, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorTAU >
+ static std::ptrdiff_t invoke( const fortran_int_t m,
+ const fortran_int_t n, const fortran_int_t k, MatrixA& a,
+ const VectorTAU& tau, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ real_type opt_size_work;
+ detail::ungql( m, n, k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( m, n, k, a, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return std::max< std::ptrdiff_t >( 1, n );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct ungql_impl {
+struct ungql_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungqr.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungqr.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungqr.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for ungqr is the netlib-compatible backend.
@@ -49,6 +52,32 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+inline std::ptrdiff_t ungqr( const fortran_int_t m, const fortran_int_t n,
+ const fortran_int_t k, float* a, const fortran_int_t lda,
+ const float* tau, float* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SORGQR( &m, &n, &k, a, &lda, tau, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+inline std::ptrdiff_t ungqr( const fortran_int_t m, const fortran_int_t n,
+ const fortran_int_t k, double* a, const fortran_int_t lda,
+ const double* tau, double* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DORGQR( &m, &n, &k, a, &lda, tau, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 inline std::ptrdiff_t ungqr( const fortran_int_t m, const fortran_int_t n,
@@ -80,8 +109,99 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to ungqr.
 //
+template< typename Value, typename Enable = void >
+struct ungqr_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct ungqr_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorTAU, typename WORK >
+ static std::ptrdiff_t invoke( MatrixA& a, const VectorTAU& tau,
+ detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_ASSERT( bindings::size(tau) >= bindings::size(tau) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(a) ));
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::size_row(a) >= 0 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_row(a)) );
+ return detail::ungqr( bindings::size_row(a), bindings::size_column(a),
+ bindings::size(tau), bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorTAU >
+ static std::ptrdiff_t invoke( MatrixA& a, const VectorTAU& tau,
+ minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(a) ) );
+ return invoke( a, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorTAU >
+ static std::ptrdiff_t invoke( MatrixA& a, const VectorTAU& tau,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ real_type opt_size_work;
+ detail::ungqr( bindings::size_row(a), bindings::size_column(a),
+ bindings::size(tau), bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( a, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return std::max< std::ptrdiff_t >( 1, n );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct ungqr_impl {
+struct ungqr_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungrq.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungrq.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungrq.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for ungrq is the netlib-compatible backend.
@@ -49,6 +52,32 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+inline std::ptrdiff_t ungrq( const fortran_int_t m, const fortran_int_t n,
+ const fortran_int_t k, float* a, const fortran_int_t lda,
+ const float* tau, float* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SORGRQ( &m, &n, &k, a, &lda, tau, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+inline std::ptrdiff_t ungrq( const fortran_int_t m, const fortran_int_t n,
+ const fortran_int_t k, double* a, const fortran_int_t lda,
+ const double* tau, double* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DORGRQ( &m, &n, &k, a, &lda, tau, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 inline std::ptrdiff_t ungrq( const fortran_int_t m, const fortran_int_t n,
@@ -80,8 +109,100 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to ungrq.
 //
+template< typename Value, typename Enable = void >
+struct ungrq_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct ungrq_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorTAU, typename WORK >
+ static std::ptrdiff_t invoke( const fortran_int_t m,
+ const fortran_int_t n, const fortran_int_t k, MatrixA& a,
+ const VectorTAU& tau, detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_ASSERT( bindings::size(tau) >= k );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( m ));
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ m) );
+ BOOST_ASSERT( m >= 0 );
+ BOOST_ASSERT( n >= m );
+ return detail::ungrq( m, n, k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorTAU >
+ static std::ptrdiff_t invoke( const fortran_int_t m,
+ const fortran_int_t n, const fortran_int_t k, MatrixA& a,
+ const VectorTAU& tau, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ bindings::detail::array< real_type > tmp_work( min_size_work( m ) );
+ return invoke( m, n, k, a, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorTAU >
+ static std::ptrdiff_t invoke( const fortran_int_t m,
+ const fortran_int_t n, const fortran_int_t k, MatrixA& a,
+ const VectorTAU& tau, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ real_type opt_size_work;
+ detail::ungrq( m, n, k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( m, n, k, a, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t m ) {
+ return std::max< std::ptrdiff_t >( 1, m );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct ungrq_impl {
+struct ungrq_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungtr.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungtr.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/ungtr.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for ungtr is the netlib-compatible backend.
@@ -50,6 +53,36 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t ungtr( const UpLo uplo, const fortran_int_t n, float* a,
+ const fortran_int_t lda, const float* tau, float* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SORGTR( &lapack_option< UpLo >::value, &n, a, &lda, tau, work,
+ &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t ungtr( const UpLo uplo, const fortran_int_t n, double* a,
+ const fortran_int_t lda, const double* tau, double* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DORGTR( &lapack_option< UpLo >::value, &n, a, &lda, tau, work,
+ &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -85,8 +118,99 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to ungtr.
 //
+template< typename Value, typename Enable = void >
+struct ungtr_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct ungtr_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorTAU, typename WORK >
+ static std::ptrdiff_t invoke( const fortran_int_t n, MatrixA& a,
+ const VectorTAU& tau, detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_ASSERT( bindings::size(tau) >= n-1 );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( n ));
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ n) );
+ BOOST_ASSERT( n >= 0 );
+ return detail::ungtr( uplo(), n, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorTAU >
+ static std::ptrdiff_t invoke( const fortran_int_t n, MatrixA& a,
+ const VectorTAU& tau, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work( n ) );
+ return invoke( n, a, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorTAU >
+ static std::ptrdiff_t invoke( const fortran_int_t n, MatrixA& a,
+ const VectorTAU& tau, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ real_type opt_size_work;
+ detail::ungtr( uplo(), n, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( n, a, tau, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return std::max< std::ptrdiff_t >(1,n-1);
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct ungtr_impl {
+struct ungtr_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmbr.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmbr.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmbr.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #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_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -30,6 +32,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for unmbr is the netlib-compatible backend.
@@ -51,6 +54,42 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t unmbr( const char vect, const Side side,
+ const Trans trans, const fortran_int_t m, const fortran_int_t n,
+ const fortran_int_t k, const float* a, const fortran_int_t lda,
+ const float* tau, float* c, const fortran_int_t ldc, float* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SORMBR( &vect, &lapack_option< Side >::value, &lapack_option<
+ Trans >::value, &m, &n, &k, a, &lda, tau, c, &ldc, work, &lwork,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t unmbr( const char vect, const Side side,
+ const Trans trans, const fortran_int_t m, const fortran_int_t n,
+ const fortran_int_t k, const double* a, const fortran_int_t lda,
+ const double* tau, double* c, const fortran_int_t ldc, double* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DORMBR( &vect, &lapack_option< Side >::value, &lapack_option<
+ Trans >::value, &m, &n, &k, a, &lda, tau, c, &ldc, work, &lwork,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename Side, typename Trans >
@@ -92,8 +131,124 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to unmbr.
 //
+template< typename Value, typename Enable = void >
+struct unmbr_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct unmbr_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC, typename WORK >
+ static std::ptrdiff_t invoke( const char vect, const Side side,
+ const fortran_int_t k, const MatrixA& a, const VectorTAU& tau,
+ MatrixC& c, detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixC >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixC >::value) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ 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 );
+ BOOST_ASSERT( bindings::size_minor(c) == 1 ||
+ bindings::stride_minor(c) == 1 );
+ BOOST_ASSERT( bindings::size_row(c) >= 0 );
+ BOOST_ASSERT( bindings::stride_major(c) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_row(c)) );
+ BOOST_ASSERT( k >= 0 );
+ BOOST_ASSERT( vect == 'Q' || vect == 'P' );
+ return detail::unmbr( vect, side, trans(), bindings::size_row(c),
+ bindings::size_column(c), k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(c), bindings::stride_major(c),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const char vect, const Side side,
+ const fortran_int_t k, const MatrixA& a, const VectorTAU& tau,
+ MatrixC& c, minimal_workspace ) {
+ 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( side,
+ bindings::size_row(c), bindings::size_column(c) ) );
+ return invoke( vect, side, k, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const char vect, const Side side,
+ const fortran_int_t k, const MatrixA& a, const VectorTAU& tau,
+ MatrixC& c, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ real_type opt_size_work;
+ detail::unmbr( vect, side, trans(), bindings::size_row(c),
+ bindings::size_column(c), k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(c), bindings::stride_major(c),
+ &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( vect, side, k, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ 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 ) );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct unmbr_impl {
+struct unmbr_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmhr.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmhr.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmhr.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #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_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -30,6 +32,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for unmhr is the netlib-compatible backend.
@@ -51,6 +54,42 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t unmhr( const Side side, const Trans trans,
+ const fortran_int_t m, const fortran_int_t n, const fortran_int_t ilo,
+ const fortran_int_t ihi, const float* a, const fortran_int_t lda,
+ const float* tau, float* c, const fortran_int_t ldc, float* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SORMHR( &lapack_option< Side >::value, &lapack_option<
+ Trans >::value, &m, &n, &ilo, &ihi, a, &lda, tau, c, &ldc, work,
+ &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t unmhr( const Side side, const Trans trans,
+ const fortran_int_t m, const fortran_int_t n, const fortran_int_t ilo,
+ const fortran_int_t ihi, const double* a, const fortran_int_t lda,
+ const double* tau, double* c, const fortran_int_t ldc, double* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DORMHR( &lapack_option< Side >::value, &lapack_option<
+ Trans >::value, &m, &n, &ilo, &ihi, a, &lda, tau, c, &ldc, work,
+ &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename Side, typename Trans >
@@ -92,8 +131,123 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to unmhr.
 //
+template< typename Value, typename Enable = void >
+struct unmhr_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct unmhr_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC, typename WORK >
+ static std::ptrdiff_t invoke( const Side side, const fortran_int_t ilo,
+ const fortran_int_t ihi, const MatrixA& a,
+ const VectorTAU& tau, MatrixC& c, detail::workspace1<
+ WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixC >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixC >::value) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ 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 );
+ BOOST_ASSERT( bindings::size_minor(c) == 1 ||
+ bindings::stride_minor(c) == 1 );
+ BOOST_ASSERT( bindings::size_row(c) >= 0 );
+ BOOST_ASSERT( bindings::stride_major(c) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_row(c)) );
+ return detail::unmhr( side, trans(), bindings::size_row(c),
+ bindings::size_column(c), ilo, ihi, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(c), bindings::stride_major(c),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const fortran_int_t ilo,
+ const fortran_int_t ihi, const MatrixA& a,
+ const VectorTAU& tau, MatrixC& c, minimal_workspace ) {
+ 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( side,
+ bindings::size_row(c), bindings::size_column(c) ) );
+ return invoke( side, ilo, ihi, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const fortran_int_t ilo,
+ const fortran_int_t ihi, const MatrixA& a,
+ const VectorTAU& tau, MatrixC& c, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ real_type opt_size_work;
+ detail::unmhr( side, trans(), bindings::size_row(c),
+ bindings::size_column(c), ilo, ihi, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(c), bindings::stride_major(c),
+ &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( side, ilo, ihi, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ 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 ) );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct unmhr_impl {
+struct unmhr_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmlq.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmlq.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmlq.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #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_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -30,6 +32,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for unmlq is the netlib-compatible backend.
@@ -51,6 +54,41 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t unmlq( const Side side, const Trans trans,
+ const fortran_int_t m, const fortran_int_t n, const fortran_int_t k,
+ const float* a, const fortran_int_t lda, const float* tau, float* c,
+ const fortran_int_t ldc, float* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SORMLQ( &lapack_option< Side >::value, &lapack_option<
+ Trans >::value, &m, &n, &k, a, &lda, tau, c, &ldc, work, &lwork,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t unmlq( const Side side, const Trans trans,
+ const fortran_int_t m, const fortran_int_t n, const fortran_int_t k,
+ const double* a, const fortran_int_t lda, const double* tau,
+ double* c, const fortran_int_t ldc, double* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DORMLQ( &lapack_option< Side >::value, &lapack_option<
+ Trans >::value, &m, &n, &k, a, &lda, tau, c, &ldc, work, &lwork,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename Side, typename Trans >
@@ -92,8 +130,125 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to unmlq.
 //
+template< typename Value, typename Enable = void >
+struct unmlq_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct unmlq_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC, typename WORK >
+ static std::ptrdiff_t invoke( const Side side, const fortran_int_t k,
+ const MatrixA& a, const VectorTAU& tau, MatrixC& c,
+ detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixC >::type >::type >::value) );
+ 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( 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 );
+ BOOST_ASSERT( bindings::size_minor(c) == 1 ||
+ bindings::stride_minor(c) == 1 );
+ BOOST_ASSERT( bindings::size_row(c) >= 0 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ k) );
+ BOOST_ASSERT( bindings::stride_major(c) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_row(c)) );
+ return detail::unmlq( side, trans(), bindings::size_row(c),
+ bindings::size_column(c), k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(c), bindings::stride_major(c),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const fortran_int_t k,
+ const MatrixA& a, const VectorTAU& tau, MatrixC& c,
+ minimal_workspace ) {
+ 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( side,
+ bindings::size_row(c), bindings::size_column(c) ) );
+ return invoke( side, k, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const fortran_int_t k,
+ const MatrixA& a, const VectorTAU& tau, MatrixC& c,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ real_type opt_size_work;
+ detail::unmlq( side, trans(), bindings::size_row(c),
+ bindings::size_column(c), k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(c), bindings::stride_major(c),
+ &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( side, k, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ 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 ) );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct unmlq_impl {
+struct unmlq_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmql.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmql.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmql.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #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_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -30,6 +32,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for unmql is the netlib-compatible backend.
@@ -51,6 +54,41 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t unmql( const Side side, const Trans trans,
+ const fortran_int_t m, const fortran_int_t n, const fortran_int_t k,
+ const float* a, const fortran_int_t lda, const float* tau, float* c,
+ const fortran_int_t ldc, float* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SORMQL( &lapack_option< Side >::value, &lapack_option<
+ Trans >::value, &m, &n, &k, a, &lda, tau, c, &ldc, work, &lwork,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t unmql( const Side side, const Trans trans,
+ const fortran_int_t m, const fortran_int_t n, const fortran_int_t k,
+ const double* a, const fortran_int_t lda, const double* tau,
+ double* c, const fortran_int_t ldc, double* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DORMQL( &lapack_option< Side >::value, &lapack_option<
+ Trans >::value, &m, &n, &k, a, &lda, tau, c, &ldc, work, &lwork,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename Side, typename Trans >
@@ -92,8 +130,123 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to unmql.
 //
+template< typename Value, typename Enable = void >
+struct unmql_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct unmql_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC, typename WORK >
+ static std::ptrdiff_t invoke( const Side side, const fortran_int_t k,
+ const MatrixA& a, const VectorTAU& tau, MatrixC& c,
+ detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixC >::type >::type >::value) );
+ 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( 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 );
+ BOOST_ASSERT( bindings::size_minor(c) == 1 ||
+ bindings::stride_minor(c) == 1 );
+ BOOST_ASSERT( bindings::size_row(c) >= 0 );
+ BOOST_ASSERT( bindings::stride_major(c) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_row(c)) );
+ return detail::unmql( side, trans(), bindings::size_row(c),
+ bindings::size_column(c), k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(c), bindings::stride_major(c),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const fortran_int_t k,
+ const MatrixA& a, const VectorTAU& tau, MatrixC& c,
+ minimal_workspace ) {
+ 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( side,
+ bindings::size_row(c), bindings::size_column(c) ) );
+ return invoke( side, k, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const fortran_int_t k,
+ const MatrixA& a, const VectorTAU& tau, MatrixC& c,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ real_type opt_size_work;
+ detail::unmql( side, trans(), bindings::size_row(c),
+ bindings::size_column(c), k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(c), bindings::stride_major(c),
+ &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( side, k, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ 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 ) );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct unmql_impl {
+struct unmql_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmqr.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmqr.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmqr.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #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_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -30,6 +32,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for unmqr is the netlib-compatible backend.
@@ -51,6 +54,41 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t unmqr( const Side side, const Trans trans,
+ const fortran_int_t m, const fortran_int_t n, const fortran_int_t k,
+ const float* a, const fortran_int_t lda, const float* tau, float* c,
+ const fortran_int_t ldc, float* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SORMQR( &lapack_option< Side >::value, &lapack_option<
+ Trans >::value, &m, &n, &k, a, &lda, tau, c, &ldc, work, &lwork,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t unmqr( const Side side, const Trans trans,
+ const fortran_int_t m, const fortran_int_t n, const fortran_int_t k,
+ const double* a, const fortran_int_t lda, const double* tau,
+ double* c, const fortran_int_t ldc, double* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DORMQR( &lapack_option< Side >::value, &lapack_option<
+ Trans >::value, &m, &n, &k, a, &lda, tau, c, &ldc, work, &lwork,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename Side, typename Trans >
@@ -92,8 +130,122 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to unmqr.
 //
+template< typename Value, typename Enable = void >
+struct unmqr_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct unmqr_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC, typename WORK >
+ static std::ptrdiff_t invoke( const Side side, const MatrixA& a,
+ const VectorTAU& tau, MatrixC& c, detail::workspace1<
+ WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixC >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixC >::value) );
+ BOOST_ASSERT( bindings::size(tau) >= bindings::size(tau) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ 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 );
+ BOOST_ASSERT( bindings::size_minor(c) == 1 ||
+ bindings::stride_minor(c) == 1 );
+ BOOST_ASSERT( bindings::size_row(c) >= 0 );
+ BOOST_ASSERT( bindings::stride_major(c) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_row(c)) );
+ return detail::unmqr( side, trans(), bindings::size_row(c),
+ bindings::size_column(c), bindings::size(tau),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(tau), bindings::begin_value(c),
+ bindings::stride_major(c),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const MatrixA& a,
+ const VectorTAU& tau, MatrixC& c, minimal_workspace ) {
+ 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( side,
+ bindings::size_row(c), bindings::size_column(c) ) );
+ return invoke( side, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const MatrixA& a,
+ const VectorTAU& tau, MatrixC& c, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ real_type opt_size_work;
+ detail::unmqr( side, trans(), bindings::size_row(c),
+ bindings::size_column(c), bindings::size(tau),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(tau), bindings::begin_value(c),
+ bindings::stride_major(c), &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( side, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ 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 ) );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct unmqr_impl {
+struct unmqr_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmrq.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmrq.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmrq.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #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_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -30,6 +32,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for unmrq is the netlib-compatible backend.
@@ -51,6 +54,41 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t unmrq( const Side side, const Trans trans,
+ const fortran_int_t m, const fortran_int_t n, const fortran_int_t k,
+ const float* a, const fortran_int_t lda, const float* tau, float* c,
+ const fortran_int_t ldc, float* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SORMRQ( &lapack_option< Side >::value, &lapack_option<
+ Trans >::value, &m, &n, &k, a, &lda, tau, c, &ldc, work, &lwork,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t unmrq( const Side side, const Trans trans,
+ const fortran_int_t m, const fortran_int_t n, const fortran_int_t k,
+ const double* a, const fortran_int_t lda, const double* tau,
+ double* c, const fortran_int_t ldc, double* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DORMRQ( &lapack_option< Side >::value, &lapack_option<
+ Trans >::value, &m, &n, &k, a, &lda, tau, c, &ldc, work, &lwork,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename Side, typename Trans >
@@ -92,8 +130,125 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to unmrq.
 //
+template< typename Value, typename Enable = void >
+struct unmrq_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct unmrq_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC, typename WORK >
+ static std::ptrdiff_t invoke( const Side side, const fortran_int_t k,
+ const MatrixA& a, const VectorTAU& tau, MatrixC& c,
+ detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixC >::type >::type >::value) );
+ 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( 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 );
+ BOOST_ASSERT( bindings::size_minor(c) == 1 ||
+ bindings::stride_minor(c) == 1 );
+ BOOST_ASSERT( bindings::size_row(c) >= 0 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ k) );
+ BOOST_ASSERT( bindings::stride_major(c) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_row(c)) );
+ return detail::unmrq( side, trans(), bindings::size_row(c),
+ bindings::size_column(c), k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(c), bindings::stride_major(c),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const fortran_int_t k,
+ const MatrixA& a, const VectorTAU& tau, MatrixC& c,
+ minimal_workspace ) {
+ 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( side,
+ bindings::size_row(c), bindings::size_column(c) ) );
+ return invoke( side, k, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const fortran_int_t k,
+ const MatrixA& a, const VectorTAU& tau, MatrixC& c,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ real_type opt_size_work;
+ detail::unmrq( side, trans(), bindings::size_row(c),
+ bindings::size_column(c), k, bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(c), bindings::stride_major(c),
+ &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( side, k, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ 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 ) );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct unmrq_impl {
+struct unmrq_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

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-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #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_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -30,6 +32,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for unmrz is the netlib-compatible backend.
@@ -51,6 +54,42 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t unmrz( const Side side, const Trans trans,
+ const fortran_int_t m, const fortran_int_t n, const fortran_int_t k,
+ const fortran_int_t l, const float* a, const fortran_int_t lda,
+ const float* tau, float* c, const fortran_int_t ldc, float* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SORMRZ( &lapack_option< Side >::value, &lapack_option<
+ Trans >::value, &m, &n, &k, &l, a, &lda, tau, c, &ldc, work,
+ &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t unmrz( const Side side, const Trans trans,
+ const fortran_int_t m, const fortran_int_t n, const fortran_int_t k,
+ const fortran_int_t l, const double* a, const fortran_int_t lda,
+ const double* tau, double* c, const fortran_int_t ldc, double* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DORMRZ( &lapack_option< Side >::value, &lapack_option<
+ Trans >::value, &m, &n, &k, &l, a, &lda, tau, c, &ldc, work,
+ &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename Side, typename Trans >
@@ -92,8 +131,126 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to unmrz.
 //
+template< typename Value, typename Enable = void >
+struct unmrz_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct unmrz_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC, typename WORK >
+ static std::ptrdiff_t invoke( const Side side, const fortran_int_t k,
+ const MatrixA& a, const VectorTAU& tau, MatrixC& c,
+ detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixC >::type >::type >::value) );
+ 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( 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 );
+ BOOST_ASSERT( bindings::size_minor(c) == 1 ||
+ bindings::stride_minor(c) == 1 );
+ BOOST_ASSERT( bindings::size_row(c) >= 0 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ k) );
+ BOOST_ASSERT( bindings::stride_major(c) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_row(c)) );
+ return detail::unmrz( side, trans(), bindings::size_row(c),
+ bindings::size_column(c), k, bindings::size_column_op(a,
+ trans()), bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(tau), bindings::begin_value(c),
+ bindings::stride_major(c),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const fortran_int_t k,
+ const MatrixA& a, const VectorTAU& tau, MatrixC& c,
+ minimal_workspace ) {
+ 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( side,
+ bindings::size_row(c), bindings::size_column(c) ) );
+ return invoke( side, k, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const fortran_int_t k,
+ const MatrixA& a, const VectorTAU& tau, MatrixC& c,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ real_type opt_size_work;
+ detail::unmrz( side, trans(), bindings::size_row(c),
+ bindings::size_column(c), k, bindings::size_column_op(a,
+ trans()), bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(tau), bindings::begin_value(c),
+ bindings::stride_major(c), &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( side, k, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ 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 ) );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct unmrz_impl {
+struct unmrz_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmtr.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmtr.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/unmtr.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #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_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -31,6 +33,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for unmtr is the netlib-compatible backend.
@@ -52,6 +55,41 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename Side, typename UpLo, typename Trans >
+inline std::ptrdiff_t unmtr( const Side side, const UpLo uplo,
+ const Trans trans, const fortran_int_t m, const fortran_int_t n,
+ const float* a, const fortran_int_t lda, const float* tau, float* c,
+ const fortran_int_t ldc, float* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SORMTR( &lapack_option< Side >::value, &lapack_option<
+ UpLo >::value, &lapack_option< Trans >::value, &m, &n, a, &lda,
+ tau, c, &ldc, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename Side, typename UpLo, typename Trans >
+inline std::ptrdiff_t unmtr( const Side side, const UpLo uplo,
+ const Trans trans, const fortran_int_t m, const fortran_int_t n,
+ const double* a, const fortran_int_t lda, const double* tau,
+ double* c, const fortran_int_t ldc, double* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DORMTR( &lapack_option< Side >::value, &lapack_option<
+ UpLo >::value, &lapack_option< Trans >::value, &m, &n, a, &lda,
+ tau, c, &ldc, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename Side, typename UpLo, typename Trans >
@@ -93,8 +131,123 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to unmtr.
 //
+template< typename Value, typename Enable = void >
+struct unmtr_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct unmtr_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC, typename WORK >
+ static std::ptrdiff_t invoke( const Side side, const MatrixA& a,
+ const VectorTAU& tau, MatrixC& c, detail::workspace1<
+ WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ typedef typename result_of::uplo_tag< MatrixA, trans >::type uplo;
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixC >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixC >::value) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ 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 );
+ BOOST_ASSERT( bindings::size_minor(c) == 1 ||
+ bindings::stride_minor(c) == 1 );
+ BOOST_ASSERT( bindings::size_row(c) >= 0 );
+ BOOST_ASSERT( bindings::stride_major(c) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_row(c)) );
+ return detail::unmtr( side, uplo(), trans(), bindings::size_row(c),
+ bindings::size_column(c), bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(c), bindings::stride_major(c),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const MatrixA& a,
+ const VectorTAU& tau, MatrixC& c, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ typedef typename result_of::uplo_tag< MatrixA, trans >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work( side,
+ bindings::size_row(c), bindings::size_column(c) ) );
+ return invoke( side, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename Side, typename MatrixA, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const MatrixA& a,
+ const VectorTAU& tau, MatrixC& c, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::data_order< MatrixC >::type order;
+ typedef typename result_of::trans_tag< MatrixA, order >::type trans;
+ typedef typename result_of::uplo_tag< MatrixA, trans >::type uplo;
+ real_type opt_size_work;
+ detail::unmtr( side, uplo(), trans(), bindings::size_row(c),
+ bindings::size_column(c), bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(tau),
+ bindings::begin_value(c), bindings::stride_major(c),
+ &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( side, a, tau, c, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ 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 ) );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct unmtr_impl {
+struct unmtr_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/upgtr.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/upgtr.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/upgtr.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for upgtr is the netlib-compatible backend.
@@ -49,6 +52,32 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+inline std::ptrdiff_t upgtr( const char uplo, const fortran_int_t n,
+ const float* ap, const float* tau, float* q, const fortran_int_t ldq,
+ float* work ) {
+ fortran_int_t info(0);
+ LAPACK_SOPGTR( &uplo, &n, ap, tau, q, &ldq, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+inline std::ptrdiff_t upgtr( const char uplo, const fortran_int_t n,
+ const double* ap, const double* tau, double* q,
+ const fortran_int_t ldq, double* work ) {
+ fortran_int_t info(0);
+ LAPACK_DOPGTR( &uplo, &n, ap, tau, q, &ldq, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 inline std::ptrdiff_t upgtr( const char uplo, const fortran_int_t n,
@@ -80,8 +109,99 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to upgtr.
 //
+template< typename Value, typename Enable = void >
+struct upgtr_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct upgtr_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename VectorAP, typename VectorTAU, typename MatrixQ,
+ typename WORK >
+ static std::ptrdiff_t invoke( const char uplo, const VectorAP& ap,
+ const VectorTAU& tau, MatrixQ& q, detail::workspace1<
+ WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixQ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< VectorAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< VectorAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixQ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixQ >::value) );
+ BOOST_ASSERT( bindings::size(ap) >=
+ bindings::size_column(q)*(bindings::size_column(q)+1)/2 );
+ BOOST_ASSERT( bindings::size(tau) >= bindings::size_column(q)-1 );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(q) ));
+ BOOST_ASSERT( bindings::size_column(q) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(q) == 1 ||
+ bindings::stride_minor(q) == 1 );
+ BOOST_ASSERT( bindings::stride_major(q) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(q)) );
+ return detail::upgtr( uplo, bindings::size_column(q),
+ bindings::begin_value(ap), bindings::begin_value(tau),
+ bindings::begin_value(q), bindings::stride_major(q),
+ bindings::begin_value(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename VectorAP, typename VectorTAU, typename MatrixQ >
+ static std::ptrdiff_t invoke( const char uplo, const VectorAP& ap,
+ const VectorTAU& tau, MatrixQ& q, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(q) ) );
+ return invoke( uplo, ap, tau, q, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename VectorAP, typename VectorTAU, typename MatrixQ >
+ static std::ptrdiff_t invoke( const char uplo, const VectorAP& ap,
+ const VectorTAU& tau, MatrixQ& q, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ return invoke( uplo, ap, tau, q, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return n-1;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct upgtr_impl {
+struct upgtr_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

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-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #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_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for upmtr is the netlib-compatible backend.
@@ -50,6 +53,38 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t upmtr( const Side side, const char uplo,
+ const Trans trans, const fortran_int_t m, const fortran_int_t n,
+ const float* ap, const float* tau, float* c, const fortran_int_t ldc,
+ float* work ) {
+ fortran_int_t info(0);
+ LAPACK_SOPMTR( &lapack_option< Side >::value, &uplo, &lapack_option<
+ Trans >::value, &m, &n, ap, tau, c, &ldc, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename Side, typename Trans >
+inline std::ptrdiff_t upmtr( const Side side, const char uplo,
+ const Trans trans, const fortran_int_t m, const fortran_int_t n,
+ const double* ap, const double* tau, double* c,
+ const fortran_int_t ldc, double* work ) {
+ fortran_int_t info(0);
+ LAPACK_DOPMTR( &lapack_option< Side >::value, &uplo, &lapack_option<
+ Trans >::value, &m, &n, ap, tau, c, &ldc, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename Side, typename Trans >
@@ -87,8 +122,112 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to upmtr.
 //
+template< typename Value, typename Enable = void >
+struct upmtr_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct upmtr_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename Side, typename VectorAP, typename VectorTAU,
+ typename MatrixC, typename WORK >
+ static std::ptrdiff_t invoke( const Side side, const char uplo,
+ const VectorAP& ap, const VectorTAU& tau, MatrixC& c,
+ detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef tag::column_major order;
+ typedef typename result_of::trans_tag< VectorAP, order >::type trans;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixC >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< VectorAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorTAU >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< VectorAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixC >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixC >::value) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ 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 );
+ BOOST_ASSERT( bindings::size_row(c) >= 0 );
+ BOOST_ASSERT( bindings::stride_major(c) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_row(c)) );
+ return detail::upmtr( side, uplo, trans(), bindings::size_row(c),
+ bindings::size_column(c), bindings::begin_value(ap),
+ bindings::begin_value(tau), bindings::begin_value(c),
+ bindings::stride_major(c),
+ bindings::begin_value(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename Side, typename VectorAP, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const char uplo,
+ const VectorAP& ap, const VectorTAU& tau, MatrixC& c,
+ minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef tag::column_major order;
+ typedef typename result_of::trans_tag< VectorAP, order >::type trans;
+ bindings::detail::array< real_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 ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename Side, typename VectorAP, typename VectorTAU,
+ typename MatrixC >
+ static std::ptrdiff_t invoke( const Side side, const char uplo,
+ const VectorAP& ap, const VectorTAU& tau, MatrixC& c,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef tag::column_major order;
+ typedef typename result_of::trans_tag< VectorAP, order >::type trans;
+ return invoke( side, uplo, ap, tau, c, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ 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 ) );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct upmtr_impl {
+struct upmtr_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbev.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbev.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbev.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hbev is the netlib-compatible backend.
@@ -50,6 +53,38 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbev( const char jobz, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t kd, float* ab,
+ const fortran_int_t ldab, float* w, float* z, const fortran_int_t ldz,
+ float* work ) {
+ fortran_int_t info(0);
+ LAPACK_SSBEV( &jobz, &lapack_option< UpLo >::value, &n, &kd, ab, &ldab, w,
+ z, &ldz, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbev( const char jobz, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t kd, double* ab,
+ const fortran_int_t ldab, double* w, double* z,
+ const fortran_int_t ldz, double* work ) {
+ fortran_int_t info(0);
+ LAPACK_DSBEV( &jobz, &lapack_option< UpLo >::value, &n, &kd, ab, &ldab, w,
+ z, &ldz, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -87,8 +122,106 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hbev.
 //
+template< typename Value, typename Enable = void >
+struct hbev_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hbev_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAB, typename VectorW, typename MatrixZ,
+ typename WORK >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAB& ab, VectorW& w,
+ MatrixZ& z, detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixZ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
+ BOOST_ASSERT( bindings::bandwidth(ab, uplo()) >= 0 );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(ab) ));
+ BOOST_ASSERT( bindings::size_column(ab) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(ab) == 1 ||
+ bindings::stride_minor(ab) == 1 );
+ BOOST_ASSERT( bindings::size_minor(z) == 1 ||
+ bindings::stride_minor(z) == 1 );
+ BOOST_ASSERT( bindings::stride_major(ab) >= bindings::bandwidth(ab,
+ uplo())+1 );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ return detail::hbev( jobz, uplo(), bindings::size_column(ab),
+ bindings::bandwidth(ab, uplo()), bindings::begin_value(ab),
+ bindings::stride_major(ab), bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ bindings::begin_value(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAB, typename VectorW, typename MatrixZ >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAB& ab, VectorW& w,
+ MatrixZ& z, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(ab) ) );
+ return invoke( jobz, ab, w, z, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAB, typename VectorW, typename MatrixZ >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAB& ab, VectorW& w,
+ MatrixZ& z, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ return invoke( jobz, ab, w, z, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return std::max< std::ptrdiff_t >(1,3*n-2);
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hbev_impl {
+struct hbev_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbevd.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbevd.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbevd.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -30,6 +32,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hbevd is the netlib-compatible backend.
@@ -51,6 +54,40 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbevd( const char jobz, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t kd, float* ab,
+ const fortran_int_t ldab, float* w, float* z, const fortran_int_t ldz,
+ float* work, const fortran_int_t lwork, fortran_int_t* iwork,
+ const fortran_int_t liwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSBEVD( &jobz, &lapack_option< UpLo >::value, &n, &kd, ab, &ldab,
+ w, z, &ldz, work, &lwork, iwork, &liwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbevd( const char jobz, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t kd, double* ab,
+ const fortran_int_t ldab, double* w, double* z,
+ const fortran_int_t ldz, double* work, const fortran_int_t lwork,
+ fortran_int_t* iwork, const fortran_int_t liwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSBEVD( &jobz, &lapack_option< UpLo >::value, &n, &kd, ab, &ldab,
+ w, z, &ldz, work, &lwork, iwork, &liwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -92,8 +129,147 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hbevd.
 //
+template< typename Value, typename Enable = void >
+struct hbevd_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hbevd_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAB, typename VectorW, typename MatrixZ,
+ typename WORK, typename IWORK >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAB& ab, VectorW& w,
+ MatrixZ& z, const fortran_int_t liwork, detail::workspace2<
+ WORK, IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixZ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
+ BOOST_ASSERT( bindings::bandwidth(ab, uplo()) >= 0 );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( jobz, bindings::size_column(ab) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( jobz, bindings::size_column(ab) ));
+ BOOST_ASSERT( bindings::size_column(ab) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(ab) == 1 ||
+ bindings::stride_minor(ab) == 1 );
+ BOOST_ASSERT( bindings::size_minor(z) == 1 ||
+ bindings::stride_minor(z) == 1 );
+ BOOST_ASSERT( bindings::stride_major(ab) >= bindings::bandwidth(ab,
+ uplo())+1 );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ return detail::hbevd( jobz, uplo(), bindings::size_column(ab),
+ bindings::bandwidth(ab, uplo()), bindings::begin_value(ab),
+ bindings::stride_major(ab), bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())),
+ liwork );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAB, typename VectorW, typename MatrixZ >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAB& ab, VectorW& w,
+ MatrixZ& z, const fortran_int_t liwork, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work( jobz,
+ bindings::size_column(ab) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( jobz, bindings::size_column(ab) ) );
+ return invoke( jobz, ab, w, z, liwork, workspace( tmp_work,
+ tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAB, typename VectorW, typename MatrixZ >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAB& ab, VectorW& w,
+ MatrixZ& z, const fortran_int_t liwork, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ real_type opt_size_work;
+ fortran_int_t opt_size_iwork;
+ detail::hbevd( jobz, uplo(), bindings::size_column(ab),
+ bindings::bandwidth(ab, uplo()), bindings::begin_value(ab),
+ bindings::stride_major(ab), bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ &opt_size_work, -1, &opt_size_iwork, -1 );
+ 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( jobz, ab, w, z, liwork, workspace( tmp_work,
+ tmp_iwork ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const char jobz,
+ const std::ptrdiff_t n ) {
+ if ( n < 2 )
+ return 1;
+ else {
+ if ( jobz == 'N' )
+ return 2*n;
+ else
+ return 1 + 5*n + 2*n*n;
+ }
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const char jobz,
+ const std::ptrdiff_t n ) {
+ if ( jobz == 'N' || n < 2 )
+ return 1;
+ else
+ return 3 + 5*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hbevd_impl {
+struct hbevd_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;
@@ -263,6 +439,133 @@
 inline typename boost::enable_if< detail::is_workspace< Workspace >,
         std::ptrdiff_t >::type
 hbevd( const char jobz, MatrixAB& ab, VectorW& w, MatrixZ& z,
+ const fortran_int_t liwork, Workspace work ) {
+ return hbevd_impl< typename bindings::value_type<
+ MatrixAB >::type >::invoke( jobz, ab, w, z, liwork, work );
+}
+
+//
+// Overloaded function for hbevd. Its overload differs for
+// * MatrixAB&
+// * MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixAB, typename VectorW, typename MatrixZ >
+inline typename boost::disable_if< detail::is_workspace< MatrixZ >,
+ std::ptrdiff_t >::type
+hbevd( const char jobz, MatrixAB& ab, VectorW& w, MatrixZ& z,
+ const fortran_int_t liwork ) {
+ return hbevd_impl< typename bindings::value_type<
+ MatrixAB >::type >::invoke( jobz, ab, w, z, liwork,
+ optimal_workspace() );
+}
+
+//
+// Overloaded function for hbevd. Its overload differs for
+// * const MatrixAB&
+// * MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixAB, typename VectorW, typename MatrixZ,
+ typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hbevd( const char jobz, const MatrixAB& ab, VectorW& w, MatrixZ& z,
+ const fortran_int_t liwork, Workspace work ) {
+ return hbevd_impl< typename bindings::value_type<
+ MatrixAB >::type >::invoke( jobz, ab, w, z, liwork, work );
+}
+
+//
+// Overloaded function for hbevd. Its overload differs for
+// * const MatrixAB&
+// * MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixAB, typename VectorW, typename MatrixZ >
+inline typename boost::disable_if< detail::is_workspace< MatrixZ >,
+ std::ptrdiff_t >::type
+hbevd( const char jobz, const MatrixAB& ab, VectorW& w, MatrixZ& z,
+ const fortran_int_t liwork ) {
+ return hbevd_impl< typename bindings::value_type<
+ MatrixAB >::type >::invoke( jobz, ab, w, z, liwork,
+ optimal_workspace() );
+}
+
+//
+// Overloaded function for hbevd. Its overload differs for
+// * MatrixAB&
+// * const MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixAB, typename VectorW, typename MatrixZ,
+ typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hbevd( const char jobz, MatrixAB& ab, VectorW& w, const MatrixZ& z,
+ const fortran_int_t liwork, Workspace work ) {
+ return hbevd_impl< typename bindings::value_type<
+ MatrixAB >::type >::invoke( jobz, ab, w, z, liwork, work );
+}
+
+//
+// Overloaded function for hbevd. Its overload differs for
+// * MatrixAB&
+// * const MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixAB, typename VectorW, typename MatrixZ >
+inline typename boost::disable_if< detail::is_workspace< MatrixZ >,
+ std::ptrdiff_t >::type
+hbevd( const char jobz, MatrixAB& ab, VectorW& w, const MatrixZ& z,
+ const fortran_int_t liwork ) {
+ return hbevd_impl< typename bindings::value_type<
+ MatrixAB >::type >::invoke( jobz, ab, w, z, liwork,
+ optimal_workspace() );
+}
+
+//
+// Overloaded function for hbevd. Its overload differs for
+// * const MatrixAB&
+// * const MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixAB, typename VectorW, typename MatrixZ,
+ typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hbevd( const char jobz, const MatrixAB& ab, VectorW& w, const MatrixZ& z,
+ const fortran_int_t liwork, Workspace work ) {
+ return hbevd_impl< typename bindings::value_type<
+ MatrixAB >::type >::invoke( jobz, ab, w, z, liwork, work );
+}
+
+//
+// Overloaded function for hbevd. Its overload differs for
+// * const MatrixAB&
+// * const MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixAB, typename VectorW, typename MatrixZ >
+inline typename boost::disable_if< detail::is_workspace< MatrixZ >,
+ std::ptrdiff_t >::type
+hbevd( const char jobz, const MatrixAB& ab, VectorW& w, const MatrixZ& z,
+ const fortran_int_t liwork ) {
+ return hbevd_impl< typename bindings::value_type<
+ MatrixAB >::type >::invoke( jobz, ab, w, z, liwork,
+ optimal_workspace() );
+}
+//
+// Overloaded function for hbevd. Its overload differs for
+// * MatrixAB&
+// * MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixAB, typename VectorW, typename MatrixZ,
+ typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hbevd( const char jobz, MatrixAB& ab, VectorW& w, MatrixZ& z,
         Workspace work ) {
     return hbevd_impl< typename bindings::value_type<
             MatrixAB >::type >::invoke( jobz, ab, w, z, work );

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbevx.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbevx.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbevx.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hbevx is the netlib-compatible backend.
@@ -50,6 +53,46 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbevx( const char jobz, const char range,
+ const UpLo uplo, const fortran_int_t n, const fortran_int_t kd,
+ float* ab, const fortran_int_t ldab, float* q,
+ const fortran_int_t ldq, const float vl, const float vu,
+ const fortran_int_t il, const fortran_int_t iu, const float abstol,
+ fortran_int_t& m, float* w, float* z, const fortran_int_t ldz,
+ float* work, fortran_int_t* iwork, fortran_int_t* ifail ) {
+ fortran_int_t info(0);
+ LAPACK_SSBEVX( &jobz, &range, &lapack_option< UpLo >::value, &n, &kd, ab,
+ &ldab, q, &ldq, &vl, &vu, &il, &iu, &abstol, &m, w, z, &ldz, work,
+ iwork, ifail, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbevx( const char jobz, const char range,
+ const UpLo uplo, const fortran_int_t n, const fortran_int_t kd,
+ double* ab, const fortran_int_t ldab, double* q,
+ const fortran_int_t ldq, const double vl, const double vu,
+ const fortran_int_t il, const fortran_int_t iu, const double abstol,
+ fortran_int_t& m, double* w, double* z, const fortran_int_t ldz,
+ double* work, fortran_int_t* iwork, fortran_int_t* ifail ) {
+ fortran_int_t info(0);
+ LAPACK_DSBEVX( &jobz, &range, &lapack_option< UpLo >::value, &n, &kd, ab,
+ &ldab, q, &ldq, &vl, &vu, &il, &iu, &abstol, &m, w, z, &ldz, work,
+ iwork, ifail, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -97,8 +140,150 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hbevx.
 //
+template< typename Value, typename Enable = void >
+struct hbevx_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hbevx_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAB, typename MatrixQ, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename WORK,
+ typename IWORK >
+ static std::ptrdiff_t invoke( const char jobz, const char range,
+ MatrixAB& ab, MatrixQ& q, const real_type vl, const real_type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const real_type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, detail::workspace2< WORK,
+ IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixQ >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixQ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixZ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixQ >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIFAIL >::value) );
+ BOOST_ASSERT( bindings::bandwidth(ab, uplo()) >= 0 );
+ BOOST_ASSERT( bindings::size(w) >= bindings::size_column(ab) );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( bindings::size_column(ab) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(ab) ));
+ BOOST_ASSERT( bindings::size_column(ab) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(ab) == 1 ||
+ bindings::stride_minor(ab) == 1 );
+ BOOST_ASSERT( bindings::size_minor(q) == 1 ||
+ bindings::stride_minor(q) == 1 );
+ BOOST_ASSERT( bindings::size_minor(z) == 1 ||
+ bindings::stride_minor(z) == 1 );
+ BOOST_ASSERT( bindings::stride_major(ab) >= bindings::bandwidth(ab,
+ uplo())+1 );
+ BOOST_ASSERT( bindings::stride_major(q) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(ab)) );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ BOOST_ASSERT( range == 'A' || range == 'V' || range == 'I' );
+ return detail::hbevx( jobz, range, uplo(), bindings::size_column(ab),
+ bindings::bandwidth(ab, uplo()), bindings::begin_value(ab),
+ bindings::stride_major(ab), bindings::begin_value(q),
+ bindings::stride_major(q), vl, vu, il, iu, abstol, m,
+ bindings::begin_value(w), bindings::begin_value(z),
+ bindings::stride_major(z),
+ bindings::begin_value(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())),
+ bindings::begin_value(ifail) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAB, typename MatrixQ, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+ static std::ptrdiff_t invoke( const char jobz, const char range,
+ MatrixAB& ab, MatrixQ& q, const real_type vl, const real_type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const real_type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(ab) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( bindings::size_column(ab) ) );
+ return invoke( jobz, range, ab, q, vl, vu, il, iu, abstol, m, w, z,
+ ifail, workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAB, typename MatrixQ, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+ static std::ptrdiff_t invoke( const char jobz, const char range,
+ MatrixAB& ab, MatrixQ& q, const real_type vl, const real_type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const real_type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ return invoke( jobz, range, ab, q, vl, vu, il, iu, abstol, m, w, z,
+ ifail, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return 7*n;
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t n ) {
+ return 5*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hbevx_impl {
+struct hbevx_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbgv.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbgv.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbgv.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hbgv is the netlib-compatible backend.
@@ -50,6 +53,40 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbgv( const char jobz, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t ka, const fortran_int_t kb,
+ float* ab, const fortran_int_t ldab, float* bb,
+ const fortran_int_t ldbb, float* w, float* z, const fortran_int_t ldz,
+ float* work ) {
+ fortran_int_t info(0);
+ LAPACK_SSBGV( &jobz, &lapack_option< UpLo >::value, &n, &ka, &kb, ab,
+ &ldab, bb, &ldbb, w, z, &ldz, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbgv( const char jobz, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t ka, const fortran_int_t kb,
+ double* ab, const fortran_int_t ldab, double* bb,
+ const fortran_int_t ldbb, double* w, double* z,
+ const fortran_int_t ldz, double* work ) {
+ fortran_int_t info(0);
+ LAPACK_DSBGV( &jobz, &lapack_option< UpLo >::value, &n, &ka, &kb, ab,
+ &ldab, bb, &ldbb, w, z, &ldz, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -89,8 +126,121 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hbgv.
 //
+template< typename Value, typename Enable = void >
+struct hbgv_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hbgv_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAB, typename MatrixBB, typename VectorW,
+ typename MatrixZ, typename WORK >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAB& ab, MatrixBB& bb,
+ VectorW& w, MatrixZ& z, detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixBB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixBB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixZ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixBB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
+ BOOST_ASSERT( bindings::bandwidth(ab, uplo()) >= 0 );
+ BOOST_ASSERT( bindings::bandwidth(bb, uplo()) >= 0 );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(ab) ));
+ BOOST_ASSERT( bindings::size_column(ab) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(ab) == 1 ||
+ bindings::stride_minor(ab) == 1 );
+ BOOST_ASSERT( bindings::size_minor(bb) == 1 ||
+ bindings::stride_minor(bb) == 1 );
+ BOOST_ASSERT( bindings::size_minor(z) == 1 ||
+ bindings::stride_minor(z) == 1 );
+ BOOST_ASSERT( bindings::stride_major(ab) >= bindings::bandwidth(ab,
+ uplo())+1 );
+ BOOST_ASSERT( bindings::stride_major(bb) >= bindings::bandwidth(bb,
+ uplo())+1 );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ return detail::hbgv( jobz, uplo(), bindings::size_column(ab),
+ bindings::bandwidth(ab, uplo()), bindings::bandwidth(bb,
+ uplo()), bindings::begin_value(ab),
+ bindings::stride_major(ab), bindings::begin_value(bb),
+ bindings::stride_major(bb), bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ bindings::begin_value(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAB, typename MatrixBB, typename VectorW,
+ typename MatrixZ >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAB& ab, MatrixBB& bb,
+ VectorW& w, MatrixZ& z, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(ab) ) );
+ return invoke( jobz, ab, bb, w, z, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAB, typename MatrixBB, typename VectorW,
+ typename MatrixZ >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAB& ab, MatrixBB& bb,
+ VectorW& w, MatrixZ& z, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ return invoke( jobz, ab, bb, w, z, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return 3*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hbgv_impl {
+struct hbgv_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbgvd.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbgvd.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbgvd.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -30,6 +32,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hbgvd is the netlib-compatible backend.
@@ -51,6 +54,44 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbgvd( const char jobz, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t ka, const fortran_int_t kb,
+ float* ab, const fortran_int_t ldab, float* bb,
+ const fortran_int_t ldbb, float* w, float* z, const fortran_int_t ldz,
+ float* work, const fortran_int_t lwork, fortran_int_t* iwork,
+ const fortran_int_t liwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSBGVD( &jobz, &lapack_option< UpLo >::value, &n, &ka, &kb, ab,
+ &ldab, bb, &ldbb, w, z, &ldz, work, &lwork, iwork, &liwork,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbgvd( const char jobz, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t ka, const fortran_int_t kb,
+ double* ab, const fortran_int_t ldab, double* bb,
+ const fortran_int_t ldbb, double* w, double* z,
+ const fortran_int_t ldz, double* work, const fortran_int_t lwork,
+ fortran_int_t* iwork, const fortran_int_t liwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSBGVD( &jobz, &lapack_option< UpLo >::value, &n, &ka, &kb, ab,
+ &ldab, bb, &ldbb, w, z, &ldz, work, &lwork, iwork, &liwork,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -96,8 +137,161 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hbgvd.
 //
+template< typename Value, typename Enable = void >
+struct hbgvd_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hbgvd_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAB, typename MatrixBB, typename VectorW,
+ typename MatrixZ, typename WORK, typename IWORK >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAB& ab, MatrixBB& bb,
+ VectorW& w, MatrixZ& z, detail::workspace2< WORK, IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixBB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixBB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixZ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixBB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
+ BOOST_ASSERT( bindings::bandwidth(ab, uplo()) >= 0 );
+ BOOST_ASSERT( bindings::bandwidth(bb, uplo()) >= 0 );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( jobz, bindings::size_column(ab) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( jobz, bindings::size_column(ab) ));
+ BOOST_ASSERT( bindings::size_column(ab) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(ab) == 1 ||
+ bindings::stride_minor(ab) == 1 );
+ BOOST_ASSERT( bindings::size_minor(bb) == 1 ||
+ bindings::stride_minor(bb) == 1 );
+ BOOST_ASSERT( bindings::size_minor(z) == 1 ||
+ bindings::stride_minor(z) == 1 );
+ BOOST_ASSERT( bindings::stride_major(ab) >= bindings::bandwidth(ab,
+ uplo())+1 );
+ BOOST_ASSERT( bindings::stride_major(bb) >= bindings::bandwidth(bb,
+ uplo())+1 );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ return detail::hbgvd( jobz, uplo(), bindings::size_column(ab),
+ bindings::bandwidth(ab, uplo()), bindings::bandwidth(bb,
+ uplo()), bindings::begin_value(ab),
+ bindings::stride_major(ab), bindings::begin_value(bb),
+ bindings::stride_major(bb), bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())),
+ bindings::size(work.select(fortran_int_t())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAB, typename MatrixBB, typename VectorW,
+ typename MatrixZ >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAB& ab, MatrixBB& bb,
+ VectorW& w, MatrixZ& z, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work( jobz,
+ bindings::size_column(ab) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( jobz, bindings::size_column(ab) ) );
+ return invoke( jobz, ab, bb, w, z, workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAB, typename MatrixBB, typename VectorW,
+ typename MatrixZ >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAB& ab, MatrixBB& bb,
+ VectorW& w, MatrixZ& z, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ real_type opt_size_work;
+ fortran_int_t opt_size_iwork;
+ detail::hbgvd( jobz, uplo(), bindings::size_column(ab),
+ bindings::bandwidth(ab, uplo()), bindings::bandwidth(bb,
+ uplo()), bindings::begin_value(ab),
+ bindings::stride_major(ab), bindings::begin_value(bb),
+ bindings::stride_major(bb), bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ &opt_size_work, -1, &opt_size_iwork, -1 );
+ 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( jobz, ab, bb, w, z, workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const char jobz,
+ const std::ptrdiff_t n ) {
+ if ( n < 2 )
+ return 1;
+ else {
+ if ( jobz == 'N' )
+ return 3*n;
+ else
+ return 1 + 5*n + 2*n*n;
+ }
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const char jobz,
+ const std::ptrdiff_t n ) {
+ if ( jobz == 'N' || n < 2 )
+ return 1;
+ else
+ return 3 + 5*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hbgvd_impl {
+struct hbgvd_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbgvx.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbgvx.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hbgvx.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hbgvx is the netlib-compatible backend.
@@ -50,6 +53,48 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbgvx( const char jobz, const char range,
+ const UpLo uplo, const fortran_int_t n, const fortran_int_t ka,
+ const fortran_int_t kb, float* ab, const fortran_int_t ldab,
+ float* bb, const fortran_int_t ldbb, float* q,
+ const fortran_int_t ldq, const float vl, const float vu,
+ const fortran_int_t il, const fortran_int_t iu, const float abstol,
+ fortran_int_t& m, float* w, float* z, const fortran_int_t ldz,
+ float* work, fortran_int_t* iwork, fortran_int_t* ifail ) {
+ fortran_int_t info(0);
+ LAPACK_SSBGVX( &jobz, &range, &lapack_option< UpLo >::value, &n, &ka, &kb,
+ ab, &ldab, bb, &ldbb, q, &ldq, &vl, &vu, &il, &iu, &abstol, &m, w,
+ z, &ldz, work, iwork, ifail, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hbgvx( const char jobz, const char range,
+ const UpLo uplo, const fortran_int_t n, const fortran_int_t ka,
+ const fortran_int_t kb, double* ab, const fortran_int_t ldab,
+ double* bb, const fortran_int_t ldbb, double* q,
+ const fortran_int_t ldq, const double vl, const double vu,
+ const fortran_int_t il, const fortran_int_t iu, const double abstol,
+ fortran_int_t& m, double* w, double* z, const fortran_int_t ldz,
+ double* work, fortran_int_t* iwork, fortran_int_t* ifail ) {
+ fortran_int_t info(0);
+ LAPACK_DSBGVX( &jobz, &range, &lapack_option< UpLo >::value, &n, &ka, &kb,
+ ab, &ldab, bb, &ldbb, q, &ldq, &vl, &vu, &il, &iu, &abstol, &m, w,
+ z, &ldz, work, iwork, ifail, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -99,8 +144,162 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hbgvx.
 //
+template< typename Value, typename Enable = void >
+struct hbgvx_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hbgvx_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAB, typename MatrixBB, typename MatrixQ,
+ typename VectorW, typename MatrixZ, typename VectorIFAIL,
+ typename WORK, typename IWORK >
+ static std::ptrdiff_t invoke( const char jobz, const char range,
+ MatrixAB& ab, MatrixBB& bb, MatrixQ& q, const real_type vl,
+ const real_type vu, const fortran_int_t il,
+ const fortran_int_t iu, const real_type abstol,
+ fortran_int_t& m, VectorW& w, MatrixZ& z, VectorIFAIL& ifail,
+ detail::workspace2< WORK, IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixBB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixQ >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixBB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixQ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAB >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixZ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixBB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixQ >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIFAIL >::value) );
+ BOOST_ASSERT( bindings::bandwidth(ab, uplo()) >= 0 );
+ BOOST_ASSERT( bindings::bandwidth(bb, uplo()) >= 0 );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( bindings::size_column(ab) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(ab) ));
+ BOOST_ASSERT( bindings::size_column(ab) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(ab) == 1 ||
+ bindings::stride_minor(ab) == 1 );
+ BOOST_ASSERT( bindings::size_minor(bb) == 1 ||
+ bindings::stride_minor(bb) == 1 );
+ BOOST_ASSERT( bindings::size_minor(q) == 1 ||
+ bindings::stride_minor(q) == 1 );
+ BOOST_ASSERT( bindings::size_minor(z) == 1 ||
+ bindings::stride_minor(z) == 1 );
+ BOOST_ASSERT( bindings::stride_major(ab) >= bindings::bandwidth(ab,
+ uplo())+1 );
+ BOOST_ASSERT( bindings::stride_major(bb) >= bindings::bandwidth(bb,
+ uplo())+1 );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ BOOST_ASSERT( range == 'A' || range == 'V' || range == 'I' );
+ return detail::hbgvx( jobz, range, uplo(), bindings::size_column(ab),
+ bindings::bandwidth(ab, uplo()), bindings::bandwidth(bb,
+ uplo()), bindings::begin_value(ab),
+ bindings::stride_major(ab), bindings::begin_value(bb),
+ bindings::stride_major(bb), bindings::begin_value(q),
+ bindings::stride_major(q), vl, vu, il, iu, abstol, m,
+ bindings::begin_value(w), bindings::begin_value(z),
+ bindings::stride_major(z),
+ bindings::begin_value(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())),
+ bindings::begin_value(ifail) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAB, typename MatrixBB, typename MatrixQ,
+ typename VectorW, typename MatrixZ, typename VectorIFAIL >
+ static std::ptrdiff_t invoke( const char jobz, const char range,
+ MatrixAB& ab, MatrixBB& bb, MatrixQ& q, const real_type vl,
+ const real_type vu, const fortran_int_t il,
+ const fortran_int_t iu, const real_type abstol,
+ fortran_int_t& m, VectorW& w, MatrixZ& z, VectorIFAIL& ifail,
+ minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(ab) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( bindings::size_column(ab) ) );
+ return invoke( jobz, range, ab, bb, q, vl, vu, il, iu, abstol, m, w,
+ z, ifail, workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAB, typename MatrixBB, typename MatrixQ,
+ typename VectorW, typename MatrixZ, typename VectorIFAIL >
+ static std::ptrdiff_t invoke( const char jobz, const char range,
+ MatrixAB& ab, MatrixBB& bb, MatrixQ& q, const real_type vl,
+ const real_type vu, const fortran_int_t il,
+ const fortran_int_t iu, const real_type abstol,
+ fortran_int_t& m, VectorW& w, MatrixZ& z, VectorIFAIL& ifail,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAB >::type uplo;
+ return invoke( jobz, range, ab, bb, q, vl, vu, il, iu, abstol, m, w,
+ z, ifail, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return 7*n;
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t n ) {
+ return 5*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hbgvx_impl {
+struct hbgvx_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heev.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heev.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heev.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for heev is the netlib-compatible backend.
@@ -50,6 +53,36 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t heev( const char jobz, const UpLo uplo,
+ const fortran_int_t n, float* a, const fortran_int_t lda, float* w,
+ float* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSYEV( &jobz, &lapack_option< UpLo >::value, &n, a, &lda, w, work,
+ &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t heev( const char jobz, const UpLo uplo,
+ const fortran_int_t n, double* a, const fortran_int_t lda, double* w,
+ double* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSYEV( &jobz, &lapack_option< UpLo >::value, &n, a, &lda, w, work,
+ &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -85,8 +118,102 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to heev.
 //
+template< typename Value, typename Enable = void >
+struct heev_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct heev_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorW, typename WORK >
+ static std::ptrdiff_t invoke( const char jobz, MatrixA& a, VectorW& w,
+ detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ 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 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ return detail::heev( jobz, uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(w),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorW >
+ static std::ptrdiff_t invoke( const char jobz, MatrixA& a, VectorW& w,
+ minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(a) ) );
+ return invoke( jobz, a, w, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorW >
+ static std::ptrdiff_t invoke( const char jobz, MatrixA& a, VectorW& w,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ real_type opt_size_work;
+ detail::heev( jobz, uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(w), &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( jobz, a, w, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return std::max< std::ptrdiff_t >(1,3*n-1);
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct heev_impl {
+struct heev_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heevd.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heevd.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heevd.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for heevd is the netlib-compatible backend.
@@ -50,6 +53,38 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t heevd( const char jobz, const UpLo uplo,
+ const fortran_int_t n, float* a, const fortran_int_t lda, float* w,
+ float* work, const fortran_int_t lwork, fortran_int_t* iwork,
+ const fortran_int_t liwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSYEVD( &jobz, &lapack_option< UpLo >::value, &n, a, &lda, w, work,
+ &lwork, iwork, &liwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t heevd( const char jobz, const UpLo uplo,
+ const fortran_int_t n, double* a, const fortran_int_t lda, double* w,
+ double* work, const fortran_int_t lwork, fortran_int_t* iwork,
+ const fortran_int_t liwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSYEVD( &jobz, &lapack_option< UpLo >::value, &n, a, &lda, w, work,
+ &lwork, iwork, &liwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -87,8 +122,133 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to heevd.
 //
+template< typename Value, typename Enable = void >
+struct heevd_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct heevd_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorW, typename WORK,
+ typename IWORK >
+ static std::ptrdiff_t invoke( const char jobz, MatrixA& a, VectorW& w,
+ detail::workspace2< WORK, IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( jobz, bindings::size_column(a) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( jobz, bindings::size_column(a) ));
+ BOOST_ASSERT( bindings::size_column(a) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ return detail::heevd( jobz, uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(w),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())),
+ bindings::size(work.select(fortran_int_t())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorW >
+ static std::ptrdiff_t invoke( const char jobz, MatrixA& a, VectorW& w,
+ minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work( jobz,
+ bindings::size_column(a) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( jobz, bindings::size_column(a) ) );
+ return invoke( jobz, a, w, workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorW >
+ static std::ptrdiff_t invoke( const char jobz, MatrixA& a, VectorW& w,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ real_type opt_size_work;
+ fortran_int_t opt_size_iwork;
+ detail::heevd( jobz, uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(w), &opt_size_work, -1, &opt_size_iwork,
+ -1 );
+ 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( jobz, a, w, workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const char jobz,
+ const std::ptrdiff_t n ) {
+ if ( n < 2 )
+ return 1;
+ else {
+ if ( jobz == 'N' )
+ return 2*n + 1;
+ else
+ return 1 + 6*n + 2*n*n;
+ }
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const char jobz,
+ const std::ptrdiff_t n ) {
+ if ( jobz == 'N' || n < 2 )
+ return 1;
+ else
+ return 3 + 5*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct heevd_impl {
+struct heevd_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heevr.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heevr.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heevr.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for heevr is the netlib-compatible backend.
@@ -50,6 +53,46 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t heevr( const char jobz, const char range,
+ const UpLo uplo, const fortran_int_t n, float* a,
+ const fortran_int_t lda, const float vl, const float vu,
+ const fortran_int_t il, const fortran_int_t iu, const float abstol,
+ fortran_int_t& m, float* w, float* z, const fortran_int_t ldz,
+ fortran_int_t* isuppz, float* work, const fortran_int_t lwork,
+ fortran_int_t* iwork, const fortran_int_t liwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSYEVR( &jobz, &range, &lapack_option< UpLo >::value, &n, a, &lda,
+ &vl, &vu, &il, &iu, &abstol, &m, w, z, &ldz, isuppz, work, &lwork,
+ iwork, &liwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t heevr( const char jobz, const char range,
+ const UpLo uplo, const fortran_int_t n, double* a,
+ const fortran_int_t lda, const double vl, const double vu,
+ const fortran_int_t il, const fortran_int_t iu, const double abstol,
+ fortran_int_t& m, double* w, double* z, const fortran_int_t ldz,
+ fortran_int_t* isuppz, double* work, const fortran_int_t lwork,
+ fortran_int_t* iwork, const fortran_int_t liwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSYEVR( &jobz, &range, &lapack_option< UpLo >::value, &n, a, &lda,
+ &vl, &vu, &il, &iu, &abstol, &m, w, z, &ldz, isuppz, work, &lwork,
+ iwork, &liwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -97,8 +140,150 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to heevr.
 //
+template< typename Value, typename Enable = void >
+struct heevr_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct heevr_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorW, typename MatrixZ,
+ typename VectorISUPPZ, typename WORK, typename IWORK >
+ static std::ptrdiff_t invoke( const char jobz, const char range,
+ MatrixA& a, const real_type vl, const real_type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const real_type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorISUPPZ& isuppz, detail::workspace2< WORK,
+ IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixZ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorISUPPZ >::value) );
+ BOOST_ASSERT( bindings::size(w) >= bindings::size_column(a) );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( bindings::size_column(a) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ 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 );
+ BOOST_ASSERT( bindings::size_minor(z) == 1 ||
+ bindings::stride_minor(z) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ BOOST_ASSERT( range == 'A' || range == 'V' || range == 'I' );
+ return detail::heevr( jobz, range, uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a), vl, vu,
+ il, iu, abstol, m, bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ bindings::begin_value(isuppz),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())),
+ bindings::size(work.select(fortran_int_t())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorW, typename MatrixZ,
+ typename VectorISUPPZ >
+ static std::ptrdiff_t invoke( const char jobz, const char range,
+ MatrixA& a, const real_type vl, const real_type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const real_type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorISUPPZ& isuppz, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(a) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( bindings::size_column(a) ) );
+ return invoke( jobz, range, a, vl, vu, il, iu, abstol, m, w, z,
+ isuppz, workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorW, typename MatrixZ,
+ typename VectorISUPPZ >
+ static std::ptrdiff_t invoke( const char jobz, const char range,
+ MatrixA& a, const real_type vl, const real_type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const real_type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorISUPPZ& isuppz, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ real_type opt_size_work;
+ fortran_int_t opt_size_iwork;
+ detail::heevr( jobz, range, uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a), vl, vu,
+ il, iu, abstol, m, bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ bindings::begin_value(isuppz), &opt_size_work, -1,
+ &opt_size_iwork, -1 );
+ 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( jobz, range, a, vl, vu, il, iu, abstol, m, w, z,
+ isuppz, workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return std::max< std::ptrdiff_t >( 1, 26*n );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t n ) {
+ return std::max< std::ptrdiff_t >( 1, 10*n );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct heevr_impl {
+struct heevr_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heevx.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heevx.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/heevx.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for heevx is the netlib-compatible backend.
@@ -50,6 +53,46 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t heevx( const char jobz, const char range,
+ const UpLo uplo, const fortran_int_t n, float* a,
+ const fortran_int_t lda, const float vl, const float vu,
+ const fortran_int_t il, const fortran_int_t iu, const float abstol,
+ fortran_int_t& m, float* w, float* z, const fortran_int_t ldz,
+ float* work, const fortran_int_t lwork, fortran_int_t* iwork,
+ fortran_int_t* ifail ) {
+ fortran_int_t info(0);
+ LAPACK_SSYEVX( &jobz, &range, &lapack_option< UpLo >::value, &n, a, &lda,
+ &vl, &vu, &il, &iu, &abstol, &m, w, z, &ldz, work, &lwork, iwork,
+ ifail, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t heevx( const char jobz, const char range,
+ const UpLo uplo, const fortran_int_t n, double* a,
+ const fortran_int_t lda, const double vl, const double vu,
+ const fortran_int_t il, const fortran_int_t iu, const double abstol,
+ fortran_int_t& m, double* w, double* z, const fortran_int_t ldz,
+ double* work, const fortran_int_t lwork, fortran_int_t* iwork,
+ fortran_int_t* ifail ) {
+ fortran_int_t info(0);
+ LAPACK_DSYEVX( &jobz, &range, &lapack_option< UpLo >::value, &n, a, &lda,
+ &vl, &vu, &il, &iu, &abstol, &m, w, z, &ldz, work, &lwork, iwork,
+ ifail, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -95,8 +138,151 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to heevx.
 //
+template< typename Value, typename Enable = void >
+struct heevx_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct heevx_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorW, typename MatrixZ,
+ typename VectorIFAIL, typename WORK, typename IWORK >
+ static std::ptrdiff_t invoke( const char jobz, const char range,
+ MatrixA& a, const real_type vl, const real_type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const real_type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, detail::workspace2< WORK,
+ IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixZ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIFAIL >::value) );
+ BOOST_ASSERT( bindings::size(w) >= bindings::size_column(a) );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( bindings::size_column(a) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ 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 );
+ BOOST_ASSERT( bindings::size_minor(z) == 1 ||
+ bindings::stride_minor(z) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ BOOST_ASSERT( range == 'A' || range == 'V' || range == 'I' );
+ return detail::heevx( jobz, range, uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a), vl, vu,
+ il, iu, abstol, m, bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())),
+ bindings::begin_value(ifail) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorW, typename MatrixZ,
+ typename VectorIFAIL >
+ static std::ptrdiff_t invoke( const char jobz, const char range,
+ MatrixA& a, const real_type vl, const real_type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const real_type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(a) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( bindings::size_column(a) ) );
+ return invoke( jobz, range, a, vl, vu, il, iu, abstol, m, w, z, ifail,
+ workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorW, typename MatrixZ,
+ typename VectorIFAIL >
+ static std::ptrdiff_t invoke( const char jobz, const char range,
+ MatrixA& a, const real_type vl, const real_type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const real_type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ real_type opt_size_work;
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( bindings::size_column(a) ) );
+ detail::heevx( jobz, range, uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a), vl, vu,
+ il, iu, abstol, m, bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ &opt_size_work, -1, bindings::begin_value(tmp_iwork),
+ bindings::begin_value(ifail) );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( jobz, range, a, vl, vu, il, iu, abstol, m, w, z, ifail,
+ workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ if ( n < 2 )
+ return 1;
+ else
+ return 8*n;
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t n ) {
+ return 5*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct heevx_impl {
+struct heevx_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hegv.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hegv.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hegv.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hegv is the netlib-compatible backend.
@@ -50,6 +53,38 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hegv( const fortran_int_t itype, const char jobz,
+ const UpLo uplo, const fortran_int_t n, float* a,
+ const fortran_int_t lda, float* b, const fortran_int_t ldb, float* w,
+ float* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSYGV( &itype, &jobz, &lapack_option< UpLo >::value, &n, a, &lda,
+ b, &ldb, w, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hegv( const fortran_int_t itype, const char jobz,
+ const UpLo uplo, const fortran_int_t n, double* a,
+ const fortran_int_t lda, double* b, const fortran_int_t ldb,
+ double* w, double* work, const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSYGV( &itype, &jobz, &lapack_option< UpLo >::value, &n, a, &lda,
+ b, &ldb, w, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -87,8 +122,118 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hegv.
 //
+template< typename Value, typename Enable = void >
+struct hegv_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hegv_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename WORK >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, MatrixA& a, MatrixB& b, VectorW& w,
+ detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ 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 );
+ BOOST_ASSERT( bindings::size_minor(b) == 1 ||
+ bindings::stride_minor(b) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ return detail::hegv( itype, jobz, uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(b), bindings::stride_major(b),
+ bindings::begin_value(w),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename MatrixB, typename VectorW >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, MatrixA& a, MatrixB& b, VectorW& w,
+ minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(a) ) );
+ return invoke( itype, jobz, a, b, w, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename MatrixB, typename VectorW >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, MatrixA& a, MatrixB& b, VectorW& w,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ real_type opt_size_work;
+ detail::hegv( itype, jobz, uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(b), bindings::stride_major(b),
+ bindings::begin_value(w), &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( itype, jobz, a, b, w, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return std::max< std::ptrdiff_t >( 1, 3*n-1 );
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hegv_impl {
+struct hegv_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hegvd.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hegvd.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hegvd.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hegvd is the netlib-compatible backend.
@@ -50,6 +53,40 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hegvd( const fortran_int_t itype, const char jobz,
+ const UpLo uplo, const fortran_int_t n, float* a,
+ const fortran_int_t lda, float* b, const fortran_int_t ldb, float* w,
+ float* work, const fortran_int_t lwork, fortran_int_t* iwork,
+ const fortran_int_t liwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSYGVD( &itype, &jobz, &lapack_option< UpLo >::value, &n, a, &lda,
+ b, &ldb, w, work, &lwork, iwork, &liwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hegvd( const fortran_int_t itype, const char jobz,
+ const UpLo uplo, const fortran_int_t n, double* a,
+ const fortran_int_t lda, double* b, const fortran_int_t ldb,
+ double* w, double* work, const fortran_int_t lwork,
+ fortran_int_t* iwork, const fortran_int_t liwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSYGVD( &itype, &jobz, &lapack_option< UpLo >::value, &n, a, &lda,
+ b, &ldb, w, work, &lwork, iwork, &liwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -89,8 +126,150 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hegvd.
 //
+template< typename Value, typename Enable = void >
+struct hegvd_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hegvd_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename WORK, typename IWORK >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, MatrixA& a, MatrixB& b, VectorW& w,
+ detail::workspace2< WORK, IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( jobz, bindings::size_column(a) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( jobz, bindings::size_column(a) ));
+ BOOST_ASSERT( bindings::size_column(a) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::size_minor(b) == 1 ||
+ bindings::stride_minor(b) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ return detail::hegvd( itype, jobz, uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(b), bindings::stride_major(b),
+ bindings::begin_value(w),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())),
+ bindings::size(work.select(fortran_int_t())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename MatrixB, typename VectorW >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, MatrixA& a, MatrixB& b, VectorW& w,
+ minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work( jobz,
+ bindings::size_column(a) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( jobz, bindings::size_column(a) ) );
+ return invoke( itype, jobz, a, b, w, workspace( tmp_work,
+ tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename MatrixB, typename VectorW >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, MatrixA& a, MatrixB& b, VectorW& w,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ real_type opt_size_work;
+ fortran_int_t opt_size_iwork;
+ detail::hegvd( itype, jobz, uplo(), bindings::size_column(a),
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(b), bindings::stride_major(b),
+ bindings::begin_value(w), &opt_size_work, -1, &opt_size_iwork,
+ -1 );
+ 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( itype, jobz, a, b, w, workspace( tmp_work,
+ tmp_iwork ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const char jobz,
+ const std::ptrdiff_t n ) {
+ if ( n < 2 )
+ return 1;
+ else {
+ if ( jobz == 'N' )
+ return 2*n + 1;
+ else
+ return 1 + 6*n + 2*n*n;
+ }
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const char jobz,
+ const std::ptrdiff_t n ) {
+ if ( jobz == 'N' || n < 2 )
+ return 1;
+ else
+ return 3 + 5*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hegvd_impl {
+struct hegvd_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hegvx.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hegvx.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hegvx.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hegvx is the netlib-compatible backend.
@@ -50,6 +53,48 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hegvx( const fortran_int_t itype, const char jobz,
+ const char range, const UpLo uplo, const fortran_int_t n, float* a,
+ const fortran_int_t lda, float* b, const fortran_int_t ldb,
+ const float vl, const float vu, const fortran_int_t il,
+ const fortran_int_t iu, const float abstol, fortran_int_t& m,
+ float* w, float* z, const fortran_int_t ldz, float* work,
+ const fortran_int_t lwork, fortran_int_t* iwork,
+ fortran_int_t* ifail ) {
+ fortran_int_t info(0);
+ LAPACK_SSYGVX( &itype, &jobz, &range, &lapack_option< UpLo >::value, &n,
+ a, &lda, b, &ldb, &vl, &vu, &il, &iu, &abstol, &m, w, z, &ldz,
+ work, &lwork, iwork, ifail, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hegvx( const fortran_int_t itype, const char jobz,
+ const char range, const UpLo uplo, const fortran_int_t n, double* a,
+ const fortran_int_t lda, double* b, const fortran_int_t ldb,
+ const double vl, const double vu, const fortran_int_t il,
+ const fortran_int_t iu, const double abstol, fortran_int_t& m,
+ double* w, double* z, const fortran_int_t ldz, double* work,
+ const fortran_int_t lwork, fortran_int_t* iwork,
+ fortran_int_t* ifail ) {
+ fortran_int_t info(0);
+ LAPACK_DSYGVX( &itype, &jobz, &range, &lapack_option< UpLo >::value, &n,
+ a, &lda, b, &ldb, &vl, &vu, &il, &iu, &abstol, &m, w, z, &ldz,
+ work, &lwork, iwork, ifail, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -97,8 +142,163 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hegvx.
 //
+template< typename Value, typename Enable = void >
+struct hegvx_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
 template< typename Value >
-struct hegvx_impl {
+struct hegvx_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename WORK,
+ typename IWORK >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, const char range, const fortran_int_t n,
+ MatrixA& a, MatrixB& b, const real_type vl, const real_type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const real_type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, detail::workspace2< WORK,
+ IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixZ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIFAIL >::value) );
+ BOOST_ASSERT( bindings::size(w) >= n );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( n ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( n ));
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::size_minor(b) == 1 ||
+ bindings::stride_minor(b) == 1 );
+ BOOST_ASSERT( bindings::size_minor(z) == 1 ||
+ bindings::stride_minor(z) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ n) );
+ BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
+ n) );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ BOOST_ASSERT( n >= 0 );
+ BOOST_ASSERT( range == 'A' || range == 'V' || range == 'I' );
+ return detail::hegvx( itype, jobz, range, uplo(), n,
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(b), bindings::stride_major(b), vl, vu,
+ il, iu, abstol, m, bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())),
+ bindings::begin_value(ifail) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, const char range, const fortran_int_t n,
+ MatrixA& a, MatrixB& b, const real_type vl, const real_type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const real_type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work( n ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( n ) );
+ return invoke( itype, jobz, range, n, a, b, vl, vu, il, iu, abstol, m,
+ w, z, ifail, workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, const char range, const fortran_int_t n,
+ MatrixA& a, MatrixB& b, const real_type vl, const real_type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const real_type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ real_type opt_size_work;
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( n ) );
+ detail::hegvx( itype, jobz, range, uplo(), n,
+ bindings::begin_value(a), bindings::stride_major(a),
+ bindings::begin_value(b), bindings::stride_major(b), vl, vu,
+ il, iu, abstol, m, bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ &opt_size_work, -1, bindings::begin_value(tmp_iwork),
+ bindings::begin_value(ifail) );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( itype, jobz, range, n, a, b, vl, vu, il, iu, abstol, m,
+ w, z, ifail, workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return std::max< std::ptrdiff_t >(1,8*n);
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t n ) {
+ return 5*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
+template< typename Value >
+struct hegvx_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;
@@ -280,6 +480,405 @@
 inline typename boost::enable_if< detail::is_workspace< Workspace >,
         std::ptrdiff_t >::type
 hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixA& a, MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hegvx. Its overload differs for
+// * MatrixA&
+// * MatrixB&
+// * MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixA& a, MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+
+//
+// Overloaded function for hegvx. Its overload differs for
+// * const MatrixA&
+// * MatrixB&
+// * MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixA& a, MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hegvx. Its overload differs for
+// * const MatrixA&
+// * MatrixB&
+// * MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixA& a, MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+
+//
+// Overloaded function for hegvx. Its overload differs for
+// * MatrixA&
+// * const MatrixB&
+// * MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixA& a, const MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hegvx. Its overload differs for
+// * MatrixA&
+// * const MatrixB&
+// * MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixA& a, const MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+
+//
+// Overloaded function for hegvx. Its overload differs for
+// * const MatrixA&
+// * const MatrixB&
+// * MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixA& a, const MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hegvx. Its overload differs for
+// * const MatrixA&
+// * const MatrixB&
+// * MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixA& a, const MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+
+//
+// Overloaded function for hegvx. Its overload differs for
+// * MatrixA&
+// * MatrixB&
+// * const MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixA& a, MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hegvx. Its overload differs for
+// * MatrixA&
+// * MatrixB&
+// * const MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixA& a, MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+
+//
+// Overloaded function for hegvx. Its overload differs for
+// * const MatrixA&
+// * MatrixB&
+// * const MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixA& a, MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hegvx. Its overload differs for
+// * const MatrixA&
+// * MatrixB&
+// * const MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixA& a, MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+
+//
+// Overloaded function for hegvx. Its overload differs for
+// * MatrixA&
+// * const MatrixB&
+// * const MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixA& a, const MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hegvx. Its overload differs for
+// * MatrixA&
+// * const MatrixB&
+// * const MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixA& a, const MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+
+//
+// Overloaded function for hegvx. Its overload differs for
+// * const MatrixA&
+// * const MatrixB&
+// * const MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixA& a, const MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hegvx. Its overload differs for
+// * const MatrixA&
+// * const MatrixB&
+// * const MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixA& a, const MatrixB& b,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixA >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail ) {
+ return hegvx_impl< typename bindings::value_type<
+ MatrixA >::type >::invoke( itype, jobz, range, n, a, b, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+//
+// Overloaded function for hegvx. Its overload differs for
+// * MatrixA&
+// * MatrixB&
+// * MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixA, typename MatrixB, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hegvx( const fortran_int_t itype, const char jobz, const char range,
         MatrixA& a, MatrixB& b, const typename remove_imaginary<
         typename bindings::value_type< MatrixA >::type >::type vl,
         const typename remove_imaginary< typename bindings::value_type<

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hesv.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hesv.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hesv.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hesv is the netlib-compatible backend.
@@ -50,6 +53,38 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hesv( const UpLo uplo, const fortran_int_t n,
+ const fortran_int_t nrhs, float* a, const fortran_int_t lda,
+ fortran_int_t* ipiv, float* b, const fortran_int_t ldb, float* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSYSV( &lapack_option< UpLo >::value, &n, &nrhs, a, &lda, ipiv, b,
+ &ldb, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hesv( const UpLo uplo, const fortran_int_t n,
+ const fortran_int_t nrhs, double* a, const fortran_int_t lda,
+ fortran_int_t* ipiv, double* b, const fortran_int_t ldb, double* work,
+ const fortran_int_t lwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSYSV( &lapack_option< UpLo >::value, &n, &nrhs, a, &lda, ipiv, b,
+ &ldb, work, &lwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -87,8 +122,111 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hesv.
 //
+template< typename Value, typename Enable = void >
+struct hesv_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hesv_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename VectorIPIV, typename MatrixB,
+ typename WORK >
+ static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv, MatrixB& b,
+ detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIPIV >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixB >::value) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work());
+ BOOST_ASSERT( bindings::size_column(a) >= 0 );
+ BOOST_ASSERT( bindings::size_column(b) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::size_minor(b) == 1 ||
+ bindings::stride_minor(b) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ return detail::hesv( uplo(), bindings::size_column(a),
+ bindings::size_column(b), bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(ipiv),
+ bindings::begin_value(b), bindings::stride_major(b),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename VectorIPIV, typename MatrixB >
+ static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv, MatrixB& b,
+ minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work() );
+ return invoke( a, ipiv, b, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename VectorIPIV, typename MatrixB >
+ static std::ptrdiff_t invoke( MatrixA& a, VectorIPIV& ipiv, MatrixB& b,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ real_type opt_size_work;
+ detail::hesv( uplo(), bindings::size_column(a),
+ bindings::size_column(b), bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(ipiv),
+ bindings::begin_value(b), bindings::stride_major(b),
+ &opt_size_work, -1 );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( a, ipiv, b, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work() {
+ return 1;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hesv_impl {
+struct hesv_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hesvx.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hesvx.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hesvx.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hesvx is the netlib-compatible backend.
@@ -50,6 +53,46 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hesvx( const char fact, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t nrhs, const float* a,
+ const fortran_int_t lda, float* af, const fortran_int_t ldaf,
+ fortran_int_t* ipiv, const float* b, const fortran_int_t ldb,
+ float* x, const fortran_int_t ldx, float& rcond, float* ferr,
+ float* berr, float* work, const fortran_int_t lwork,
+ fortran_int_t* iwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSYSVX( &fact, &lapack_option< UpLo >::value, &n, &nrhs, a, &lda,
+ af, &ldaf, ipiv, b, &ldb, x, &ldx, &rcond, ferr, berr, work,
+ &lwork, iwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hesvx( const char fact, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t nrhs, const double* a,
+ const fortran_int_t lda, double* af, const fortran_int_t ldaf,
+ fortran_int_t* ipiv, const double* b, const fortran_int_t ldb,
+ double* x, const fortran_int_t ldx, double& rcond, double* ferr,
+ double* berr, double* work, const fortran_int_t lwork,
+ fortran_int_t* iwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSYSVX( &fact, &lapack_option< UpLo >::value, &n, &nrhs, a, &lda,
+ af, &ldaf, ipiv, b, &ldb, x, &ldx, &rcond, ferr, berr, work,
+ &lwork, iwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -96,8 +139,176 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hesvx.
 //
+template< typename Value, typename Enable = void >
+struct hesvx_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hesvx_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixA, typename MatrixAF, typename VectorIPIV,
+ typename MatrixB, typename MatrixX, typename VectorFERR,
+ typename VectorBERR, typename WORK, typename IWORK >
+ static std::ptrdiff_t invoke( const char fact, const MatrixA& a,
+ MatrixAF& af, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ real_type& rcond, VectorFERR& ferr, VectorBERR& berr,
+ detail::workspace2< WORK, IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixA >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixAF >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixX >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixAF >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixX >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorFERR >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixA >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorBERR >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAF >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIPIV >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixX >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorFERR >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorBERR >::value) );
+ BOOST_ASSERT( bindings::size(berr) >= bindings::size_column(b) );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( bindings::size_column(a) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(a) ));
+ BOOST_ASSERT( bindings::size_column(a) >= 0 );
+ BOOST_ASSERT( bindings::size_column(b) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(a) == 1 ||
+ bindings::stride_minor(a) == 1 );
+ BOOST_ASSERT( bindings::size_minor(af) == 1 ||
+ bindings::stride_minor(af) == 1 );
+ BOOST_ASSERT( bindings::size_minor(b) == 1 ||
+ bindings::stride_minor(b) == 1 );
+ BOOST_ASSERT( bindings::size_minor(x) == 1 ||
+ bindings::stride_minor(x) == 1 );
+ BOOST_ASSERT( bindings::stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(af) >= std::max<
+ std::ptrdiff_t >(1,bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( bindings::stride_major(x) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(a)) );
+ BOOST_ASSERT( fact == 'F' || fact == 'N' );
+ return detail::hesvx( fact, uplo(), bindings::size_column(a),
+ bindings::size_column(b), bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(af),
+ bindings::stride_major(af), bindings::begin_value(ipiv),
+ bindings::begin_value(b), bindings::stride_major(b),
+ bindings::begin_value(x), bindings::stride_major(x), rcond,
+ bindings::begin_value(ferr), bindings::begin_value(berr),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixA, typename MatrixAF, typename VectorIPIV,
+ typename MatrixB, typename MatrixX, typename VectorFERR,
+ typename VectorBERR >
+ static std::ptrdiff_t invoke( const char fact, const MatrixA& a,
+ MatrixAF& af, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ real_type& rcond, VectorFERR& ferr, VectorBERR& berr,
+ minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(a) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( bindings::size_column(a) ) );
+ return invoke( fact, a, af, ipiv, b, x, rcond, ferr, berr,
+ workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixA, typename MatrixAF, typename VectorIPIV,
+ typename MatrixB, typename MatrixX, typename VectorFERR,
+ typename VectorBERR >
+ static std::ptrdiff_t invoke( const char fact, const MatrixA& a,
+ MatrixAF& af, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ real_type& rcond, VectorFERR& ferr, VectorBERR& berr,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixA >::type uplo;
+ real_type opt_size_work;
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( bindings::size_column(a) ) );
+ detail::hesvx( fact, uplo(), bindings::size_column(a),
+ bindings::size_column(b), bindings::begin_value(a),
+ bindings::stride_major(a), bindings::begin_value(af),
+ bindings::stride_major(af), bindings::begin_value(ipiv),
+ bindings::begin_value(b), bindings::stride_major(b),
+ bindings::begin_value(x), bindings::stride_major(x), rcond,
+ bindings::begin_value(ferr), bindings::begin_value(berr),
+ &opt_size_work, -1, bindings::begin_value(tmp_iwork) );
+ bindings::detail::array< real_type > tmp_work(
+ traits::detail::to_int( opt_size_work ) );
+ return invoke( fact, a, af, ipiv, b, x, rcond, ferr, berr,
+ workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return std::max< std::ptrdiff_t >( 1, 3*n );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t n ) {
+ return n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hesvx_impl {
+struct hesvx_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpev.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpev.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpev.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hpev is the netlib-compatible backend.
@@ -49,6 +52,36 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpev( const char jobz, const UpLo uplo,
+ const fortran_int_t n, float* ap, float* w, float* z,
+ const fortran_int_t ldz, float* work ) {
+ fortran_int_t info(0);
+ LAPACK_SSPEV( &jobz, &lapack_option< UpLo >::value, &n, ap, w, z, &ldz,
+ work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpev( const char jobz, const UpLo uplo,
+ const fortran_int_t n, double* ap, double* w, double* z,
+ const fortran_int_t ldz, double* work ) {
+ fortran_int_t info(0);
+ LAPACK_DSPEV( &jobz, &lapack_option< UpLo >::value, &n, ap, w, z, &ldz,
+ work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -84,8 +117,99 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hpev.
 //
+template< typename Value, typename Enable = void >
+struct hpev_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hpev_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAP, typename VectorW, typename MatrixZ,
+ typename WORK >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAP& ap, VectorW& w,
+ MatrixZ& z, detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixZ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAP >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(ap) ));
+ BOOST_ASSERT( bindings::size_column(ap) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(z) == 1 ||
+ bindings::stride_minor(z) == 1 );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ return detail::hpev( jobz, uplo(), bindings::size_column(ap),
+ bindings::begin_value(ap), bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ bindings::begin_value(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAP, typename VectorW, typename MatrixZ >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAP& ap, VectorW& w,
+ MatrixZ& z, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(ap) ) );
+ return invoke( jobz, ap, w, z, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAP, typename VectorW, typename MatrixZ >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAP& ap, VectorW& w,
+ MatrixZ& z, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ return invoke( jobz, ap, w, z, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return 3*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hpev_impl {
+struct hpev_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpevd.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpevd.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpevd.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hpevd is the netlib-compatible backend.
@@ -50,6 +53,38 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpevd( const char jobz, const UpLo uplo,
+ const fortran_int_t n, float* ap, float* w, float* z,
+ const fortran_int_t ldz, float* work, const fortran_int_t lwork,
+ fortran_int_t* iwork, const fortran_int_t liwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSPEVD( &jobz, &lapack_option< UpLo >::value, &n, ap, w, z, &ldz,
+ work, &lwork, iwork, &liwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpevd( const char jobz, const UpLo uplo,
+ const fortran_int_t n, double* ap, double* w, double* z,
+ const fortran_int_t ldz, double* work, const fortran_int_t lwork,
+ fortran_int_t* iwork, const fortran_int_t liwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSPEVD( &jobz, &lapack_option< UpLo >::value, &n, ap, w, z, &ldz,
+ work, &lwork, iwork, &liwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -89,8 +124,136 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hpevd.
 //
+template< typename Value, typename Enable = void >
+struct hpevd_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hpevd_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAP, typename VectorW, typename MatrixZ,
+ typename WORK, typename IWORK >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAP& ap, VectorW& w,
+ MatrixZ& z, detail::workspace2< WORK, IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixZ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAP >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( jobz, bindings::size_column(ap) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( jobz, bindings::size_column(ap) ));
+ BOOST_ASSERT( bindings::size_column(ap) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(z) == 1 ||
+ bindings::stride_minor(z) == 1 );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ return detail::hpevd( jobz, uplo(), bindings::size_column(ap),
+ bindings::begin_value(ap), bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())),
+ bindings::size(work.select(fortran_int_t())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAP, typename VectorW, typename MatrixZ >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAP& ap, VectorW& w,
+ MatrixZ& z, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work( jobz,
+ bindings::size_column(ap) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( jobz, bindings::size_column(ap) ) );
+ return invoke( jobz, ap, w, z, workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAP, typename VectorW, typename MatrixZ >
+ static std::ptrdiff_t invoke( const char jobz, MatrixAP& ap, VectorW& w,
+ MatrixZ& z, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ real_type opt_size_work;
+ fortran_int_t opt_size_iwork;
+ detail::hpevd( jobz, uplo(), bindings::size_column(ap),
+ bindings::begin_value(ap), bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ &opt_size_work, -1, &opt_size_iwork, -1 );
+ 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( jobz, ap, w, z, workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const char jobz,
+ const std::ptrdiff_t n ) {
+ if ( n < 2 )
+ return 1;
+ else {
+ if ( jobz == 'N' )
+ return 2*n;
+ else
+ return 1 + 6*n + n*n;
+ }
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const char jobz,
+ const std::ptrdiff_t n ) {
+ if ( jobz == 'N' || n < 2 )
+ return 1;
+ else
+ return 3 + 5*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hpevd_impl {
+struct hpevd_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpevx.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpevx.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpevx.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hpevx is the netlib-compatible backend.
@@ -49,6 +52,44 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpevx( const char jobz, const char range,
+ const UpLo uplo, const fortran_int_t n, float* ap, const float vl,
+ const float vu, const fortran_int_t il, const fortran_int_t iu,
+ const float abstol, fortran_int_t& m, float* w, float* z,
+ const fortran_int_t ldz, float* work, fortran_int_t* iwork,
+ fortran_int_t* ifail ) {
+ fortran_int_t info(0);
+ LAPACK_SSPEVX( &jobz, &range, &lapack_option< UpLo >::value, &n, ap, &vl,
+ &vu, &il, &iu, &abstol, &m, w, z, &ldz, work, iwork, ifail,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpevx( const char jobz, const char range,
+ const UpLo uplo, const fortran_int_t n, double* ap, const double vl,
+ const double vu, const fortran_int_t il, const fortran_int_t iu,
+ const double abstol, fortran_int_t& m, double* w, double* z,
+ const fortran_int_t ldz, double* work, fortran_int_t* iwork,
+ fortran_int_t* ifail ) {
+ fortran_int_t info(0);
+ LAPACK_DSPEVX( &jobz, &range, &lapack_option< UpLo >::value, &n, ap, &vl,
+ &vu, &il, &iu, &abstol, &m, w, z, &ldz, work, iwork, ifail,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -92,8 +133,130 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hpevx.
 //
+template< typename Value, typename Enable = void >
+struct hpevx_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hpevx_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAP, typename VectorW, typename MatrixZ,
+ typename VectorIFAIL, typename WORK, typename IWORK >
+ static std::ptrdiff_t invoke( const char jobz, const char range,
+ MatrixAP& ap, const real_type vl, const real_type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const real_type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, detail::workspace2< WORK,
+ IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixZ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAP >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIFAIL >::value) );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( bindings::size_column(ap) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(ap) ));
+ BOOST_ASSERT( bindings::size_column(ap) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(z) == 1 ||
+ bindings::stride_minor(z) == 1 );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ BOOST_ASSERT( range == 'A' || range == 'V' || range == 'I' );
+ return detail::hpevx( jobz, range, uplo(), bindings::size_column(ap),
+ bindings::begin_value(ap), vl, vu, il, iu, abstol, m,
+ bindings::begin_value(w), bindings::begin_value(z),
+ bindings::stride_major(z),
+ bindings::begin_value(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())),
+ bindings::begin_value(ifail) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAP, typename VectorW, typename MatrixZ,
+ typename VectorIFAIL >
+ static std::ptrdiff_t invoke( const char jobz, const char range,
+ MatrixAP& ap, const real_type vl, const real_type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const real_type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(ap) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( bindings::size_column(ap) ) );
+ return invoke( jobz, range, ap, vl, vu, il, iu, abstol, m, w, z,
+ ifail, workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAP, typename VectorW, typename MatrixZ,
+ typename VectorIFAIL >
+ static std::ptrdiff_t invoke( const char jobz, const char range,
+ MatrixAP& ap, const real_type vl, const real_type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const real_type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ return invoke( jobz, range, ap, vl, vu, il, iu, abstol, m, w, z,
+ ifail, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return 8*n;
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t n ) {
+ return 5*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hpevx_impl {
+struct hpevx_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpgv.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpgv.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpgv.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hpgv is the netlib-compatible backend.
@@ -49,6 +52,36 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpgv( const fortran_int_t itype, const char jobz,
+ const UpLo uplo, const fortran_int_t n, float* ap, float* bp,
+ float* w, float* z, const fortran_int_t ldz, float* work ) {
+ fortran_int_t info(0);
+ LAPACK_SSPGV( &itype, &jobz, &lapack_option< UpLo >::value, &n, ap, bp, w,
+ z, &ldz, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpgv( const fortran_int_t itype, const char jobz,
+ const UpLo uplo, const fortran_int_t n, double* ap, double* bp,
+ double* w, double* z, const fortran_int_t ldz, double* work ) {
+ fortran_int_t info(0);
+ LAPACK_DSPGV( &itype, &jobz, &lapack_option< UpLo >::value, &n, ap, bp, w,
+ z, &ldz, work, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -84,8 +117,110 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hpgv.
 //
+template< typename Value, typename Enable = void >
+struct hpgv_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hpgv_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename WORK >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, MatrixAP& ap, MatrixBP& bp, VectorW& w,
+ MatrixZ& z, detail::workspace1< WORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixBP >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixZ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAP >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixBP >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(ap) ));
+ BOOST_ASSERT( bindings::size_column(ap) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(z) == 1 ||
+ bindings::stride_minor(z) == 1 );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ return detail::hpgv( itype, jobz, uplo(), bindings::size_column(ap),
+ bindings::begin_value(ap), bindings::begin_value(bp),
+ bindings::begin_value(w), bindings::begin_value(z),
+ bindings::stride_major(z),
+ bindings::begin_value(work.select(real_type())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, MatrixAP& ap, MatrixBP& bp, VectorW& w,
+ MatrixZ& z, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(ap) ) );
+ return invoke( itype, jobz, ap, bp, w, z, workspace( tmp_work ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, MatrixAP& ap, MatrixBP& bp, VectorW& w,
+ MatrixZ& z, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ return invoke( itype, jobz, ap, bp, w, z, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return 3*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hpgv_impl {
+struct hpgv_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpgvd.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpgvd.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpgvd.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -29,6 +31,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hpgvd is the netlib-compatible backend.
@@ -50,6 +53,40 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpgvd( const fortran_int_t itype, const char jobz,
+ const UpLo uplo, const fortran_int_t n, float* ap, float* bp,
+ float* w, float* z, const fortran_int_t ldz, float* work,
+ const fortran_int_t lwork, fortran_int_t* iwork,
+ const fortran_int_t liwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSPGVD( &itype, &jobz, &lapack_option< UpLo >::value, &n, ap, bp,
+ w, z, &ldz, work, &lwork, iwork, &liwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpgvd( const fortran_int_t itype, const char jobz,
+ const UpLo uplo, const fortran_int_t n, double* ap, double* bp,
+ double* w, double* z, const fortran_int_t ldz, double* work,
+ const fortran_int_t lwork, fortran_int_t* iwork,
+ const fortran_int_t liwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSPGVD( &itype, &jobz, &lapack_option< UpLo >::value, &n, ap, bp,
+ w, z, &ldz, work, &lwork, iwork, &liwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -89,8 +126,150 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hpgvd.
 //
+template< typename Value, typename Enable = void >
+struct hpgvd_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hpgvd_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename WORK, typename IWORK >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, MatrixAP& ap, MatrixBP& bp, VectorW& w,
+ MatrixZ& z, detail::workspace2< WORK, IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixBP >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixZ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAP >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixBP >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( jobz, bindings::size_column(ap) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( jobz, bindings::size_column(ap) ));
+ BOOST_ASSERT( bindings::size_column(ap) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(z) == 1 ||
+ bindings::stride_minor(z) == 1 );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ return detail::hpgvd( itype, jobz, uplo(), bindings::size_column(ap),
+ bindings::begin_value(ap), bindings::begin_value(bp),
+ bindings::begin_value(w), bindings::begin_value(z),
+ bindings::stride_major(z),
+ bindings::begin_value(work.select(real_type())),
+ bindings::size(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())),
+ bindings::size(work.select(fortran_int_t())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, MatrixAP& ap, MatrixBP& bp, VectorW& w,
+ MatrixZ& z, minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work( jobz,
+ bindings::size_column(ap) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( jobz, bindings::size_column(ap) ) );
+ return invoke( itype, jobz, ap, bp, w, z, workspace( tmp_work,
+ tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, MatrixAP& ap, MatrixBP& bp, VectorW& w,
+ MatrixZ& z, optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ real_type opt_size_work;
+ fortran_int_t opt_size_iwork;
+ detail::hpgvd( itype, jobz, uplo(), bindings::size_column(ap),
+ bindings::begin_value(ap), bindings::begin_value(bp),
+ bindings::begin_value(w), bindings::begin_value(z),
+ bindings::stride_major(z), &opt_size_work, -1,
+ &opt_size_iwork, -1 );
+ 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( itype, jobz, ap, bp, w, z, workspace( tmp_work,
+ tmp_iwork ) );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const char jobz,
+ const std::ptrdiff_t n ) {
+ if ( n < 2 )
+ return 1;
+ else {
+ if ( jobz == 'N' )
+ return 2*n;
+ else
+ return 1 + 6*n + n*n;
+ }
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const char jobz,
+ const std::ptrdiff_t n ) {
+ if ( jobz == 'N' || n < 2 )
+ return 1;
+ else
+ return 3 + 5*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hpgvd_impl {
+struct hpgvd_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpgvx.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpgvx.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpgvx.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hpgvx is the netlib-compatible backend.
@@ -49,6 +52,44 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpgvx( const fortran_int_t itype, const char jobz,
+ const char range, const UpLo uplo, const fortran_int_t n, float* ap,
+ float* bp, const float vl, const float vu, const fortran_int_t il,
+ const fortran_int_t iu, const float abstol, fortran_int_t& m,
+ float* w, float* z, const fortran_int_t ldz, float* work,
+ fortran_int_t* iwork, fortran_int_t* ifail ) {
+ fortran_int_t info(0);
+ LAPACK_SSPGVX( &itype, &jobz, &range, &lapack_option< UpLo >::value, &n,
+ ap, bp, &vl, &vu, &il, &iu, &abstol, &m, w, z, &ldz, work, iwork,
+ ifail, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpgvx( const fortran_int_t itype, const char jobz,
+ const char range, const UpLo uplo, const fortran_int_t n, double* ap,
+ double* bp, const double vl, const double vu, const fortran_int_t il,
+ const fortran_int_t iu, const double abstol, fortran_int_t& m,
+ double* w, double* z, const fortran_int_t ldz, double* work,
+ fortran_int_t* iwork, fortran_int_t* ifail ) {
+ fortran_int_t info(0);
+ LAPACK_DSPGVX( &itype, &jobz, &range, &lapack_option< UpLo >::value, &n,
+ ap, bp, &vl, &vu, &il, &iu, &abstol, &m, w, z, &ldz, work, iwork,
+ ifail, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -94,8 +135,141 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hpgvx.
 //
+template< typename Value, typename Enable = void >
+struct hpgvx_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hpgvx_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename WORK,
+ typename IWORK >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, const char range, const fortran_int_t n,
+ MatrixAP& ap, MatrixBP& bp, const real_type vl,
+ const real_type vu, const fortran_int_t il,
+ const fortran_int_t iu, const real_type abstol,
+ fortran_int_t& m, VectorW& w, MatrixZ& z, VectorIFAIL& ifail,
+ detail::workspace2< WORK, IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixBP >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorW >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixZ >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAP >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixBP >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorW >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixZ >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIFAIL >::value) );
+ BOOST_ASSERT( bindings::size(w) >= n );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( n ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( n ));
+ BOOST_ASSERT( bindings::size_minor(z) == 1 ||
+ bindings::stride_minor(z) == 1 );
+ BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
+ BOOST_ASSERT( n >= 0 );
+ BOOST_ASSERT( range == 'A' || range == 'V' || range == 'I' );
+ return detail::hpgvx( itype, jobz, range, uplo(), n,
+ bindings::begin_value(ap), bindings::begin_value(bp), vl, vu,
+ il, iu, abstol, m, bindings::begin_value(w),
+ bindings::begin_value(z), bindings::stride_major(z),
+ bindings::begin_value(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())),
+ bindings::begin_value(ifail) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, const char range, const fortran_int_t n,
+ MatrixAP& ap, MatrixBP& bp, const real_type vl,
+ const real_type vu, const fortran_int_t il,
+ const fortran_int_t iu, const real_type abstol,
+ fortran_int_t& m, VectorW& w, MatrixZ& z, VectorIFAIL& ifail,
+ minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work( n ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( n ) );
+ return invoke( itype, jobz, range, n, ap, bp, vl, vu, il, iu, abstol,
+ m, w, z, ifail, workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+ static std::ptrdiff_t invoke( const fortran_int_t itype,
+ const char jobz, const char range, const fortran_int_t n,
+ MatrixAP& ap, MatrixBP& bp, const real_type vl,
+ const real_type vu, const fortran_int_t il,
+ const fortran_int_t iu, const real_type abstol,
+ fortran_int_t& m, VectorW& w, MatrixZ& z, VectorIFAIL& ifail,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ return invoke( itype, jobz, range, n, ap, bp, vl, vu, il, iu, abstol,
+ m, w, z, ifail, minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return 8*n;
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t n ) {
+ return 5*n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hpgvx_impl {
+struct hpgvx_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;
@@ -249,6 +423,405 @@
 inline typename boost::enable_if< detail::is_workspace< Workspace >,
         std::ptrdiff_t >::type
 hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixAP& ap, MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * MatrixAP&
+// * MatrixBP&
+// * MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixAP& ap, MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * const MatrixAP&
+// * MatrixBP&
+// * MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixAP& ap, MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * const MatrixAP&
+// * MatrixBP&
+// * MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixAP& ap, MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * MatrixAP&
+// * const MatrixBP&
+// * MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixAP& ap, const MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * MatrixAP&
+// * const MatrixBP&
+// * MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixAP& ap, const MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * const MatrixAP&
+// * const MatrixBP&
+// * MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixAP& ap, const MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * const MatrixAP&
+// * const MatrixBP&
+// * MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixAP& ap, const MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ MatrixZ& z, VectorIFAIL& ifail ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * MatrixAP&
+// * MatrixBP&
+// * const MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixAP& ap, MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * MatrixAP&
+// * MatrixBP&
+// * const MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixAP& ap, MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * const MatrixAP&
+// * MatrixBP&
+// * const MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixAP& ap, MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * const MatrixAP&
+// * MatrixBP&
+// * const MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixAP& ap, MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * MatrixAP&
+// * const MatrixBP&
+// * const MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixAP& ap, const MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * MatrixAP&
+// * const MatrixBP&
+// * const MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, MatrixAP& ap, const MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * const MatrixAP&
+// * const MatrixBP&
+// * const MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixAP& ap, const MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, work );
+}
+
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * const MatrixAP&
+// * const MatrixBP&
+// * const MatrixZ&
+// * Default workspace-type (optimal)
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL >
+inline typename boost::disable_if< detail::is_workspace< VectorIFAIL >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
+ const fortran_int_t n, const MatrixAP& ap, const MatrixBP& bp,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type vl, const typename remove_imaginary<
+ typename bindings::value_type< MatrixAP >::type >::type vu,
+ const fortran_int_t il, const fortran_int_t iu,
+ const typename remove_imaginary< typename bindings::value_type<
+ MatrixAP >::type >::type abstol, fortran_int_t& m, VectorW& w,
+ const MatrixZ& z, VectorIFAIL& ifail ) {
+ return hpgvx_impl< typename bindings::value_type<
+ MatrixAP >::type >::invoke( itype, jobz, range, n, ap, bp, vl, vu,
+ il, iu, abstol, m, w, z, ifail, optimal_workspace() );
+}
+//
+// Overloaded function for hpgvx. Its overload differs for
+// * MatrixAP&
+// * MatrixBP&
+// * MatrixZ&
+// * User-defined workspace
+//
+template< typename MatrixAP, typename MatrixBP, typename VectorW,
+ typename MatrixZ, typename VectorIFAIL, typename Workspace >
+inline typename boost::enable_if< detail::is_workspace< Workspace >,
+ std::ptrdiff_t >::type
+hpgvx( const fortran_int_t itype, const char jobz, const char range,
         MatrixAP& ap, MatrixBP& bp, const typename remove_imaginary<
         typename bindings::value_type< MatrixAP >::type >::type vl,
         const typename remove_imaginary< typename bindings::value_type<

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpsv.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpsv.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpsv.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -47,6 +47,36 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpsv( const UpLo uplo, const fortran_int_t n,
+ const fortran_int_t nrhs, float* ap, fortran_int_t* ipiv, float* b,
+ const fortran_int_t ldb ) {
+ fortran_int_t info(0);
+ LAPACK_SSPSV( &lapack_option< UpLo >::value, &n, &nrhs, ap, ipiv, b, &ldb,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpsv( const UpLo uplo, const fortran_int_t n,
+ const fortran_int_t nrhs, double* ap, fortran_int_t* ipiv, double* b,
+ const fortran_int_t ldb ) {
+ fortran_int_t info(0);
+ LAPACK_DSPSV( &lapack_option< UpLo >::value, &n, &nrhs, ap, ipiv, b, &ldb,
+ &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpsvx.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpsvx.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hpsvx.hpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,9 @@
 #include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/array.hpp>
 #include <boost/numeric/bindings/is_column_major.hpp>
+#include <boost/numeric/bindings/is_complex.hpp>
 #include <boost/numeric/bindings/is_mutable.hpp>
+#include <boost/numeric/bindings/is_real.hpp>
 #include <boost/numeric/bindings/lapack/workspace.hpp>
 #include <boost/numeric/bindings/remove_imaginary.hpp>
 #include <boost/numeric/bindings/size.hpp>
@@ -28,6 +30,7 @@
 #include <boost/static_assert.hpp>
 #include <boost/type_traits/is_same.hpp>
 #include <boost/type_traits/remove_const.hpp>
+#include <boost/utility/enable_if.hpp>
 
 //
 // The LAPACK-backend for hpsvx is the netlib-compatible backend.
@@ -49,6 +52,42 @@
 //
 // Overloaded function for dispatching to
 // * netlib-compatible LAPACK backend (the default), and
+// * float value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpsvx( const char fact, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t nrhs, const float* ap,
+ float* afp, fortran_int_t* ipiv, const float* b,
+ const fortran_int_t ldb, float* x, const fortran_int_t ldx,
+ float& rcond, float* ferr, float* berr, float* work,
+ fortran_int_t* iwork ) {
+ fortran_int_t info(0);
+ LAPACK_SSPSVX( &fact, &lapack_option< UpLo >::value, &n, &nrhs, ap, afp,
+ ipiv, b, &ldb, x, &ldx, &rcond, ferr, berr, work, iwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
+// * double value-type.
+//
+template< typename UpLo >
+inline std::ptrdiff_t hpsvx( const char fact, const UpLo uplo,
+ const fortran_int_t n, const fortran_int_t nrhs, const double* ap,
+ double* afp, fortran_int_t* ipiv, const double* b,
+ const fortran_int_t ldb, double* x, const fortran_int_t ldx,
+ double& rcond, double* ferr, double* berr, double* work,
+ fortran_int_t* iwork ) {
+ fortran_int_t info(0);
+ LAPACK_DSPSVX( &fact, &lapack_option< UpLo >::value, &n, &nrhs, ap, afp,
+ ipiv, b, &ldb, x, &ldx, &rcond, ferr, berr, work, iwork, &info );
+ return info;
+}
+
+//
+// Overloaded function for dispatching to
+// * netlib-compatible LAPACK backend (the default), and
 // * complex<float> value-type.
 //
 template< typename UpLo >
@@ -90,8 +129,151 @@
 // Value-type based template class. Use this class if you need a type
 // for dispatching to hpsvx.
 //
+template< typename Value, typename Enable = void >
+struct hpsvx_impl {};
+
+//
+// This implementation is enabled if Value is a real type.
+//
+template< typename Value >
+struct hpsvx_impl< Value, typename boost::enable_if< is_real< Value > >::type > {
+
+ typedef Value value_type;
+ typedef typename remove_imaginary< Value >::type real_type;
+
+ //
+ // Static member function for user-defined workspaces, that
+ // * Deduces the required arguments for dispatching to LAPACK, and
+ // * Asserts that most arguments make sense.
+ //
+ template< typename MatrixAP, typename MatrixAFP, typename VectorIPIV,
+ typename MatrixB, typename MatrixX, typename VectorFERR,
+ typename VectorBERR, typename WORK, typename IWORK >
+ static std::ptrdiff_t invoke( const char fact, const MatrixAP& ap,
+ MatrixAFP& afp, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ real_type& rcond, VectorFERR& ferr, VectorBERR& berr,
+ detail::workspace2< WORK, IWORK > work ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixX >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixAFP >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixB >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ MatrixX >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorFERR >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
+ typename bindings::value_type< MatrixAP >::type >::type,
+ typename remove_const< typename bindings::value_type<
+ VectorBERR >::type >::type >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixAFP >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorIPIV >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< MatrixX >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorFERR >::value) );
+ BOOST_STATIC_ASSERT( (bindings::is_mutable< VectorBERR >::value) );
+ BOOST_ASSERT( bindings::size(berr) >= bindings::size_column(b) );
+ BOOST_ASSERT( bindings::size(work.select(fortran_int_t())) >=
+ min_size_iwork( bindings::size_column(ap) ));
+ BOOST_ASSERT( bindings::size(work.select(real_type())) >=
+ min_size_work( bindings::size_column(ap) ));
+ BOOST_ASSERT( bindings::size_column(ap) >= 0 );
+ BOOST_ASSERT( bindings::size_column(b) >= 0 );
+ BOOST_ASSERT( bindings::size_minor(b) == 1 ||
+ bindings::stride_minor(b) == 1 );
+ BOOST_ASSERT( bindings::size_minor(x) == 1 ||
+ bindings::stride_minor(x) == 1 );
+ BOOST_ASSERT( bindings::stride_major(b) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(ap)) );
+ BOOST_ASSERT( bindings::stride_major(x) >= std::max< std::ptrdiff_t >(1,
+ bindings::size_column(ap)) );
+ BOOST_ASSERT( fact == 'F' || fact == 'N' );
+ return detail::hpsvx( fact, uplo(), bindings::size_column(ap),
+ bindings::size_column(b), bindings::begin_value(ap),
+ bindings::begin_value(afp), bindings::begin_value(ipiv),
+ bindings::begin_value(b), bindings::stride_major(b),
+ bindings::begin_value(x), bindings::stride_major(x), rcond,
+ bindings::begin_value(ferr), bindings::begin_value(berr),
+ bindings::begin_value(work.select(real_type())),
+ bindings::begin_value(work.select(fortran_int_t())) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the minimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member function
+ // * Enables the unblocked algorithm (BLAS level 2)
+ //
+ template< typename MatrixAP, typename MatrixAFP, typename VectorIPIV,
+ typename MatrixB, typename MatrixX, typename VectorFERR,
+ typename VectorBERR >
+ static std::ptrdiff_t invoke( const char fact, const MatrixAP& ap,
+ MatrixAFP& afp, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ real_type& rcond, VectorFERR& ferr, VectorBERR& berr,
+ minimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ bindings::detail::array< real_type > tmp_work( min_size_work(
+ bindings::size_column(ap) ) );
+ bindings::detail::array< fortran_int_t > tmp_iwork(
+ min_size_iwork( bindings::size_column(ap) ) );
+ return invoke( fact, ap, afp, ipiv, b, x, rcond, ferr, berr,
+ workspace( tmp_work, tmp_iwork ) );
+ }
+
+ //
+ // Static member function that
+ // * Figures out the optimal workspace requirements, and passes
+ // the results to the user-defined workspace overload of the
+ // invoke static member
+ // * Enables the blocked algorithm (BLAS level 3)
+ //
+ template< typename MatrixAP, typename MatrixAFP, typename VectorIPIV,
+ typename MatrixB, typename MatrixX, typename VectorFERR,
+ typename VectorBERR >
+ static std::ptrdiff_t invoke( const char fact, const MatrixAP& ap,
+ MatrixAFP& afp, VectorIPIV& ipiv, const MatrixB& b, MatrixX& x,
+ real_type& rcond, VectorFERR& ferr, VectorBERR& berr,
+ optimal_workspace ) {
+ namespace bindings = ::boost::numeric::bindings;
+ typedef typename result_of::uplo_tag< MatrixAP >::type uplo;
+ return invoke( fact, ap, afp, ipiv, b, x, rcond, ferr, berr,
+ minimal_workspace() );
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array work.
+ //
+ static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+ return 3*n;
+ }
+
+ //
+ // Static member function that returns the minimum size of
+ // workspace-array iwork.
+ //
+ static std::ptrdiff_t min_size_iwork( const std::ptrdiff_t n ) {
+ return n;
+ }
+};
+
+//
+// This implementation is enabled if Value is a complex type.
+//
 template< typename Value >
-struct hpsvx_impl {
+struct hpsvx_impl< Value, typename boost::enable_if< is_complex< Value > >::type > {
 
     typedef Value value_type;
     typedef typename remove_imaginary< Value >::type real_type;

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hbgst.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hbgst.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hbgst.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `hbgst` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHBGST and ZHBGST.
+interface to LAPACK routines SSBGST, DSBGST, CHBGST, and ZHBGST.
 `hbgst` reduces a complex Hermitian-definite banded generalized
 eigenproblem A*x = lambda*B*x to standard form C*y = lambda*y,
 such that C has the same bandwidth as A.
@@ -35,6 +35,8 @@
 
 [table Dispatching of hbgst
 [ [ Value type of MatrixAB ] [LAPACK routine] ]
+[ [`float`][SSBGST] ]
+[ [`double`][DSBGST] ]
 [ [`complex<float>`][CHBGST] ]
 [ [`complex<double>`][ZHBGST] ]
 
@@ -83,6 +85,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chbgst.f chbgst.f] and [@http://www.netlib.org/lapack/complex16/zhbgst.f zhbgst.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssbgst.f ssbgst.f], [@http://www.netlib.org/lapack/double/dsbgst.f dsbgst.f], [@http://www.netlib.org/lapack/complex/chbgst.f chbgst.f], and [@http://www.netlib.org/lapack/complex16/zhbgst.f zhbgst.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hbtrd.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hbtrd.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hbtrd.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `hbtrd` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHBTRD and ZHBTRD.
+interface to LAPACK routines SSBTRD, DSBTRD, CHBTRD, and ZHBTRD.
 `hbtrd` reduces a complex Hermitian band matrix A to real symmetric
 tridiagonal form T by a unitary similarity transformation:
 Q**H * A * Q = T.
@@ -31,6 +31,8 @@
 
 [table Dispatching of hbtrd
 [ [ Value type of MatrixAB ] [LAPACK routine] ]
+[ [`float`][SSBTRD] ]
+[ [`double`][DSBTRD] ]
 [ [`complex<float>`][CHBTRD] ]
 [ [`complex<double>`][ZHBTRD] ]
 
@@ -79,6 +81,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chbtrd.f chbtrd.f] and [@http://www.netlib.org/lapack/complex16/zhbtrd.f zhbtrd.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssbtrd.f ssbtrd.f], [@http://www.netlib.org/lapack/double/dsbtrd.f dsbtrd.f], [@http://www.netlib.org/lapack/complex/chbtrd.f chbtrd.f], and [@http://www.netlib.org/lapack/complex16/zhbtrd.f zhbtrd.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hecon.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hecon.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hecon.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `hecon` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHECON and ZHECON.
+interface to LAPACK routines SSYCON, DSYCON, CHECON, and ZHECON.
 `hecon` estimates the reciprocal of the condition number of a complex
 Hermitian matrix A using the factorization A = U*D*U**H or
 A = L*D*L**H computed by ZHETRF.
@@ -34,6 +34,8 @@
 
 [table Dispatching of hecon
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYCON] ]
+[ [`double`][DSYCON] ]
 [ [`complex<float>`][CHECON] ]
 [ [`complex<double>`][ZHECON] ]
 
@@ -82,6 +84,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/checon.f checon.f] and [@http://www.netlib.org/lapack/complex16/zhecon.f zhecon.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssycon.f ssycon.f], [@http://www.netlib.org/lapack/double/dsycon.f dsycon.f], [@http://www.netlib.org/lapack/complex/checon.f checon.f], and [@http://www.netlib.org/lapack/complex16/zhecon.f zhecon.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hegst.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hegst.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hegst.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `hegst` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHEGST and ZHEGST.
+interface to LAPACK routines SSYGST, DSYGST, CHEGST, and ZHEGST.
 `hegst` reduces a complex Hermitian-definite generalized
 eigenproblem to standard form.
 
@@ -37,6 +37,8 @@
 
 [table Dispatching of hegst
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYGST] ]
+[ [`double`][DSYGST] ]
 [ [`complex<float>`][CHEGST] ]
 [ [`complex<double>`][ZHEGST] ]
 
@@ -85,6 +87,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chegst.f chegst.f] and [@http://www.netlib.org/lapack/complex16/zhegst.f zhegst.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssygst.f ssygst.f], [@http://www.netlib.org/lapack/double/dsygst.f dsygst.f], [@http://www.netlib.org/lapack/complex/chegst.f chegst.f], and [@http://www.netlib.org/lapack/complex16/zhegst.f zhegst.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/herfs.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/herfs.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/herfs.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `herfs` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHERFS and ZHERFS.
+interface to LAPACK routines SSYRFS, DSYRFS, CHERFS, and ZHERFS.
 `herfs` improves the computed solution to a system of linear
 equations when the coefficient matrix is Hermitian indefinite, and
 provides error bounds and backward error estimates for the solution.
@@ -31,6 +31,8 @@
 
 [table Dispatching of herfs
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYRFS] ]
+[ [`double`][DSYRFS] ]
 [ [`complex<float>`][CHERFS] ]
 [ [`complex<double>`][ZHERFS] ]
 
@@ -79,6 +81,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cherfs.f cherfs.f] and [@http://www.netlib.org/lapack/complex16/zherfs.f zherfs.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssyrfs.f ssyrfs.f], [@http://www.netlib.org/lapack/double/dsyrfs.f dsyrfs.f], [@http://www.netlib.org/lapack/complex/cherfs.f cherfs.f], and [@http://www.netlib.org/lapack/complex16/zherfs.f zherfs.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetrd.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetrd.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetrd.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `hetrd` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHETRD and ZHETRD.
+interface to LAPACK routines SSYTRD, DSYTRD, CHETRD, and ZHETRD.
 `hetrd` reduces a complex Hermitian matrix A to real symmetric
 tridiagonal form T by a unitary similarity transformation:
 Q**H * A * Q = T.
@@ -30,6 +30,8 @@
 
 [table Dispatching of hetrd
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYTRD] ]
+[ [`double`][DSYTRD] ]
 [ [`complex<float>`][CHETRD] ]
 [ [`complex<double>`][ZHETRD] ]
 
@@ -78,6 +80,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chetrd.f chetrd.f] and [@http://www.netlib.org/lapack/complex16/zhetrd.f zhetrd.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssytrd.f ssytrd.f], [@http://www.netlib.org/lapack/double/dsytrd.f dsytrd.f], [@http://www.netlib.org/lapack/complex/chetrd.f chetrd.f], and [@http://www.netlib.org/lapack/complex16/zhetrd.f zhetrd.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetrf.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetrf.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetrf.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `hetrf` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHETRF and ZHETRF.
+interface to LAPACK routines SSYTRF, DSYTRF, CHETRF, and ZHETRF.
 `hetrf` computes the factorization of a complex Hermitian matrix A
 using the Bunch-Kaufman diagonal pivoting method. The form of the
 factorization is
@@ -38,6 +38,8 @@
 
 [table Dispatching of hetrf
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYTRF] ]
+[ [`double`][DSYTRF] ]
 [ [`complex<float>`][CHETRF] ]
 [ [`complex<double>`][ZHETRF] ]
 
@@ -86,6 +88,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chetrf.f chetrf.f] and [@http://www.netlib.org/lapack/complex16/zhetrf.f zhetrf.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssytrf.f ssytrf.f], [@http://www.netlib.org/lapack/double/dsytrf.f dsytrf.f], [@http://www.netlib.org/lapack/complex/chetrf.f chetrf.f], and [@http://www.netlib.org/lapack/complex16/zhetrf.f zhetrf.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetri.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetri.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetri.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `hetri` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHETRI and ZHETRI.
+interface to LAPACK routines SSYTRI, DSYTRI, CHETRI, and ZHETRI.
 `hetri` computes the inverse of a complex Hermitian indefinite matrix
 A using the factorization A = U*D*U**H or A = L*D*L**H computed by
 ZHETRF.
@@ -30,6 +30,8 @@
 
 [table Dispatching of hetri
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYTRI] ]
+[ [`double`][DSYTRI] ]
 [ [`complex<float>`][CHETRI] ]
 [ [`complex<double>`][ZHETRI] ]
 
@@ -78,6 +80,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chetri.f chetri.f] and [@http://www.netlib.org/lapack/complex16/zhetri.f zhetri.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssytri.f ssytri.f], [@http://www.netlib.org/lapack/double/dsytri.f dsytri.f], [@http://www.netlib.org/lapack/complex/chetri.f chetri.f], and [@http://www.netlib.org/lapack/complex16/zhetri.f zhetri.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetrs.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetrs.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hetrs.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `hetrs` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHETRS and ZHETRS.
+interface to LAPACK routines SSYTRS, DSYTRS, CHETRS, and ZHETRS.
 `hetrs` solves a system of linear equations A*X = B with a complex
 Hermitian matrix A using the factorization A = U*D*U**H or
 A = L*D*L**H computed by ZHETRF.
@@ -30,6 +30,8 @@
 
 [table Dispatching of hetrs
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYTRS] ]
+[ [`double`][DSYTRS] ]
 [ [`complex<float>`][CHETRS] ]
 [ [`complex<double>`][ZHETRS] ]
 
@@ -78,6 +80,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chetrs.f chetrs.f] and [@http://www.netlib.org/lapack/complex16/zhetrs.f zhetrs.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssytrs.f ssytrs.f], [@http://www.netlib.org/lapack/double/dsytrs.f dsytrs.f], [@http://www.netlib.org/lapack/complex/chetrs.f chetrs.f], and [@http://www.netlib.org/lapack/complex16/zhetrs.f zhetrs.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hpcon.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hpcon.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hpcon.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `hpcon` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHPCON and ZHPCON.
+interface to LAPACK routines SSPCON, DSPCON, CHPCON, and ZHPCON.
 `hpcon` estimates the reciprocal of the condition number of a complex
 Hermitian packed matrix A using the factorization A = U*D*U**H or
 A = L*D*L**H computed by ZHPTRF.
@@ -34,6 +34,8 @@
 
 [table Dispatching of hpcon
 [ [ Value type of MatrixAP ] [LAPACK routine] ]
+[ [`float`][SSPCON] ]
+[ [`double`][DSPCON] ]
 [ [`complex<float>`][CHPCON] ]
 [ [`complex<double>`][ZHPCON] ]
 
@@ -82,6 +84,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chpcon.f chpcon.f] and [@http://www.netlib.org/lapack/complex16/zhpcon.f zhpcon.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sspcon.f sspcon.f], [@http://www.netlib.org/lapack/double/dspcon.f dspcon.f], [@http://www.netlib.org/lapack/complex/chpcon.f chpcon.f], and [@http://www.netlib.org/lapack/complex16/zhpcon.f zhpcon.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hprfs.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hprfs.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hprfs.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `hprfs` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHPRFS and ZHPRFS.
+interface to LAPACK routines SSPRFS, DSPRFS, CHPRFS, and ZHPRFS.
 `hprfs` improves the computed solution to a system of linear
 equations when the coefficient matrix is Hermitian indefinite
 and packed, and provides error bounds and backward error estimates
@@ -32,6 +32,8 @@
 
 [table Dispatching of hprfs
 [ [ Value type of MatrixAP ] [LAPACK routine] ]
+[ [`float`][SSPRFS] ]
+[ [`double`][DSPRFS] ]
 [ [`complex<float>`][CHPRFS] ]
 [ [`complex<double>`][ZHPRFS] ]
 
@@ -80,6 +82,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chprfs.f chprfs.f] and [@http://www.netlib.org/lapack/complex16/zhprfs.f zhprfs.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssprfs.f ssprfs.f], [@http://www.netlib.org/lapack/double/dsprfs.f dsprfs.f], [@http://www.netlib.org/lapack/complex/chprfs.f chprfs.f], and [@http://www.netlib.org/lapack/complex16/zhprfs.f zhprfs.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptrd.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptrd.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptrd.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `hptrd` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHPTRD and ZHPTRD.
+interface to LAPACK routines SSPTRD, DSPTRD, CHPTRD, and ZHPTRD.
 `hptrd` reduces a complex Hermitian matrix A stored in packed form to
 real symmetric tridiagonal form T by a unitary similarity
 transformation: Q**H * A * Q = T.
@@ -30,6 +30,8 @@
 
 [table Dispatching of hptrd
 [ [ Value type of MatrixAP ] [LAPACK routine] ]
+[ [`float`][SSPTRD] ]
+[ [`double`][DSPTRD] ]
 [ [`complex<float>`][CHPTRD] ]
 [ [`complex<double>`][ZHPTRD] ]
 
@@ -78,6 +80,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chptrd.f chptrd.f] and [@http://www.netlib.org/lapack/complex16/zhptrd.f zhptrd.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssptrd.f ssptrd.f], [@http://www.netlib.org/lapack/double/dsptrd.f dsptrd.f], [@http://www.netlib.org/lapack/complex/chptrd.f chptrd.f], and [@http://www.netlib.org/lapack/complex16/zhptrd.f zhptrd.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptrf.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptrf.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptrf.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `hptrf` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHPTRF and ZHPTRF.
+interface to LAPACK routines SSPTRF, DSPTRF, CHPTRF, and ZHPTRF.
 `hptrf` computes the factorization of a complex Hermitian packed
 matrix A using the Bunch-Kaufman diagonal pivoting method:
 
@@ -35,6 +35,8 @@
 
 [table Dispatching of hptrf
 [ [ Value type of MatrixAP ] [LAPACK routine] ]
+[ [`float`][SSPTRF] ]
+[ [`double`][DSPTRF] ]
 [ [`complex<float>`][CHPTRF] ]
 [ [`complex<double>`][ZHPTRF] ]
 
@@ -83,6 +85,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chptrf.f chptrf.f] and [@http://www.netlib.org/lapack/complex16/zhptrf.f zhptrf.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssptrf.f ssptrf.f], [@http://www.netlib.org/lapack/double/dsptrf.f dsptrf.f], [@http://www.netlib.org/lapack/complex/chptrf.f chptrf.f], and [@http://www.netlib.org/lapack/complex16/zhptrf.f zhptrf.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptri.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptri.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptri.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `hptri` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHPTRI and ZHPTRI.
+interface to LAPACK routines SSPTRI, DSPTRI, CHPTRI, and ZHPTRI.
 `hptri` computes the inverse of a complex Hermitian indefinite matrix
 A in packed storage using the factorization A = U*D*U**H or
 A = L*D*L**H computed by ZHPTRF.
@@ -30,6 +30,8 @@
 
 [table Dispatching of hptri
 [ [ Value type of MatrixAP ] [LAPACK routine] ]
+[ [`float`][SSPTRI] ]
+[ [`double`][DSPTRI] ]
 [ [`complex<float>`][CHPTRI] ]
 [ [`complex<double>`][ZHPTRI] ]
 
@@ -78,6 +80,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chptri.f chptri.f] and [@http://www.netlib.org/lapack/complex16/zhptri.f zhptri.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssptri.f ssptri.f], [@http://www.netlib.org/lapack/double/dsptri.f dsptri.f], [@http://www.netlib.org/lapack/complex/chptri.f chptri.f], and [@http://www.netlib.org/lapack/complex16/zhptri.f zhptri.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptrs.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptrs.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/hptrs.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `hptrs` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHPTRS and ZHPTRS.
+interface to LAPACK routines SSPTRS, DSPTRS, CHPTRS, and ZHPTRS.
 `hptrs` solves a system of linear equations A*X = B with a complex
 Hermitian matrix A stored in packed format using the factorization
 A = U*D*U**H or A = L*D*L**H computed by ZHPTRF.
@@ -30,6 +30,8 @@
 
 [table Dispatching of hptrs
 [ [ Value type of MatrixAP ] [LAPACK routine] ]
+[ [`float`][SSPTRS] ]
+[ [`double`][DSPTRS] ]
 [ [`complex<float>`][CHPTRS] ]
 [ [`complex<double>`][ZHPTRS] ]
 
@@ -78,6 +80,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chptrs.f chptrs.f] and [@http://www.netlib.org/lapack/complex16/zhptrs.f zhptrs.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssptrs.f ssptrs.f], [@http://www.netlib.org/lapack/double/dsptrs.f dsptrs.f], [@http://www.netlib.org/lapack/complex/chptrs.f chptrs.f], and [@http://www.netlib.org/lapack/complex16/zhptrs.f zhptrs.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungbr.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungbr.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungbr.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,7 @@
 [heading Description]
 
 `ungbr` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUNGBR and ZUNGBR.
+interface to LAPACK routines SORGBR, DORGBR, CUNGBR, and ZUNGBR.
 `ungbr` generates one of the complex unitary matrices Q or P**H
 determined by ZGEBRD when reducing a complex matrix A to bidiagonal
 form: A = Q * B * P**H. Q and P**H are defined as products of
@@ -47,6 +47,8 @@
 
 [table Dispatching of ungbr
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SORGBR] ]
+[ [`double`][DORGBR] ]
 [ [`complex<float>`][CUNGBR] ]
 [ [`complex<double>`][ZUNGBR] ]
 
@@ -95,6 +97,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cungbr.f cungbr.f] and [@http://www.netlib.org/lapack/complex16/zungbr.f zungbr.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sorgbr.f sorgbr.f], [@http://www.netlib.org/lapack/double/dorgbr.f dorgbr.f], [@http://www.netlib.org/lapack/complex/cungbr.f cungbr.f], and [@http://www.netlib.org/lapack/complex16/zungbr.f zungbr.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unghr.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unghr.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unghr.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `unghr` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUNGHR and ZUNGHR.
+interface to LAPACK routines SORGHR, DORGHR, CUNGHR, and ZUNGHR.
 `unghr` generates a complex unitary matrix Q which is defined as the
 product of IHI-ILO elementary reflectors of order N, as returned by
 ZGEHRD:
@@ -33,6 +33,8 @@
 
 [table Dispatching of unghr
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SORGHR] ]
+[ [`double`][DORGHR] ]
 [ [`complex<float>`][CUNGHR] ]
 [ [`complex<double>`][ZUNGHR] ]
 
@@ -81,6 +83,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cunghr.f cunghr.f] and [@http://www.netlib.org/lapack/complex16/zunghr.f zunghr.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sorghr.f sorghr.f], [@http://www.netlib.org/lapack/double/dorghr.f dorghr.f], [@http://www.netlib.org/lapack/complex/cunghr.f cunghr.f], and [@http://www.netlib.org/lapack/complex16/zunghr.f zunghr.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unglq.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unglq.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unglq.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `unglq` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUNGLQ and ZUNGLQ.
+interface to LAPACK routines SORGLQ, DORGLQ, CUNGLQ, and ZUNGLQ.
 `unglq` generates an M-by-N complex matrix Q with orthonormal rows,
 which is defined as the first M rows of a product of K elementary
 reflectors of order N
@@ -35,6 +35,8 @@
 
 [table Dispatching of unglq
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SORGLQ] ]
+[ [`double`][DORGLQ] ]
 [ [`complex<float>`][CUNGLQ] ]
 [ [`complex<double>`][ZUNGLQ] ]
 
@@ -83,6 +85,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cunglq.f cunglq.f] and [@http://www.netlib.org/lapack/complex16/zunglq.f zunglq.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sorglq.f sorglq.f], [@http://www.netlib.org/lapack/double/dorglq.f dorglq.f], [@http://www.netlib.org/lapack/complex/cunglq.f cunglq.f], and [@http://www.netlib.org/lapack/complex16/zunglq.f zunglq.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungql.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungql.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungql.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `ungql` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUNGQL and ZUNGQL.
+interface to LAPACK routines SORGQL, DORGQL, CUNGQL, and ZUNGQL.
 `ungql` generates an M-by-N complex matrix Q with orthonormal columns,
 which is defined as the last N columns of a product of K elementary
 reflectors of order M
@@ -35,6 +35,8 @@
 
 [table Dispatching of ungql
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SORGQL] ]
+[ [`double`][DORGQL] ]
 [ [`complex<float>`][CUNGQL] ]
 [ [`complex<double>`][ZUNGQL] ]
 
@@ -83,6 +85,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cungql.f cungql.f] and [@http://www.netlib.org/lapack/complex16/zungql.f zungql.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sorgql.f sorgql.f], [@http://www.netlib.org/lapack/double/dorgql.f dorgql.f], [@http://www.netlib.org/lapack/complex/cungql.f cungql.f], and [@http://www.netlib.org/lapack/complex16/zungql.f zungql.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungqr.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungqr.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungqr.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `ungqr` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUNGQR and ZUNGQR.
+interface to LAPACK routines SORGQR, DORGQR, CUNGQR, and ZUNGQR.
 `ungqr` generates an M-by-N complex matrix Q with orthonormal columns,
 which is defined as the first N columns of a product of K elementary
 reflectors of order M
@@ -34,6 +34,8 @@
 
 [table Dispatching of ungqr
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SORGQR] ]
+[ [`double`][DORGQR] ]
 [ [`complex<float>`][CUNGQR] ]
 [ [`complex<double>`][ZUNGQR] ]
 
@@ -82,6 +84,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cungqr.f cungqr.f] and [@http://www.netlib.org/lapack/complex16/zungqr.f zungqr.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sorgqr.f sorgqr.f], [@http://www.netlib.org/lapack/double/dorgqr.f dorgqr.f], [@http://www.netlib.org/lapack/complex/cungqr.f cungqr.f], and [@http://www.netlib.org/lapack/complex16/zungqr.f zungqr.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungrq.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungrq.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungrq.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `ungrq` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUNGRQ and ZUNGRQ.
+interface to LAPACK routines SORGRQ, DORGRQ, CUNGRQ, and ZUNGRQ.
 `ungrq` generates an M-by-N complex matrix Q with orthonormal rows,
 which is defined as the last M rows of a product of K elementary
 reflectors of order N
@@ -35,6 +35,8 @@
 
 [table Dispatching of ungrq
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SORGRQ] ]
+[ [`double`][DORGRQ] ]
 [ [`complex<float>`][CUNGRQ] ]
 [ [`complex<double>`][ZUNGRQ] ]
 
@@ -83,6 +85,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cungrq.f cungrq.f] and [@http://www.netlib.org/lapack/complex16/zungrq.f zungrq.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sorgrq.f sorgrq.f], [@http://www.netlib.org/lapack/double/dorgrq.f dorgrq.f], [@http://www.netlib.org/lapack/complex/cungrq.f cungrq.f], and [@http://www.netlib.org/lapack/complex16/zungrq.f zungrq.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungtr.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungtr.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/ungtr.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `ungtr` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUNGTR and ZUNGTR.
+interface to LAPACK routines SORGTR, DORGTR, CUNGTR, and ZUNGTR.
 `ungtr` generates a complex unitary matrix Q which is defined as the
 product of n-1 elementary reflectors of order N, as returned by
 ZHETRD:
@@ -34,6 +34,8 @@
 
 [table Dispatching of ungtr
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SORGTR] ]
+[ [`double`][DORGTR] ]
 [ [`complex<float>`][CUNGTR] ]
 [ [`complex<double>`][ZUNGTR] ]
 
@@ -82,6 +84,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cungtr.f cungtr.f] and [@http://www.netlib.org/lapack/complex16/zungtr.f zungtr.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sorgtr.f sorgtr.f], [@http://www.netlib.org/lapack/double/dorgtr.f dorgtr.f], [@http://www.netlib.org/lapack/complex/cungtr.f cungtr.f], and [@http://www.netlib.org/lapack/complex16/zungtr.f zungtr.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmbr.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmbr.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmbr.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `unmbr` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUNMBR and ZUNMBR.
+interface to LAPACK routines SORMBR, DORMBR, CUNMBR, and ZUNMBR.
 If VECT = 'Q', `unmbr` overwrites the general complex M-by-N matrix C
 with
 SIDE = 'L' SIDE = 'R'
@@ -55,6 +55,8 @@
 
 [table Dispatching of unmbr
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SORMBR] ]
+[ [`double`][DORMBR] ]
 [ [`complex<float>`][CUNMBR] ]
 [ [`complex<double>`][ZUNMBR] ]
 
@@ -103,6 +105,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cunmbr.f cunmbr.f] and [@http://www.netlib.org/lapack/complex16/zunmbr.f zunmbr.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sormbr.f sormbr.f], [@http://www.netlib.org/lapack/double/dormbr.f dormbr.f], [@http://www.netlib.org/lapack/complex/cunmbr.f cunmbr.f], and [@http://www.netlib.org/lapack/complex16/zunmbr.f zunmbr.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmhr.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmhr.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmhr.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,7 @@
 [heading Description]
 
 `unmhr` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUNMHR and ZUNMHR.
+interface to LAPACK routines SORMHR, DORMHR, CUNMHR, and ZUNMHR.
 `unmhr` overwrites the general complex M-by-N matrix C with
 
 SIDE = 'L' SIDE = 'R'
@@ -40,6 +40,8 @@
 
 [table Dispatching of unmhr
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SORMHR] ]
+[ [`double`][DORMHR] ]
 [ [`complex<float>`][CUNMHR] ]
 [ [`complex<double>`][ZUNMHR] ]
 
@@ -88,6 +90,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cunmhr.f cunmhr.f] and [@http://www.netlib.org/lapack/complex16/zunmhr.f zunmhr.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sormhr.f sormhr.f], [@http://www.netlib.org/lapack/double/dormhr.f dormhr.f], [@http://www.netlib.org/lapack/complex/cunmhr.f cunmhr.f], and [@http://www.netlib.org/lapack/complex16/zunmhr.f zunmhr.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmlq.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmlq.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmlq.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `unmlq` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUNMLQ and ZUNMLQ.
+interface to LAPACK routines SORMLQ, DORMLQ, CUNMLQ, and ZUNMLQ.
 `unmlq` overwrites the general complex M-by-N matrix C with
 
 SIDE = 'L' SIDE = 'R'
@@ -41,6 +41,8 @@
 
 [table Dispatching of unmlq
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SORMLQ] ]
+[ [`double`][DORMLQ] ]
 [ [`complex<float>`][CUNMLQ] ]
 [ [`complex<double>`][ZUNMLQ] ]
 
@@ -89,6 +91,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cunmlq.f cunmlq.f] and [@http://www.netlib.org/lapack/complex16/zunmlq.f zunmlq.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sormlq.f sormlq.f], [@http://www.netlib.org/lapack/double/dormlq.f dormlq.f], [@http://www.netlib.org/lapack/complex/cunmlq.f cunmlq.f], and [@http://www.netlib.org/lapack/complex16/zunmlq.f zunmlq.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmql.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmql.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmql.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `unmql` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUNMQL and ZUNMQL.
+interface to LAPACK routines SORMQL, DORMQL, CUNMQL, and ZUNMQL.
 `unmql` overwrites the general complex M-by-N matrix C with
 
 SIDE = 'L' SIDE = 'R'
@@ -41,6 +41,8 @@
 
 [table Dispatching of unmql
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SORMQL] ]
+[ [`double`][DORMQL] ]
 [ [`complex<float>`][CUNMQL] ]
 [ [`complex<double>`][ZUNMQL] ]
 
@@ -89,6 +91,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cunmql.f cunmql.f] and [@http://www.netlib.org/lapack/complex16/zunmql.f zunmql.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sormql.f sormql.f], [@http://www.netlib.org/lapack/double/dormql.f dormql.f], [@http://www.netlib.org/lapack/complex/cunmql.f cunmql.f], and [@http://www.netlib.org/lapack/complex16/zunmql.f zunmql.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmqr.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmqr.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmqr.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `unmqr` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUNMQR and ZUNMQR.
+interface to LAPACK routines SORMQR, DORMQR, CUNMQR, and ZUNMQR.
 `unmqr` overwrites the general complex M-by-N matrix C with
 
 SIDE = 'L' SIDE = 'R'
@@ -41,6 +41,8 @@
 
 [table Dispatching of unmqr
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SORMQR] ]
+[ [`double`][DORMQR] ]
 [ [`complex<float>`][CUNMQR] ]
 [ [`complex<double>`][ZUNMQR] ]
 
@@ -89,6 +91,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cunmqr.f cunmqr.f] and [@http://www.netlib.org/lapack/complex16/zunmqr.f zunmqr.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sormqr.f sormqr.f], [@http://www.netlib.org/lapack/double/dormqr.f dormqr.f], [@http://www.netlib.org/lapack/complex/cunmqr.f cunmqr.f], and [@http://www.netlib.org/lapack/complex16/zunmqr.f zunmqr.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmrq.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmrq.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmrq.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `unmrq` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUNMRQ and ZUNMRQ.
+interface to LAPACK routines SORMRQ, DORMRQ, CUNMRQ, and ZUNMRQ.
 `unmrq` overwrites the general complex M-by-N matrix C with
 
 SIDE = 'L' SIDE = 'R'
@@ -41,6 +41,8 @@
 
 [table Dispatching of unmrq
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SORMRQ] ]
+[ [`double`][DORMRQ] ]
 [ [`complex<float>`][CUNMRQ] ]
 [ [`complex<double>`][ZUNMRQ] ]
 
@@ -89,6 +91,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cunmrq.f cunmrq.f] and [@http://www.netlib.org/lapack/complex16/zunmrq.f zunmrq.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sormrq.f sormrq.f], [@http://www.netlib.org/lapack/double/dormrq.f dormrq.f], [@http://www.netlib.org/lapack/complex/cunmrq.f cunmrq.f], and [@http://www.netlib.org/lapack/complex16/zunmrq.f zunmrq.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmrz.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmrz.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmrz.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `unmrz` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUNMRZ and ZUNMRZ.
+interface to LAPACK routines SORMRZ, DORMRZ, CUNMRZ, and ZUNMRZ.
 `unmrz` overwrites the general complex M-by-N matrix C with
 
 SIDE = 'L' SIDE = 'R'
@@ -41,6 +41,8 @@
 
 [table Dispatching of unmrz
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SORMRZ] ]
+[ [`double`][DORMRZ] ]
 [ [`complex<float>`][CUNMRZ] ]
 [ [`complex<double>`][ZUNMRZ] ]
 
@@ -89,6 +91,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cunmrz.f cunmrz.f] and [@http://www.netlib.org/lapack/complex16/zunmrz.f zunmrz.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sormrz.f sormrz.f], [@http://www.netlib.org/lapack/double/dormrz.f dormrz.f], [@http://www.netlib.org/lapack/complex/cunmrz.f cunmrz.f], and [@http://www.netlib.org/lapack/complex16/zunmrz.f zunmrz.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmtr.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmtr.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/unmtr.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `unmtr` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUNMTR and ZUNMTR.
+interface to LAPACK routines SORMTR, DORMTR, CUNMTR, and ZUNMTR.
 `unmtr` overwrites the general complex M-by-N matrix C with
 
 SIDE = 'L' SIDE = 'R'
@@ -41,6 +41,8 @@
 
 [table Dispatching of unmtr
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SORMTR] ]
+[ [`double`][DORMTR] ]
 [ [`complex<float>`][CUNMTR] ]
 [ [`complex<double>`][ZUNMTR] ]
 
@@ -89,6 +91,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cunmtr.f cunmtr.f] and [@http://www.netlib.org/lapack/complex16/zunmtr.f zunmtr.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sormtr.f sormtr.f], [@http://www.netlib.org/lapack/double/dormtr.f dormtr.f], [@http://www.netlib.org/lapack/complex/cunmtr.f cunmtr.f], and [@http://www.netlib.org/lapack/complex16/zunmtr.f zunmtr.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/upgtr.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/upgtr.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/upgtr.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `upgtr` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUPGTR and ZUPGTR.
+interface to LAPACK routines SOPGTR, DOPGTR, CUPGTR, and ZUPGTR.
 `upgtr` generates a complex unitary matrix Q which is defined as the
 product of n-1 elementary reflectors H(i) of order n, as returned by
 ZHPTRD using packed storage:
@@ -35,6 +35,8 @@
 
 [table Dispatching of upgtr
 [ [ Value type of VectorAP ] [LAPACK routine] ]
+[ [`float`][SOPGTR] ]
+[ [`double`][DOPGTR] ]
 [ [`complex<float>`][CUPGTR] ]
 [ [`complex<double>`][ZUPGTR] ]
 
@@ -83,6 +85,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cupgtr.f cupgtr.f] and [@http://www.netlib.org/lapack/complex16/zupgtr.f zupgtr.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sopgtr.f sopgtr.f], [@http://www.netlib.org/lapack/double/dopgtr.f dopgtr.f], [@http://www.netlib.org/lapack/complex/cupgtr.f cupgtr.f], and [@http://www.netlib.org/lapack/complex16/zupgtr.f zupgtr.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/upmtr.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/upmtr.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/computational/upmtr.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `upmtr` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CUPMTR and ZUPMTR.
+interface to LAPACK routines SOPMTR, DOPMTR, CUPMTR, and ZUPMTR.
 `upmtr` overwrites the general complex M-by-N matrix C with
 
 SIDE = 'L' SIDE = 'R'
@@ -42,6 +42,8 @@
 
 [table Dispatching of upmtr
 [ [ Value type of VectorAP ] [LAPACK routine] ]
+[ [`float`][SOPMTR] ]
+[ [`double`][DOPMTR] ]
 [ [`complex<float>`][CUPMTR] ]
 [ [`complex<double>`][ZUPMTR] ]
 
@@ -90,6 +92,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cupmtr.f cupmtr.f] and [@http://www.netlib.org/lapack/complex16/zupmtr.f zupmtr.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sopmtr.f sopmtr.f], [@http://www.netlib.org/lapack/double/dopmtr.f dopmtr.f], [@http://www.netlib.org/lapack/complex/cupmtr.f cupmtr.f], and [@http://www.netlib.org/lapack/complex16/zupmtr.f zupmtr.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbev.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbev.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbev.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `hbev` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHBEV and ZHBEV.
+interface to LAPACK routines SSBEV, DSBEV, CHBEV, and ZHBEV.
 `hbev` computes all the eigenvalues and, optionally, eigenvectors of
 a complex Hermitian band matrix A.
 
@@ -29,6 +29,8 @@
 
 [table Dispatching of hbev
 [ [ Value type of MatrixAB ] [LAPACK routine] ]
+[ [`float`][SSBEV] ]
+[ [`double`][DSBEV] ]
 [ [`complex<float>`][CHBEV] ]
 [ [`complex<double>`][ZHBEV] ]
 
@@ -77,6 +79,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chbev.f chbev.f] and [@http://www.netlib.org/lapack/complex16/zhbev.f zhbev.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssbev.f ssbev.f], [@http://www.netlib.org/lapack/double/dsbev.f dsbev.f], [@http://www.netlib.org/lapack/complex/chbev.f chbev.f], and [@http://www.netlib.org/lapack/complex16/zhbev.f zhbev.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbevd.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbevd.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbevd.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -7,7 +7,12 @@
 [section hbevd]
 
 [heading Prototype]
-There is one prototype of `hbevd` available, please see below.
+There are two prototypes of `hbevd` available, please see below.
+``
+hbevd( const char jobz, MatrixAB& ab, VectorW& w, MatrixZ& z,
+ const int_t liwork );
+``
+
 ``
 hbevd( const char jobz, MatrixAB& ab, VectorW& w, MatrixZ& z );
 ``
@@ -16,7 +21,7 @@
 [heading Description]
 
 `hbevd` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHBEVD and ZHBEVD.
+interface to LAPACK routines SSBEVD, DSBEVD, CHBEVD, and ZHBEVD.
 `hbevd` computes all the eigenvalues and, optionally, eigenvectors of
 a complex Hermitian band matrix A. If eigenvectors are desired, it
 uses a divide and conquer algorithm.
@@ -37,6 +42,8 @@
 
 [table Dispatching of hbevd
 [ [ Value type of MatrixAB ] [LAPACK routine] ]
+[ [`float`][SSBEVD] ]
+[ [`double`][DSBEVD] ]
 [ [`complex<float>`][CHBEVD] ]
 [ [`complex<double>`][ZHBEVD] ]
 
@@ -85,6 +92,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chbevd.f chbevd.f] and [@http://www.netlib.org/lapack/complex16/zhbevd.f zhbevd.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssbevd.f ssbevd.f], [@http://www.netlib.org/lapack/double/dsbevd.f dsbevd.f], [@http://www.netlib.org/lapack/complex/chbevd.f chbevd.f], and [@http://www.netlib.org/lapack/complex16/zhbevd.f zhbevd.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbevx.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbevx.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbevx.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,7 @@
 [heading Description]
 
 `hbevx` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHBEVX and ZHBEVX.
+interface to LAPACK routines SSBEVX, DSBEVX, CHBEVX, and ZHBEVX.
 `hbevx` computes selected eigenvalues and, optionally, eigenvectors
 of a complex Hermitian band matrix A. Eigenvalues and eigenvectors
 can be selected by specifying either a range of values or a range of
@@ -34,6 +34,8 @@
 
 [table Dispatching of hbevx
 [ [ Value type of MatrixAB ] [LAPACK routine] ]
+[ [`float`][SSBEVX] ]
+[ [`double`][DSBEVX] ]
 [ [`complex<float>`][CHBEVX] ]
 [ [`complex<double>`][ZHBEVX] ]
 
@@ -82,6 +84,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chbevx.f chbevx.f] and [@http://www.netlib.org/lapack/complex16/zhbevx.f zhbevx.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssbevx.f ssbevx.f], [@http://www.netlib.org/lapack/double/dsbevx.f dsbevx.f], [@http://www.netlib.org/lapack/complex/chbevx.f chbevx.f], and [@http://www.netlib.org/lapack/complex16/zhbevx.f zhbevx.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbgv.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbgv.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbgv.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `hbgv` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHBGV and ZHBGV.
+interface to LAPACK routines SSBGV, DSBGV, CHBGV, and ZHBGV.
 `hbgv` computes all the eigenvalues, and optionally, the eigenvectors
 of a complex generalized Hermitian-definite banded eigenproblem, of
 the form A*x=(lambda)*B*x. Here A and B are assumed to be Hermitian
@@ -32,6 +32,8 @@
 
 [table Dispatching of hbgv
 [ [ Value type of MatrixAB ] [LAPACK routine] ]
+[ [`float`][SSBGV] ]
+[ [`double`][DSBGV] ]
 [ [`complex<float>`][CHBGV] ]
 [ [`complex<double>`][ZHBGV] ]
 
@@ -80,6 +82,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chbgv.f chbgv.f] and [@http://www.netlib.org/lapack/complex16/zhbgv.f zhbgv.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssbgv.f ssbgv.f], [@http://www.netlib.org/lapack/double/dsbgv.f dsbgv.f], [@http://www.netlib.org/lapack/complex/chbgv.f chbgv.f], and [@http://www.netlib.org/lapack/complex16/zhbgv.f zhbgv.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbgvd.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbgvd.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbgvd.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `hbgvd` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHBGVD and ZHBGVD.
+interface to LAPACK routines SSBGVD, DSBGVD, CHBGVD, and ZHBGVD.
 `hbgvd` computes all the eigenvalues, and optionally, the eigenvectors
 of a complex generalized Hermitian-definite banded eigenproblem, of
 the form A*x=(lambda)*B*x. Here A and B are assumed to be Hermitian
@@ -40,6 +40,8 @@
 
 [table Dispatching of hbgvd
 [ [ Value type of MatrixAB ] [LAPACK routine] ]
+[ [`float`][SSBGVD] ]
+[ [`double`][DSBGVD] ]
 [ [`complex<float>`][CHBGVD] ]
 [ [`complex<double>`][ZHBGVD] ]
 
@@ -88,6 +90,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chbgvd.f chbgvd.f] and [@http://www.netlib.org/lapack/complex16/zhbgvd.f zhbgvd.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssbgvd.f ssbgvd.f], [@http://www.netlib.org/lapack/double/dsbgvd.f dsbgvd.f], [@http://www.netlib.org/lapack/complex/chbgvd.f chbgvd.f], and [@http://www.netlib.org/lapack/complex16/zhbgvd.f zhbgvd.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbgvx.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbgvx.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hbgvx.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -20,7 +20,7 @@
 [heading Description]
 
 `hbgvx` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHBGVX and ZHBGVX.
+interface to LAPACK routines SSBGVX, DSBGVX, CHBGVX, and ZHBGVX.
 `hbgvx` computes all the eigenvalues, and optionally, the eigenvectors
 of a complex generalized Hermitian-definite banded eigenproblem, of
 the form A*x=(lambda)*B*x. Here A and B are assumed to be Hermitian
@@ -37,6 +37,8 @@
 
 [table Dispatching of hbgvx
 [ [ Value type of MatrixAB ] [LAPACK routine] ]
+[ [`float`][SSBGVX] ]
+[ [`double`][DSBGVX] ]
 [ [`complex<float>`][CHBGVX] ]
 [ [`complex<double>`][ZHBGVX] ]
 
@@ -85,6 +87,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chbgvx.f chbgvx.f] and [@http://www.netlib.org/lapack/complex16/zhbgvx.f zhbgvx.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssbgvx.f ssbgvx.f], [@http://www.netlib.org/lapack/double/dsbgvx.f dsbgvx.f], [@http://www.netlib.org/lapack/complex/chbgvx.f chbgvx.f], and [@http://www.netlib.org/lapack/complex16/zhbgvx.f zhbgvx.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heev.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heev.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heev.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `heev` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHEEV and ZHEEV.
+interface to LAPACK routines SSYEV, DSYEV, CHEEV, and ZHEEV.
 `heev` computes all eigenvalues and, optionally, eigenvectors of a
 complex Hermitian matrix A.
 
@@ -29,6 +29,8 @@
 
 [table Dispatching of heev
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYEV] ]
+[ [`double`][DSYEV] ]
 [ [`complex<float>`][CHEEV] ]
 [ [`complex<double>`][ZHEEV] ]
 
@@ -77,6 +79,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cheev.f cheev.f] and [@http://www.netlib.org/lapack/complex16/zheev.f zheev.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssyev.f ssyev.f], [@http://www.netlib.org/lapack/double/dsyev.f dsyev.f], [@http://www.netlib.org/lapack/complex/cheev.f cheev.f], and [@http://www.netlib.org/lapack/complex16/zheev.f zheev.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heevd.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heevd.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heevd.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `heevd` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHEEVD and ZHEEVD.
+interface to LAPACK routines SSYEVD, DSYEVD, CHEEVD, and ZHEEVD.
 `heevd` computes all eigenvalues and, optionally, eigenvectors of a
 complex Hermitian matrix A. If eigenvectors are desired, it uses a
 divide and conquer algorithm.
@@ -37,6 +37,8 @@
 
 [table Dispatching of heevd
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYEVD] ]
+[ [`double`][DSYEVD] ]
 [ [`complex<float>`][CHEEVD] ]
 [ [`complex<double>`][ZHEEVD] ]
 
@@ -85,6 +87,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cheevd.f cheevd.f] and [@http://www.netlib.org/lapack/complex16/zheevd.f zheevd.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssyevd.f ssyevd.f], [@http://www.netlib.org/lapack/double/dsyevd.f dsyevd.f], [@http://www.netlib.org/lapack/complex/cheevd.f cheevd.f], and [@http://www.netlib.org/lapack/complex16/zheevd.f zheevd.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heevr.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heevr.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heevr.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,7 @@
 [heading Description]
 
 `heevr` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHEEVR and ZHEEVR.
+interface to LAPACK routines SSYEVR, DSYEVR, CHEEVR, and ZHEEVR.
 `heevr` computes selected eigenvalues and, optionally, eigenvectors
 of a complex Hermitian matrix A. Eigenvalues and eigenvectors can
 be selected by specifying either a range of values or a range of
@@ -87,6 +87,8 @@
 
 [table Dispatching of heevr
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYEVR] ]
+[ [`double`][DSYEVR] ]
 [ [`complex<float>`][CHEEVR] ]
 [ [`complex<double>`][ZHEEVR] ]
 
@@ -135,6 +137,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cheevr.f cheevr.f] and [@http://www.netlib.org/lapack/complex16/zheevr.f zheevr.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssyevr.f ssyevr.f], [@http://www.netlib.org/lapack/double/dsyevr.f dsyevr.f], [@http://www.netlib.org/lapack/complex/cheevr.f cheevr.f], and [@http://www.netlib.org/lapack/complex16/zheevr.f zheevr.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heevx.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heevx.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/heevx.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,7 @@
 [heading Description]
 
 `heevx` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHEEVX and ZHEEVX.
+interface to LAPACK routines SSYEVX, DSYEVX, CHEEVX, and ZHEEVX.
 `heevx` computes selected eigenvalues and, optionally, eigenvectors
 of a complex Hermitian matrix A. Eigenvalues and eigenvectors can
 be selected by specifying either a range of values or a range of
@@ -34,6 +34,8 @@
 
 [table Dispatching of heevx
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYEVX] ]
+[ [`double`][DSYEVX] ]
 [ [`complex<float>`][CHEEVX] ]
 [ [`complex<double>`][ZHEEVX] ]
 
@@ -82,6 +84,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/cheevx.f cheevx.f] and [@http://www.netlib.org/lapack/complex16/zheevx.f zheevx.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssyevx.f ssyevx.f], [@http://www.netlib.org/lapack/double/dsyevx.f dsyevx.f], [@http://www.netlib.org/lapack/complex/cheevx.f cheevx.f], and [@http://www.netlib.org/lapack/complex16/zheevx.f zheevx.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hegv.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hegv.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hegv.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `hegv` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHEGV and ZHEGV.
+interface to LAPACK routines SSYGV, DSYGV, CHEGV, and ZHEGV.
 `hegv` computes all the eigenvalues, and optionally, the eigenvectors
 of a complex generalized Hermitian-definite eigenproblem, of the form
 A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x.
@@ -33,6 +33,8 @@
 
 [table Dispatching of hegv
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYGV] ]
+[ [`double`][DSYGV] ]
 [ [`complex<float>`][CHEGV] ]
 [ [`complex<double>`][ZHEGV] ]
 
@@ -81,6 +83,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chegv.f chegv.f] and [@http://www.netlib.org/lapack/complex16/zhegv.f zhegv.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssygv.f ssygv.f], [@http://www.netlib.org/lapack/double/dsygv.f dsygv.f], [@http://www.netlib.org/lapack/complex/chegv.f chegv.f], and [@http://www.netlib.org/lapack/complex16/zhegv.f zhegv.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hegvd.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hegvd.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hegvd.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `hegvd` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHEGVD and ZHEGVD.
+interface to LAPACK routines SSYGVD, DSYGVD, CHEGVD, and ZHEGVD.
 `hegvd` computes all the eigenvalues, and optionally, the eigenvectors
 of a complex generalized Hermitian-definite eigenproblem, of the form
 A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x. Here A and
@@ -40,6 +40,8 @@
 
 [table Dispatching of hegvd
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYGVD] ]
+[ [`double`][DSYGVD] ]
 [ [`complex<float>`][CHEGVD] ]
 [ [`complex<double>`][ZHEGVD] ]
 
@@ -88,6 +90,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chegvd.f chegvd.f] and [@http://www.netlib.org/lapack/complex16/zhegvd.f zhegvd.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssygvd.f ssygvd.f], [@http://www.netlib.org/lapack/double/dsygvd.f dsygvd.f], [@http://www.netlib.org/lapack/complex/chegvd.f chegvd.f], and [@http://www.netlib.org/lapack/complex16/zhegvd.f zhegvd.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hegvx.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hegvx.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hegvx.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -7,7 +7,15 @@
 [section hegvx]
 
 [heading Prototype]
-There is one prototype of `hegvx` available, please see below.
+There are two prototypes of `hegvx` available, please see below.
+``
+hegvx( const int_t itype, const char jobz, const char range,
+ const int_t n, MatrixA& a, MatrixB& b, const Scalar >,
+ const Scalar >, const int_t il,
+ const int_t iu, const Scalar >, int_t& m,
+ VectorW& w, MatrixZ& z, VectorIFAIL& ifail );
+``
+
 ``
 hegvx( const int_t itype, const char jobz, const char range,
         MatrixA& a, MatrixB& b, const Scalar >, const Scalar >,
@@ -20,7 +28,7 @@
 [heading Description]
 
 `hegvx` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHEGVX and ZHEGVX.
+interface to LAPACK routines SSYGVX, DSYGVX, CHEGVX, and ZHEGVX.
 `hegvx` computes selected eigenvalues, and optionally, eigenvectors
 of a complex generalized Hermitian-definite eigenproblem, of the form
 A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x. Here A and
@@ -37,6 +45,8 @@
 
 [table Dispatching of hegvx
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYGVX] ]
+[ [`double`][DSYGVX] ]
 [ [`complex<float>`][CHEGVX] ]
 [ [`complex<double>`][ZHEGVX] ]
 
@@ -85,6 +95,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chegvx.f chegvx.f] and [@http://www.netlib.org/lapack/complex16/zhegvx.f zhegvx.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssygvx.f ssygvx.f], [@http://www.netlib.org/lapack/double/dsygvx.f dsygvx.f], [@http://www.netlib.org/lapack/complex/chegvx.f chegvx.f], and [@http://www.netlib.org/lapack/complex16/zhegvx.f zhegvx.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hesv.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hesv.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hesv.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `hesv` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHESV and ZHESV.
+interface to LAPACK routines SSYSV, DSYSV, CHESV, and ZHESV.
 `hesv` computes the solution to a complex system of linear equations
 A * X = B,
 where A is an N-by-N Hermitian matrix and X and B are N-by-NRHS
@@ -39,6 +39,8 @@
 
 [table Dispatching of hesv
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYSV] ]
+[ [`double`][DSYSV] ]
 [ [`complex<float>`][CHESV] ]
 [ [`complex<double>`][ZHESV] ]
 
@@ -87,6 +89,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chesv.f chesv.f] and [@http://www.netlib.org/lapack/complex16/zhesv.f zhesv.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssysv.f ssysv.f], [@http://www.netlib.org/lapack/double/dsysv.f dsysv.f], [@http://www.netlib.org/lapack/complex/chesv.f chesv.f], and [@http://www.netlib.org/lapack/complex16/zhesv.f zhesv.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hesvx.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hesvx.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hesvx.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,7 @@
 [heading Description]
 
 `hesvx` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHESVX and ZHESVX.
+interface to LAPACK routines SSYSVX, DSYSVX, CHESVX, and ZHESVX.
 `hesvx` uses the diagonal pivoting factorization to compute the
 solution to a complex system of linear equations A * X = B,
 where A is an N-by-N Hermitian matrix and X and B are N-by-NRHS
@@ -63,6 +63,8 @@
 
 [table Dispatching of hesvx
 [ [ Value type of MatrixA ] [LAPACK routine] ]
+[ [`float`][SSYSVX] ]
+[ [`double`][DSYSVX] ]
 [ [`complex<float>`][CHESVX] ]
 [ [`complex<double>`][ZHESVX] ]
 
@@ -111,6 +113,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chesvx.f chesvx.f] and [@http://www.netlib.org/lapack/complex16/zhesvx.f zhesvx.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/ssysvx.f ssysvx.f], [@http://www.netlib.org/lapack/double/dsysvx.f dsysvx.f], [@http://www.netlib.org/lapack/complex/chesvx.f chesvx.f], and [@http://www.netlib.org/lapack/complex16/zhesvx.f zhesvx.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpev.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpev.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpev.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `hpev` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHPEV and ZHPEV.
+interface to LAPACK routines SSPEV, DSPEV, CHPEV, and ZHPEV.
 `hpev` computes all the eigenvalues and, optionally, eigenvectors of a
 complex Hermitian matrix in packed storage.
 
@@ -29,6 +29,8 @@
 
 [table Dispatching of hpev
 [ [ Value type of MatrixAP ] [LAPACK routine] ]
+[ [`float`][SSPEV] ]
+[ [`double`][DSPEV] ]
 [ [`complex<float>`][CHPEV] ]
 [ [`complex<double>`][ZHPEV] ]
 
@@ -77,6 +79,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chpev.f chpev.f] and [@http://www.netlib.org/lapack/complex16/zhpev.f zhpev.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sspev.f sspev.f], [@http://www.netlib.org/lapack/double/dspev.f dspev.f], [@http://www.netlib.org/lapack/complex/chpev.f chpev.f], and [@http://www.netlib.org/lapack/complex16/zhpev.f zhpev.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpevd.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpevd.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpevd.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `hpevd` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHPEVD and ZHPEVD.
+interface to LAPACK routines SSPEVD, DSPEVD, CHPEVD, and ZHPEVD.
 `hpevd` computes all the eigenvalues and, optionally, eigenvectors of
 a complex Hermitian matrix A in packed storage. If eigenvectors are
 desired, it uses a divide and conquer algorithm.
@@ -37,6 +37,8 @@
 
 [table Dispatching of hpevd
 [ [ Value type of MatrixAP ] [LAPACK routine] ]
+[ [`float`][SSPEVD] ]
+[ [`double`][DSPEVD] ]
 [ [`complex<float>`][CHPEVD] ]
 [ [`complex<double>`][ZHPEVD] ]
 
@@ -85,6 +87,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chpevd.f chpevd.f] and [@http://www.netlib.org/lapack/complex16/zhpevd.f zhpevd.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sspevd.f sspevd.f], [@http://www.netlib.org/lapack/double/dspevd.f dspevd.f], [@http://www.netlib.org/lapack/complex/chpevd.f chpevd.f], and [@http://www.netlib.org/lapack/complex16/zhpevd.f zhpevd.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpevx.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpevx.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpevx.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -19,7 +19,7 @@
 [heading Description]
 
 `hpevx` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHPEVX and ZHPEVX.
+interface to LAPACK routines SSPEVX, DSPEVX, CHPEVX, and ZHPEVX.
 `hpevx` computes selected eigenvalues and, optionally, eigenvectors
 of a complex Hermitian matrix A in packed storage.
 Eigenvalues/vectors can be selected by specifying either a range of
@@ -34,6 +34,8 @@
 
 [table Dispatching of hpevx
 [ [ Value type of MatrixAP ] [LAPACK routine] ]
+[ [`float`][SSPEVX] ]
+[ [`double`][DSPEVX] ]
 [ [`complex<float>`][CHPEVX] ]
 [ [`complex<double>`][ZHPEVX] ]
 
@@ -82,6 +84,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chpevx.f chpevx.f] and [@http://www.netlib.org/lapack/complex16/zhpevx.f zhpevx.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sspevx.f sspevx.f], [@http://www.netlib.org/lapack/double/dspevx.f dspevx.f], [@http://www.netlib.org/lapack/complex/chpevx.f chpevx.f], and [@http://www.netlib.org/lapack/complex16/zhpevx.f zhpevx.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpgv.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpgv.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpgv.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `hpgv` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHPGV and ZHPGV.
+interface to LAPACK routines SSPGV, DSPGV, CHPGV, and ZHPGV.
 `hpgv` computes all the eigenvalues and, optionally, the eigenvectors
 of a complex generalized Hermitian-definite eigenproblem, of the form
 A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x.
@@ -33,6 +33,8 @@
 
 [table Dispatching of hpgv
 [ [ Value type of MatrixAP ] [LAPACK routine] ]
+[ [`float`][SSPGV] ]
+[ [`double`][DSPGV] ]
 [ [`complex<float>`][CHPGV] ]
 [ [`complex<double>`][ZHPGV] ]
 
@@ -81,6 +83,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chpgv.f chpgv.f] and [@http://www.netlib.org/lapack/complex16/zhpgv.f zhpgv.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sspgv.f sspgv.f], [@http://www.netlib.org/lapack/double/dspgv.f dspgv.f], [@http://www.netlib.org/lapack/complex/chpgv.f chpgv.f], and [@http://www.netlib.org/lapack/complex16/zhpgv.f zhpgv.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpgvd.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpgvd.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpgvd.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -17,7 +17,7 @@
 [heading Description]
 
 `hpgvd` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHPGVD and ZHPGVD.
+interface to LAPACK routines SSPGVD, DSPGVD, CHPGVD, and ZHPGVD.
 `hpgvd` computes all the eigenvalues and, optionally, the eigenvectors
 of a complex generalized Hermitian-definite eigenproblem, of the form
 A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x. Here A and
@@ -41,6 +41,8 @@
 
 [table Dispatching of hpgvd
 [ [ Value type of MatrixAP ] [LAPACK routine] ]
+[ [`float`][SSPGVD] ]
+[ [`double`][DSPGVD] ]
 [ [`complex<float>`][CHPGVD] ]
 [ [`complex<double>`][ZHPGVD] ]
 
@@ -89,6 +91,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chpgvd.f chpgvd.f] and [@http://www.netlib.org/lapack/complex16/zhpgvd.f zhpgvd.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sspgvd.f sspgvd.f], [@http://www.netlib.org/lapack/double/dspgvd.f dspgvd.f], [@http://www.netlib.org/lapack/complex/chpgvd.f chpgvd.f], and [@http://www.netlib.org/lapack/complex16/zhpgvd.f zhpgvd.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpgvx.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpgvx.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpgvx.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -7,7 +7,15 @@
 [section hpgvx]
 
 [heading Prototype]
-There is one prototype of `hpgvx` available, please see below.
+There are two prototypes of `hpgvx` available, please see below.
+``
+hpgvx( const int_t itype, const char jobz, const char range,
+ const int_t n, MatrixAP& ap, MatrixBP& bp, const Scalar >,
+ const Scalar >, const int_t il,
+ const int_t iu, const Scalar >, int_t& m,
+ VectorW& w, MatrixZ& z, VectorIFAIL& ifail );
+``
+
 ``
 hpgvx( const int_t itype, const char jobz, const char range,
         MatrixAP& ap, MatrixBP& bp, const Scalar >, const Scalar >,
@@ -20,7 +28,7 @@
 [heading Description]
 
 `hpgvx` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHPGVX and ZHPGVX.
+interface to LAPACK routines SSPGVX, DSPGVX, CHPGVX, and ZHPGVX.
 `hpgvx` computes selected eigenvalues and, optionally, eigenvectors
 of a complex generalized Hermitian-definite eigenproblem, of the form
 A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x. Here A and
@@ -38,6 +46,8 @@
 
 [table Dispatching of hpgvx
 [ [ Value type of MatrixAP ] [LAPACK routine] ]
+[ [`float`][SSPGVX] ]
+[ [`double`][DSPGVX] ]
 [ [`complex<float>`][CHPGVX] ]
 [ [`complex<double>`][ZHPGVX] ]
 
@@ -86,6 +96,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chpgvx.f chpgvx.f] and [@http://www.netlib.org/lapack/complex16/zhpgvx.f zhpgvx.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sspgvx.f sspgvx.f], [@http://www.netlib.org/lapack/double/dspgvx.f dspgvx.f], [@http://www.netlib.org/lapack/complex/chpgvx.f chpgvx.f], and [@http://www.netlib.org/lapack/complex16/zhpgvx.f zhpgvx.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpsv.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpsv.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpsv.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -16,7 +16,7 @@
 [heading Description]
 
 `hpsv` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHPSV and ZHPSV.
+interface to LAPACK routines SSPSV, DSPSV, CHPSV, and ZHPSV.
 `hpsv` computes the solution to a complex system of linear equations
 A * X = B,
 where A is an N-by-N Hermitian matrix stored in packed format and X
@@ -39,6 +39,8 @@
 
 [table Dispatching of hpsv
 [ [ Value type of MatrixAP ] [LAPACK routine] ]
+[ [`float`][SSPSV] ]
+[ [`double`][DSPSV] ]
 [ [`complex<float>`][CHPSV] ]
 [ [`complex<double>`][ZHPSV] ]
 
@@ -87,6 +89,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chpsv.f chpsv.f] and [@http://www.netlib.org/lapack/complex16/zhpsv.f zhpsv.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sspsv.f sspsv.f], [@http://www.netlib.org/lapack/double/dspsv.f dspsv.f], [@http://www.netlib.org/lapack/complex/chpsv.f chpsv.f], and [@http://www.netlib.org/lapack/complex16/zhpsv.f zhpsv.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpsvx.qbk
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpsvx.qbk (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/doc/lapack/driver/hpsvx.qbk 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -18,7 +18,7 @@
 [heading Description]
 
 `hpsvx` (short for $FRIENDLY_NAME) provides a C++
-interface to LAPACK routines CHPSVX and ZHPSVX.
+interface to LAPACK routines SSPSVX, DSPSVX, CHPSVX, and ZHPSVX.
 `hpsvx` uses the diagonal pivoting factorization A = U*D*U**H or
 A = L*D*L**H to compute the solution to a complex system of linear
 equations A * X = B, where A is an N-by-N Hermitian matrix stored
@@ -62,6 +62,8 @@
 
 [table Dispatching of hpsvx
 [ [ Value type of MatrixAP ] [LAPACK routine] ]
+[ [`float`][SSPSVX] ]
+[ [`double`][DSPSVX] ]
 [ [`complex<float>`][CHPSVX] ]
 [ [`complex<double>`][ZHPSVX] ]
 
@@ -110,6 +112,6 @@
 
 [heading See Also]
 
-* Originating Fortran source files [@http://www.netlib.org/lapack/complex/chpsvx.f chpsvx.f] and [@http://www.netlib.org/lapack/complex16/zhpsvx.f zhpsvx.f] at Netlib.
+* Originating Fortran source files [@http://www.netlib.org/lapack/single/sspsvx.f sspsvx.f], [@http://www.netlib.org/lapack/double/dspsvx.f dspsvx.f], [@http://www.netlib.org/lapack/complex/chpsvx.f chpsvx.f], and [@http://www.netlib.org/lapack/complex16/zhpsvx.f zhpsvx.f] at Netlib.
 
 [endsect]

Modified: sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_geqrf.cpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_geqrf.cpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_geqrf.cpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -32,35 +32,6 @@
 namespace bindings = boost::numeric::bindings;
 namespace tag = boost::numeric::bindings::tag;
 
-struct apply_real {
- template< typename MatrixA, typename VectorTAU, typename Workspace >
- static inline std::ptrdiff_t orgqr( MatrixA& a, const VectorTAU& tau, Workspace work ) {
- return lapack::orgqr( a, tau, work );
- }
- template< typename Side, typename MatrixA, typename VectorTAU, typename MatrixC,
- typename Workspace >
- static inline std::ptrdiff_t ormqr( const Side side,
- const MatrixA& a, const VectorTAU& tau, MatrixC& c,
- Workspace work ) {
- return lapack::ormqr( side, a, tau, c, work );
- }
-};
-
-struct apply_complex {
- template< typename MatrixA, typename VectorTAU, typename Workspace >
- static inline std::ptrdiff_t orgqr( MatrixA& a, const VectorTAU& tau, Workspace work ) {
- return lapack::ungqr( a, tau, work );
- }
- template< typename Side, typename MatrixA, typename VectorTAU, typename MatrixC,
- typename Workspace >
- static inline std::ptrdiff_t ormqr( const Side side,
- const MatrixA& a, const VectorTAU& tau, MatrixC& c,
- Workspace work ) {
- return lapack::unmqr( side, a, tau, c, work );
- }
-};
-
-
 // Randomize a matrix
 template <typename M>
 void randomize(M& m) {
@@ -84,7 +55,6 @@
 
 template <typename T, typename W>
 int do_memory_type(int n, W workspace) {
- typedef typename boost::mpl::if_<boost::is_complex<T>, apply_complex, apply_real>::type apply_t;
    typedef typename bindings::remove_imaginary<T>::type real_type ;
    typedef std::complex< real_type > complex_type ;
 
@@ -104,9 +74,9 @@
 
    // Apply the orthogonal transformations to a2
    if( boost::is_complex<T>::value ) {
- apply_t::ormqr( tag::left(), bindings::conj( a ), tau, a2, workspace );
+ lapack::unmqr( tag::left(), bindings::conj( a ), tau, a2, workspace );
    } else {
- apply_t::ormqr( tag::left(), bindings::trans( a ), tau, a2, workspace );
+ lapack::unmqr( tag::left(), bindings::trans( a ), tau, a2, workspace );
    }
 
    // The upper triangular parts of a and a2 must be equal.
@@ -114,7 +84,7 @@
> std::numeric_limits<real_type>::epsilon() * 10.0 * norm_frobenius( upper_part( a ) ) ) return 255 ;
 
    // Generate orthogonal matrix
- apply_t::orgqr( a, tau, workspace );
+ lapack::ungqr( a, tau, workspace );
 
    // The result of lapack::ormqr and the equivalent matrix product must be equal.
    if (norm_frobenius( a2 - prod(herm(a), a3) )

Modified: sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hbev.cpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hbev.cpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hbev.cpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -27,27 +27,6 @@
 namespace lapack = boost::numeric::bindings::lapack;
 namespace bindings = boost::numeric::bindings;
 
-struct apply_real {
- template< typename MatrixAB, typename VectorW, typename MatrixZ,
- typename Workspace >
- static inline std::ptrdiff_t hbev( const char jobz,
- MatrixAB& ab, VectorW& w, MatrixZ& z,
- Workspace work ) {
- return lapack::sbev( jobz, ab, w, z, work );
- }
-};
-
-struct apply_complex {
- template< typename MatrixAB, typename VectorW, typename MatrixZ,
- typename Workspace >
- static inline std::ptrdiff_t hbev( const char jobz,
- MatrixAB& ab, VectorW& w, MatrixZ& z,
- Workspace work ) {
- return lapack::hbev( jobz, ab, w, z, work );
- }
-};
-
-
 template <typename U>
 int lower() {
    return 0;
@@ -68,7 +47,6 @@
 
 template <typename T, typename W, typename UPLO, typename Orientation>
 int do_memory_uplo(int n, W& workspace ) {
- typedef typename boost::mpl::if_<boost::is_complex<T>, apply_complex, apply_real>::type apply_t;
    typedef typename bindings::remove_imaginary<T>::type real_type ;
 
    typedef ublas::banded_matrix<T, Orientation> banded_type ;
@@ -87,13 +65,13 @@
    ublas::hermitian_adaptor<banded_type, UPLO> h( a ), h2( a2 );
 
    // Compute Schur decomposition.
- apply_t::hbev( 'V',
+ lapack::hbev( 'V',
      h, e1, z, workspace ) ;
 
    if (check_residual( h2, e1, z )) return 255 ;
 
    matrix_type dummy_z( n, n );
- apply_t::hbev( 'N',
+ lapack::hbev( 'N',
      h2, e2, dummy_z, workspace ) ;
    if (norm_2( e1 - e2 ) > n * norm_2( e1 ) * std::numeric_limits< real_type >::epsilon()) return 255 ;
 
@@ -108,7 +86,7 @@
    ublas::vector_range< vector_type> e_r( e1, r );
    ublas::matrix_range< matrix_type> z_r( z, r, r );
 
- apply_t::hbev( 'V',
+ lapack::hbev( 'V',
      h_r, e_r, z_r, workspace );
 
    banded_range a2_r( a2, r, r );

Modified: sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hbevx.cpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hbevx.cpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hbevx.cpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -29,41 +29,6 @@
 namespace lapack = boost::numeric::bindings::lapack;
 namespace bindings = boost::numeric::bindings;
 
-struct apply_real {
- template< typename MatrixAB, typename MatrixQ, typename VectorW,
- typename MatrixZ, typename VectorIFAIL, typename Workspace >
- static inline std::ptrdiff_t hbevx(
- const char jobz, const char range, MatrixAB& ab, MatrixQ& q,
- const typename bindings::remove_imaginary< typename bindings::value_type<
- MatrixAB >::type >::type vl, const typename bindings::remove_imaginary<
- typename bindings::value_type< MatrixAB >::type >::type vu,
- const fortran_int_t il, const fortran_int_t iu,
- const typename bindings::remove_imaginary< typename bindings::value_type<
- MatrixAB >::type >::type abstol, fortran_int_t& m, VectorW& w,
- MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
- return lapack::sbevx( jobz, range, ab, q, vl, vu,
- il, iu, abstol, m, w, z, ifail, work );
- }
-};
-
-struct apply_complex {
- template< typename MatrixAB, typename MatrixQ, typename VectorW,
- typename MatrixZ, typename VectorIFAIL, typename Workspace >
- static inline std::ptrdiff_t hbevx(
- const char jobz, const char range, MatrixAB& ab, MatrixQ& q,
- const typename bindings::remove_imaginary< typename bindings::value_type<
- MatrixAB >::type >::type vl, const typename bindings::remove_imaginary<
- typename bindings::value_type< MatrixAB >::type >::type vu,
- const fortran_int_t il, const fortran_int_t iu,
- const typename bindings::remove_imaginary< typename bindings::value_type<
- MatrixAB >::type >::type abstol, fortran_int_t& m, VectorW& w,
- MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
- return lapack::hbevx( jobz, range, ab, q, vl, vu,
- il, iu, abstol, m, w, z, ifail, work );
- }
-};
-
-
 template <typename U>
 int lower() {
    return 0;
@@ -84,7 +49,6 @@
 
 template <typename T, typename W, typename UPLO, typename Orientation>
 int do_memory_uplo(int n, W& workspace ) {
- typedef typename boost::mpl::if_<boost::is_complex<T>, apply_complex, apply_real>::type apply_t;
    typedef typename bindings::remove_imaginary<T>::type real_type ;
 
    typedef ublas::banded_matrix<T, Orientation> banded_type ;
@@ -108,12 +72,12 @@
 
 
    // Compute Schur decomposition.
- apply_t::hbevx( 'V', 'A',
+ lapack::hbevx( 'V', 'A',
      h, q, vl, vu, il, iu, abstol, m, e1, z, ifail, workspace ) ;
 
    if (check_residual( h2, e1, z )) return 255 ;
 
- apply_t::hbevx( 'N', 'A',
+ lapack::hbevx( 'N', 'A',
      h2, q, vl, vu, il, iu, abstol, m, e2, z, ifail, workspace ) ;
    if (norm_2( e1 - e2 ) > n * norm_2( e1 ) * std::numeric_limits< real_type >::epsilon()) return 255 ;
 
@@ -129,7 +93,7 @@
    ublas::matrix_range< matrix_type> z_r( z, r, r );
    ublas::vector<fortran_int_t> ifail_r(n-2);
 
- apply_t::hbevx( 'V', 'A',
+ lapack::hbevx( 'V', 'A',
      h_r, q, vl, vu, il, iu, abstol, m, e_r, z_r, ifail_r, workspace ) ;
 
    banded_range a2_r( a2, r, r );

Modified: sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_heevd.cpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_heevd.cpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_heevd.cpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -27,26 +27,8 @@
 namespace lapack = boost::numeric::bindings::lapack;
 namespace bindings = boost::numeric::bindings;
 
-struct apply_real {
- template< typename MatrixA, typename VectorW, typename Workspace >
- static inline std::ptrdiff_t heevd( const char jobz, MatrixA& a, VectorW& w,
- Workspace work ) {
- return lapack::syevd( jobz, a, w, work );
- }
-};
-
-struct apply_complex {
- template< typename MatrixA, typename VectorW, typename Workspace >
- static inline std::ptrdiff_t heevd( const char jobz, MatrixA& a, VectorW& w,
- Workspace work ) {
- return lapack::heevd( jobz, a, w, work );
- }
-};
-
-
 template <typename T, typename W, typename UPLO>
 int do_memory_uplo(int n, W& workspace ) {
- typedef typename boost::mpl::if_<boost::is_complex<T>, apply_complex, apply_real>::type apply_t;
    typedef typename bindings::remove_imaginary<T>::type real_type ;
 
    typedef ublas::matrix<T, ublas::column_major> matrix_type ;
@@ -65,12 +47,12 @@
    // Compute Schur decomposition.
    
    hermitian_type h_a( a );
- apply_t::heevd( 'V', h_a, e1, workspace ) ;
+ lapack::heevd( 'V', h_a, e1, workspace ) ;
 
    if (check_residual( a2, e1, a )) return 255 ;
 
    hermitian_type h_a2( a2 );
- apply_t::heevd( 'N', h_a2, e2, workspace ) ;
+ lapack::heevd( 'N', h_a2, e2, workspace ) ;
    if (norm_2( e1 - e2 ) > n * norm_2( e1 ) * std::numeric_limits< real_type >::epsilon()) return 255 ;
 
    // Test for a matrix range
@@ -84,7 +66,7 @@
    ublas::vector_range< vector_type> e_r( e1, r );
 
    hermitian_range_type h_a_r( a_r );
- apply_t::heevd( 'V', h_a_r, e_r, workspace );
+ lapack::heevd( 'V', h_a_r, e_r, workspace );
 
    matrix_range a2_r( a2, r, r );
    if (check_residual( a2_r, e_r, a_r )) return 255 ;

Modified: sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_heevx.cpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_heevx.cpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_heevx.cpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -28,43 +28,8 @@
 namespace lapack = boost::numeric::bindings::lapack;
 namespace bindings = boost::numeric::bindings;
 
-struct apply_real {
-template< typename MatrixA, typename VectorW, typename MatrixZ,
- typename VectorIFAIL, typename Workspace >
-static inline std::ptrdiff_t heevx( const char jobz, const char range,
- MatrixA& a, const typename bindings::remove_imaginary< typename bindings::value_type<
- MatrixA >::type >::type vl, const typename bindings::remove_imaginary<
- typename bindings::value_type< MatrixA >::type >::type vu,
- const fortran_int_t il, const fortran_int_t iu,
- const typename bindings::remove_imaginary< typename bindings::value_type<
- MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
- MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
- return lapack::syevx( jobz,
- range, a, vl, vu, il, iu, abstol, m, w, z, ifail, work );
-}
-
-};
-
-struct apply_complex {
-template< typename MatrixA, typename VectorW, typename MatrixZ,
- typename VectorIFAIL, typename Workspace >
-static inline std::ptrdiff_t heevx( const char jobz, const char range,
- MatrixA& a, const typename bindings::remove_imaginary< typename bindings::value_type<
- MatrixA >::type >::type vl, const typename bindings::remove_imaginary<
- typename bindings::value_type< MatrixA >::type >::type vu,
- const fortran_int_t il, const fortran_int_t iu,
- const typename bindings::remove_imaginary< typename bindings::value_type<
- MatrixA >::type >::type abstol, fortran_int_t& m, VectorW& w,
- MatrixZ& z, VectorIFAIL& ifail, Workspace work ) {
- return lapack::heevx( jobz,
- range, a, vl, vu, il, iu, abstol, m, w, z, ifail, work );
-}
-};
-
-
 template <typename T, typename W, typename UPLO>
 int do_memory_uplo(int n, W& workspace ) {
- typedef typename boost::mpl::if_<boost::is_complex<T>, apply_complex, apply_real>::type apply_t;
    typedef typename bindings::remove_imaginary<T>::type real_type ;
 
    typedef ublas::matrix<T, ublas::column_major> matrix_type ;
@@ -86,13 +51,13 @@
    ublas::vector<fortran_int_t> ifail(n);
    
    hermitian_type h_a( a );
- apply_t::heevx( 'V', 'A', h_a, real_type(0.0), real_type(1.0), 2, n-1, real_type(1e-28), m,
+ lapack::heevx( 'V', 'A', h_a, real_type(0.0), real_type(1.0), 2, n-1, real_type(1e-28), m,
                   e1, z, ifail, workspace ) ;
 
    if (check_residual( a2, e1, z )) return 255 ;
 
    hermitian_type h_a2( a2 );
- apply_t::heevx( 'N', 'A', h_a2, real_type(0.0), real_type(1.0), 2, n-1, real_type(1e-28), m,
+ lapack::heevx( 'N', 'A', h_a2, real_type(0.0), real_type(1.0), 2, n-1, real_type(1e-28), m,
                   e2, z, ifail, workspace ) ;
    if (norm_2( e1 - e2 ) > n * norm_2( e1 ) * std::numeric_limits< real_type >::epsilon()) return 255 ;
 
@@ -109,7 +74,7 @@
    ublas::vector<fortran_int_t> ifail_r(n-2);
 
    hermitian_range_type h_a_r( a_r );
- apply_t::heevx( 'V', 'A', h_a_r, real_type(0.0), real_type(1.0), 2, n-1, real_type(1e-28), m,
+ lapack::heevx( 'V', 'A', h_a_r, real_type(0.0), real_type(1.0), 2, n-1, real_type(1e-28), m,
                   e_r, z_r, ifail_r, workspace );
 
    matrix_range a2_r( a2, r, r );

Modified: sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hegv.cpp
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hegv.cpp (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/lapack/test/ublas_hegv.cpp 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -26,30 +26,8 @@
 namespace lapack = boost::numeric::bindings::lapack;
 namespace bindings = boost::numeric::bindings;
 
-struct apply_real {
- template< typename MatrixA, typename MatrixB, typename VectorW,
- typename Workspace >
- static inline std::ptrdiff_t hegv( const fortran_int_t itype, const char jobz,
- MatrixA& a, MatrixB& b, VectorW& w,
- Workspace work ) {
- return lapack::sygv( itype, jobz, a, b, w, work );
- }
-};
-
-struct apply_complex {
- template< typename MatrixA, typename MatrixB, typename VectorW,
- typename Workspace >
- static inline std::ptrdiff_t hegv( const fortran_int_t itype, const char jobz,
- MatrixA& a, MatrixB& b, VectorW& w,
- Workspace work ) {
- return lapack::hegv( itype, jobz, a, b, w, work );
- }
-};
-
-
 template <typename T, typename W, typename UPLO>
 int do_memory_uplo(int n, W& workspace ) {
- typedef typename boost::mpl::if_<boost::is_complex<T>, apply_complex, apply_real>::type apply_t;
    typedef typename bindings::remove_imaginary<T>::type real_type ;
 
    typedef ublas::matrix<T, ublas::column_major> matrix_type ;
@@ -69,12 +47,12 @@
 
    // Compute eigen decomposition.
    hermitian_type h_a( a );
- apply_t::hegv( 1, 'V', h_a, b, e1, workspace ) ;
+ lapack::hegv( 1, 'V', h_a, b, e1, workspace ) ;
 
    if (check_residual( a2, e1, a )) return 255 ;
 
    hermitian_type h_a2( a2 );
- apply_t::hegv( 1, 'N', h_a2 , b, e2, workspace ) ;
+ lapack::hegv( 1, 'N', h_a2 , b, e2, workspace ) ;
    if (norm_2( e1 - e2 ) > n * norm_2( e1 ) * std::numeric_limits< real_type >::epsilon()) return 255 ;
 
    // Test for a matrix range
@@ -89,7 +67,7 @@
    matrix_range b_r( b, r, r );
 
    hermitian_range_type h_a_r( a_r );
- apply_t::hegv(1, 'V', h_a_r, b_r, e_r, workspace );
+ lapack::hegv(1, 'V', h_a_r, b_r, e_r, workspace );
 
    matrix_range a2_r( a2, r, r );
    if (check_residual( a2_r, e_r, a_r )) return 255 ;

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/bindings.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/bindings.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/bindings.py 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -120,6 +120,9 @@
   for g in group_keys:
     content += '// Value-type variants of ' + g.lower() + '\n'
     for k in properties[ g ]:
+ # avoid duplicate definitions for real matrices occuring in more than one group
+ if (k[0] == 'S' or k[0] == 'D') and '_' not in g and g not in k:
+ continue
       template = template_map[ template_map[ 'PARSERMODE' ].lower() + '_names.h_function' ]
       template = template.replace( '$SUBROUTINE', k )
       template = template.replace( '$subroutine', k.lower() )
@@ -170,6 +173,9 @@
   for g in group_keys:
     content += '// Value-type variants of ' + g.lower() + '\n'
     for k in properties[ g ]:
+ # avoid duplicate definitions for real matrices occuring in more than one group
+ if (k[0] == 'S' or k[0] == 'D') and '_' not in g and g not in k:
+ continue
 
       template = template_map[ parsermode + '.h_function' ]
       arg_list = []

Modified: sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py
==============================================================================
--- sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py (original)
+++ sandbox/numeric_bindings/libs/numeric/bindings/tools/lapack_generator.py 2010-07-26 21:05:19 EDT (Mon, 26 Jul 2010)
@@ -39,6 +39,28 @@
               insert_at = i+1
       group_map[ subroutine_group_name ].insert( insert_at, subroutine_name )
 
+# add real symmetric or orthogonal matrices as special cases
+# of complex hermitian or unitary matrices.
+ real_as_complex_matrix = \
+ { 'OR' : 'UN',
+ 'OP' : 'UP',
+ 'SB' : 'HB',
+ 'SP' : 'HP',
+ 'SY' : 'HE' }
+ for subroutine_name in global_info_map.keys():
+ subroutine_group_name = global_info_map[ subroutine_name ][ 'group_name' ]
+ if global_info_map[ subroutine_name ][ 'value_type' ] == 'real' and \
+ subroutine_group_name[0:2] in real_as_complex_matrix:
+ complex_group_name = real_as_complex_matrix[ subroutine_group_name[0:2] ] + subroutine_group_name[2:]
+ if group_map.has_key( complex_group_name ):
+ insert_at = 0
+ for i in range( 0, len(group_map[ complex_group_name ]) ):
+ if bindings.subroutine_less( subroutine_name,
+ group_map[ complex_group_name ][ i ],
+ global_info_map ):
+ insert_at = i+1
+ group_map[ complex_group_name ].insert( insert_at, subroutine_name )
+
   return group_map
 
 
@@ -77,8 +99,10 @@
       '#include <boost/type_traits/remove_const.hpp>',
       '#include <boost/static_assert.hpp>' ]
 
- if template_map.has_key( group_name.lower() + '.includes' ):
- includes += template_map[ group_name.lower() + '.includes' ].splitlines()
+ for subroutine in subroutines:
+ group_name_l = info_map[ subroutine ][ 'group_name' ].lower()
+ if template_map.has_key( group_name_l + '.includes' ):
+ includes += template_map[ group_name_l + '.includes' ].splitlines()
 
     #
     # LEVEL 0 HANDLING
@@ -197,6 +221,7 @@
 
       # take this subroutine for arguments etc.
       subroutine = case_map[ 'subroutines' ][ 0 ]
+ group_name_l = info_map[ subroutine ][ 'group_name' ].lower()
       print "taking",subroutine
 
       level1_template = ''
@@ -210,7 +235,7 @@
 
       # include templates come before anything else; they can hold any
       # $ID
- my_include_key = group_name.lower() + '.' + value_type + '.include_templates'
+ my_include_key = group_name_l + '.' + value_type + '.include_templates'
       if netlib.my_has_key( my_include_key, template_map ):
         include_template_list = template_map[ netlib.my_has_key( my_include_key, template_map ) ].strip().replace(' ','').split(",")
         include_templates = ''
@@ -321,7 +346,7 @@
         # So, MatrixB should be column_major although it is determining the order.
         # I.e., the order should be column_major. Look in the template system for these overrides.
         for matrix_arg in matrix_wo_trans_arg_removed:
- my_key = group_name.lower() + '.' + value_type + '.' + matrix_arg + '.is_column_major'
+ my_key = group_name_l + '.' + value_type + '.' + matrix_arg + '.is_column_major'
             print "Looking for column_major override ", my_key
             if netlib.my_has_key( my_key, template_map ):
                 assert_line = 'BOOST_STATIC_ASSERT( (bindings::is_column_major< ' + \
@@ -564,7 +589,7 @@
           # first: user-defined stuff (overrules any auto-detected stuff)
 
           resulting_code = ''
- my_key = group_name.lower() + '.' + value_type + '.min_size_' + name.lower()
+ my_key = group_name_l + '.' + value_type + '.min_size_' + name.lower()
           if netlib.my_has_key( my_key, template_map ):
             resulting_code = indent_lines( template_map[ netlib.my_has_key( my_key, template_map ) ].rstrip(), 8 )
 


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