Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58689 - sandbox/numeric_bindings/boost/numeric/bindings
From: rutger_at_[hidden]
Date: 2010-01-04 15:44:06


Author: rutger
Date: 2010-01-04 15:44:05 EST (Mon, 04 Jan 2010)
New Revision: 58689
URL: http://svn.boost.org/trac/boost/changeset/58689

Log:
added support for conj into trans functionality

Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/trans.hpp | 16 ++++++++++------
   1 files changed, 10 insertions(+), 6 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 2010-01-04 15:44:05 EST (Mon, 04 Jan 2010)
@@ -20,6 +20,7 @@
 #include <boost/numeric/bindings/size.hpp>
 #include <boost/numeric/bindings/tag.hpp>
 #include <boost/numeric/bindings/value.hpp>
+#include <boost/numeric/bindings/has_linear_array.hpp>
 #include <boost/ref.hpp>
 
 namespace boost {
@@ -27,7 +28,7 @@
 namespace bindings {
 namespace detail {
 
-template< typename T >
+template< typename T, typename Conj >
 struct trans_wrapper: reference_wrapper<T> {
     trans_wrapper( T& t ): reference_wrapper<T>( t ) {}
 };
@@ -35,8 +36,8 @@
 //
 // In case of linear storage
 //
-template< typename T, typename Id, typename Enable >
-struct adaptor< trans_wrapper<T>, Id, Enable > {
+template< typename T, typename Conj, typename Id, typename Enable >
+struct adaptor< trans_wrapper<T, Conj>, Id, Enable > {
 
     typedef typename property_map_of< T >::type prop_of_T;
     typedef typename property_insert< T,
@@ -60,6 +61,9 @@
                 tag::column_major >::type
>,
 
+ // Conjugate transform (if passed by template argument)
+ Conj,
+
         // If T has a linear array:
         // stride1 <-> stride2
         typename mpl::if_< has_linear_array< T >,
@@ -124,19 +128,19 @@
 
 template< typename T >
 struct trans {
- typedef detail::trans_wrapper<T> type;
+ typedef detail::trans_wrapper<T, mpl::void_> type;
 };
 
 }
 
 template< typename T >
 typename result_of::trans<T>::type trans( T& underlying ) {
- return detail::trans_wrapper<T>( underlying );
+ return detail::trans_wrapper<T, mpl::void_>( underlying );
 }
 
 template< typename T >
 typename result_of::trans<const T>::type trans( const T& underlying ) {
- return detail::trans_wrapper<const T>( underlying );
+ return detail::trans_wrapper<const T, mpl::void_>( underlying );
 }
 
 } // namespace bindings


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