Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80931 - sandbox/numeric_bindings/boost/numeric/bindings
From: rutger_at_[hidden]
Date: 2012-10-10 08:15:43


Author: rutger
Date: 2012-10-10 08:15:41 EDT (Wed, 10 Oct 2012)
New Revision: 80931
URL: http://svn.boost.org/trac/boost/changeset/80931

Log:
Added experimental support for flipping bandwidth1/bandwidth2 to trans()

Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/trans.hpp | 23 +++++++++++++++++++++++
   1 files changed, 23 insertions(+), 0 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/trans.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/trans.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/trans.hpp 2012-10-10 08:15:41 EDT (Wed, 10 Oct 2012)
@@ -18,8 +18,10 @@
 #include <boost/numeric/bindings/is_column_major.hpp>
 #include <boost/numeric/bindings/rank.hpp>
 #include <boost/numeric/bindings/size.hpp>
+#include <boost/numeric/bindings/bandwidth.hpp>
 #include <boost/numeric/bindings/tag.hpp>
 #include <boost/numeric/bindings/value_type.hpp>
+#include <boost/numeric/bindings/has_band_array.hpp>
 #include <boost/numeric/bindings/has_linear_array.hpp>
 #include <boost/ref.hpp>
 
@@ -75,6 +77,17 @@
             mpl::void_
>::type,
 
+ // If T has a band array
+ // bandwidth1 <-> bandwidth2
+ typename mpl::if_< has_band_array< T >,
+ mpl::pair< tag::bandwidth_type<1>, typename result_of::bandwidth2< T >::type >,
+ mpl::void_
+ >::type,
+ typename mpl::if_< has_band_array< T >,
+ mpl::pair< tag::bandwidth_type<2>, typename result_of::bandwidth1< T >::type >,
+ mpl::void_
+ >::type,
+
         // If a data_side tag is present:
         // upper <-> lower
         typename mpl::if_<
@@ -120,6 +133,16 @@
         return bindings::stride1( id.get() );
     }
 
+ // Banded matrix transpose
+ // Flip bandwidth1/bandwidth2
+ static typename result_of::bandwidth2< T >::type bandwidth1( const Id& id ) {
+ return bindings::bandwidth2( id.get() );
+ }
+
+ static typename result_of::bandwidth1< T >::type bandwidth2( const Id& id ) {
+ return bindings::bandwidth1( id.get() );
+ }
+
 };
 
 } // namespace detail


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