Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63420 - sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational
From: thomas.klimpel_at_[hidden]
Date: 2010-06-28 19:52:11


Author: klimpel
Date: 2010-06-28 19:52:10 EDT (Mon, 28 Jun 2010)
New Revision: 63420
URL: http://svn.boost.org/trac/boost/changeset/63420

Log:
proposed solution for clapack (atlas) issue with getri (manual edit for the moment, but modifying the generator should be easy too)
Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/getri.hpp | 16 ++++++++++++++++
   1 files changed, 16 insertions(+), 0 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/getri.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/getri.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/lapack/computational/getri.hpp 2010-06-28 19:52:10 EDT (Mon, 28 Jun 2010)
@@ -241,12 +241,16 @@
             optimal_workspace ) {
         namespace bindings = ::boost::numeric::bindings;
         typedef typename result_of::data_order< MatrixA >::type order;
+#if defined BOOST_NUMERIC_BINDINGS_LAPACK_CLAPACK
+ bindings::detail::array< real_type > tmp_work( 0 );
+#else
         real_type opt_size_work;
         detail::getri( order(), 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 ) );
+#endif
         return invoke( a, ipiv, workspace( tmp_work ) );
     }
 
@@ -255,7 +259,11 @@
     // workspace-array work.
     //
     static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+#if defined BOOST_NUMERIC_BINDINGS_LAPACK_CLAPACK
+ return 0;
+#else
         return std::max< std::ptrdiff_t >( 1, n );
+#endif
     }
 };
 
@@ -323,12 +331,16 @@
             optimal_workspace ) {
         namespace bindings = ::boost::numeric::bindings;
         typedef typename result_of::data_order< MatrixA >::type order;
+#if defined BOOST_NUMERIC_BINDINGS_LAPACK_CLAPACK
+ bindings::detail::array< value_type > tmp_work( 0 );
+#else
         value_type opt_size_work;
         detail::getri( order(), bindings::size_column(a),
                 bindings::begin_value(a), bindings::stride_major(a),
                 bindings::begin_value(ipiv), &opt_size_work, -1 );
         bindings::detail::array< value_type > tmp_work(
                 traits::detail::to_int( opt_size_work ) );
+#endif
         return invoke( a, ipiv, workspace( tmp_work ) );
     }
 
@@ -337,7 +349,11 @@
     // workspace-array work.
     //
     static std::ptrdiff_t min_size_work( const std::ptrdiff_t n ) {
+#if defined BOOST_NUMERIC_BINDINGS_LAPACK_CLAPACK
+ return 0;
+#else
         return std::max< std::ptrdiff_t >( 1, n );
+#endif
     }
 };
 


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