Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58925 - sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver
From: rutger_at_[hidden]
Date: 2010-01-12 06:02:30


Author: rutger
Date: 2010-01-12 06:02:29 EST (Tue, 12 Jan 2010)
New Revision: 58925
URL: http://svn.boost.org/trac/boost/changeset/58925

Log:
fixed missing trait in hegv

Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/driver/hegv.hpp | 141 ++++++++++++++++++++-------------------
   1 files changed, 71 insertions(+), 70 deletions(-)

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-01-12 06:02:29 EST (Tue, 12 Jan 2010)
@@ -101,8 +101,8 @@
     template< typename MatrixA, typename MatrixB, typename VectorW,
             typename WORK, typename RWORK >
     static std::ptrdiff_t invoke( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, MatrixA& a,
- MatrixB& b, VectorW& w, detail::workspace2< WORK, RWORK > work ) {
+ const char jobz, MatrixA& a, MatrixB& b, VectorW& w,
+ detail::workspace2< WORK, RWORK > work ) {
         typedef typename result_of::data_side< MatrixA >::type uplo;
         BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
                 typename value< MatrixA >::type >::type,
@@ -112,16 +112,21 @@
         BOOST_STATIC_ASSERT( (is_mutable< MatrixB >::value) );
         BOOST_STATIC_ASSERT( (is_mutable< VectorW >::value) );
         BOOST_ASSERT( jobz == 'N' || jobz == 'V' );
- BOOST_ASSERT( n >= 0 );
- BOOST_ASSERT( size(work.select(real_type())) >= min_size_rwork( n ));
- BOOST_ASSERT( size(work.select(value_type())) >= min_size_work( n ));
+ BOOST_ASSERT( size(work.select(real_type())) >= min_size_rwork(
+ size_column(a) ));
+ BOOST_ASSERT( size(work.select(value_type())) >= min_size_work(
+ size_column(a) ));
+ BOOST_ASSERT( size_column(a) >= 0 );
         BOOST_ASSERT( size_minor(a) == 1 || stride_minor(a) == 1 );
         BOOST_ASSERT( size_minor(b) == 1 || stride_minor(b) == 1 );
- BOOST_ASSERT( stride_major(a) >= std::max< std::ptrdiff_t >(1,n) );
- BOOST_ASSERT( stride_major(b) >= std::max< std::ptrdiff_t >(1,n) );
- return detail::hegv( itype, jobz, uplo(), n, begin_value(a),
- stride_major(a), begin_value(b), stride_major(b),
- begin_value(w), begin_value(work.select(value_type())),
+ BOOST_ASSERT( stride_major(a) >= std::max< std::ptrdiff_t >(1,
+ size_column(a)) );
+ BOOST_ASSERT( stride_major(b) >= std::max< std::ptrdiff_t >(1,
+ size_column(a)) );
+ return detail::hegv( itype, jobz, uplo(), size_column(a),
+ begin_value(a), stride_major(a), begin_value(b),
+ stride_major(b), begin_value(w),
+ begin_value(work.select(value_type())),
                 size(work.select(value_type())),
                 begin_value(work.select(real_type())) );
     }
@@ -135,12 +140,14 @@
     //
     template< typename MatrixA, typename MatrixB, typename VectorW >
     static std::ptrdiff_t invoke( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, MatrixA& a,
- MatrixB& b, VectorW& w, minimal_workspace work ) {
+ const char jobz, MatrixA& a, MatrixB& b, VectorW& w,
+ minimal_workspace work ) {
         typedef typename result_of::data_side< MatrixA >::type uplo;
- bindings::detail::array< value_type > tmp_work( min_size_work( n ) );
- bindings::detail::array< real_type > tmp_rwork( min_size_rwork( n ) );
- return invoke( itype, jobz, n, a, b, w, workspace( tmp_work,
+ bindings::detail::array< value_type > tmp_work( min_size_work(
+ size_column(a) ) );
+ bindings::detail::array< real_type > tmp_rwork( min_size_rwork(
+ size_column(a) ) );
+ return invoke( itype, jobz, a, b, w, workspace( tmp_work,
                 tmp_rwork ) );
     }
 
@@ -153,17 +160,19 @@
     //
     template< typename MatrixA, typename MatrixB, typename VectorW >
     static std::ptrdiff_t invoke( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, MatrixA& a,
- MatrixB& b, VectorW& w, optimal_workspace work ) {
+ const char jobz, MatrixA& a, MatrixB& b, VectorW& w,
+ optimal_workspace work ) {
         typedef typename result_of::data_side< MatrixA >::type uplo;
         value_type opt_size_work;
- bindings::detail::array< real_type > tmp_rwork( min_size_rwork( n ) );
- detail::hegv( itype, jobz, uplo(), n, begin_value(a),
- stride_major(a), begin_value(b), stride_major(b),
- begin_value(w), &opt_size_work, -1, begin_value(tmp_rwork) );
+ bindings::detail::array< real_type > tmp_rwork( min_size_rwork(
+ size_column(a) ) );
+ detail::hegv( itype, jobz, uplo(), size_column(a),
+ begin_value(a), stride_major(a), begin_value(b),
+ stride_major(b), begin_value(w), &opt_size_work, -1,
+ begin_value(tmp_rwork) );
         bindings::detail::array< value_type > tmp_work(
                 traits::detail::to_int( opt_size_work ) );
- return invoke( itype, jobz, n, a, b, w, workspace( tmp_work,
+ return invoke( itype, jobz, a, b, w, workspace( tmp_work,
                 tmp_rwork ) );
     }
 
@@ -204,10 +213,9 @@
 template< typename MatrixA, typename MatrixB, typename VectorW,
         typename Workspace >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, MatrixA& a, MatrixB& b,
- VectorW& w, Workspace work ) {
+ const char jobz, MatrixA& a, MatrixB& b, VectorW& w, Workspace work ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, work );
+ jobz, a, b, w, work );
 }
 
 //
@@ -219,10 +227,9 @@
 //
 template< typename MatrixA, typename MatrixB, typename VectorW >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, MatrixA& a, MatrixB& b,
- VectorW& w ) {
+ const char jobz, MatrixA& a, MatrixB& b, VectorW& w ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, optimal_workspace() );
+ jobz, a, b, w, optimal_workspace() );
 }
 
 //
@@ -235,10 +242,10 @@
 template< typename MatrixA, typename MatrixB, typename VectorW,
         typename Workspace >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, const MatrixA& a,
- MatrixB& b, VectorW& w, Workspace work ) {
+ const char jobz, const MatrixA& a, MatrixB& b, VectorW& w,
+ Workspace work ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, work );
+ jobz, a, b, w, work );
 }
 
 //
@@ -250,10 +257,9 @@
 //
 template< typename MatrixA, typename MatrixB, typename VectorW >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, const MatrixA& a,
- MatrixB& b, VectorW& w ) {
+ const char jobz, const MatrixA& a, MatrixB& b, VectorW& w ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, optimal_workspace() );
+ jobz, a, b, w, optimal_workspace() );
 }
 
 //
@@ -266,10 +272,10 @@
 template< typename MatrixA, typename MatrixB, typename VectorW,
         typename Workspace >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, MatrixA& a,
- const MatrixB& b, VectorW& w, Workspace work ) {
+ const char jobz, MatrixA& a, const MatrixB& b, VectorW& w,
+ Workspace work ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, work );
+ jobz, a, b, w, work );
 }
 
 //
@@ -281,10 +287,9 @@
 //
 template< typename MatrixA, typename MatrixB, typename VectorW >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, MatrixA& a,
- const MatrixB& b, VectorW& w ) {
+ const char jobz, MatrixA& a, const MatrixB& b, VectorW& w ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, optimal_workspace() );
+ jobz, a, b, w, optimal_workspace() );
 }
 
 //
@@ -297,10 +302,10 @@
 template< typename MatrixA, typename MatrixB, typename VectorW,
         typename Workspace >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, const MatrixA& a,
- const MatrixB& b, VectorW& w, Workspace work ) {
+ const char jobz, const MatrixA& a, const MatrixB& b, VectorW& w,
+ Workspace work ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, work );
+ jobz, a, b, w, work );
 }
 
 //
@@ -312,10 +317,9 @@
 //
 template< typename MatrixA, typename MatrixB, typename VectorW >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, const MatrixA& a,
- const MatrixB& b, VectorW& w ) {
+ const char jobz, const MatrixA& a, const MatrixB& b, VectorW& w ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, optimal_workspace() );
+ jobz, a, b, w, optimal_workspace() );
 }
 
 //
@@ -328,10 +332,10 @@
 template< typename MatrixA, typename MatrixB, typename VectorW,
         typename Workspace >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, MatrixA& a, MatrixB& b,
- const VectorW& w, Workspace work ) {
+ const char jobz, MatrixA& a, MatrixB& b, const VectorW& w,
+ Workspace work ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, work );
+ jobz, a, b, w, work );
 }
 
 //
@@ -343,10 +347,9 @@
 //
 template< typename MatrixA, typename MatrixB, typename VectorW >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, MatrixA& a, MatrixB& b,
- const VectorW& w ) {
+ const char jobz, MatrixA& a, MatrixB& b, const VectorW& w ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, optimal_workspace() );
+ jobz, a, b, w, optimal_workspace() );
 }
 
 //
@@ -359,10 +362,10 @@
 template< typename MatrixA, typename MatrixB, typename VectorW,
         typename Workspace >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, const MatrixA& a,
- MatrixB& b, const VectorW& w, Workspace work ) {
+ const char jobz, const MatrixA& a, MatrixB& b, const VectorW& w,
+ Workspace work ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, work );
+ jobz, a, b, w, work );
 }
 
 //
@@ -374,10 +377,9 @@
 //
 template< typename MatrixA, typename MatrixB, typename VectorW >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, const MatrixA& a,
- MatrixB& b, const VectorW& w ) {
+ const char jobz, const MatrixA& a, MatrixB& b, const VectorW& w ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, optimal_workspace() );
+ jobz, a, b, w, optimal_workspace() );
 }
 
 //
@@ -390,10 +392,10 @@
 template< typename MatrixA, typename MatrixB, typename VectorW,
         typename Workspace >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, MatrixA& a,
- const MatrixB& b, const VectorW& w, Workspace work ) {
+ const char jobz, MatrixA& a, const MatrixB& b, const VectorW& w,
+ Workspace work ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, work );
+ jobz, a, b, w, work );
 }
 
 //
@@ -405,10 +407,9 @@
 //
 template< typename MatrixA, typename MatrixB, typename VectorW >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, MatrixA& a,
- const MatrixB& b, const VectorW& w ) {
+ const char jobz, MatrixA& a, const MatrixB& b, const VectorW& w ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, optimal_workspace() );
+ jobz, a, b, w, optimal_workspace() );
 }
 
 //
@@ -421,10 +422,10 @@
 template< typename MatrixA, typename MatrixB, typename VectorW,
         typename Workspace >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, const MatrixA& a,
- const MatrixB& b, const VectorW& w, Workspace work ) {
+ const char jobz, const MatrixA& a, const MatrixB& b, const VectorW& w,
+ Workspace work ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, work );
+ jobz, a, b, w, work );
 }
 
 //
@@ -436,10 +437,10 @@
 //
 template< typename MatrixA, typename MatrixB, typename VectorW >
 inline std::ptrdiff_t hegv( const fortran_int_t itype,
- const char jobz, const fortran_int_t n, const MatrixA& a,
- const MatrixB& b, const VectorW& w ) {
+ const char jobz, const MatrixA& a, const MatrixB& b,
+ const VectorW& w ) {
     return hegv_impl< typename value< MatrixA >::type >::invoke( itype,
- jobz, n, a, b, w, optimal_workspace() );
+ jobz, a, b, w, optimal_workspace() );
 }
 
 } // namespace lapack


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