Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58497 - in sandbox/numeric_bindings/boost/numeric/bindings: . detail
From: rutger_at_[hidden]
Date: 2009-12-22 14:24:30


Author: rutger
Date: 2009-12-22 14:24:29 EST (Tue, 22 Dec 2009)
New Revision: 58497
URL: http://svn.boost.org/trac/boost/changeset/58497

Log:
sync of traits changes

Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/detail/get.hpp | 2 +-
   sandbox/numeric_bindings/boost/numeric/bindings/size.hpp | 2 ++
   sandbox/numeric_bindings/boost/numeric/bindings/stride.hpp | 28 +++++++++-------------------
   sandbox/numeric_bindings/boost/numeric/bindings/tag.hpp | 23 ++++++++++++++++++-----
   4 files changed, 30 insertions(+), 25 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/detail/get.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/detail/get.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/detail/get.hpp 2009-12-22 14:24:29 EST (Tue, 22 Dec 2009)
@@ -40,7 +40,7 @@
     } \
 };
 
-BOOST_PP_REPEAT_FROM_TO(1,4,GENERATE_GET,~)
+BOOST_PP_REPEAT_FROM_TO(1,3,GENERATE_GET,~)
 
 template< typename T, typename Key, typename Enable = void >
 struct get_impl {};

Modified: sandbox/numeric_bindings/boost/numeric/bindings/size.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/size.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/size.hpp 2009-12-22 14:24:29 EST (Tue, 22 Dec 2009)
@@ -109,6 +109,8 @@
 
 BOOST_PP_REPEAT_FROM_TO(1,3,GENERATE_SIZE_INDEX,~)
 
+GENERATE_FUNCTIONS( size, _row, tag::index<1> )
+GENERATE_FUNCTIONS( size, _column, tag::index<2> )
 GENERATE_FUNCTIONS( size, _major, typename index_major<T>::type )
 GENERATE_FUNCTIONS( size, _minor, typename index_minor<T>::type )
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/stride.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/stride.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/stride.hpp 2009-12-22 14:24:29 EST (Tue, 22 Dec 2009)
@@ -38,27 +38,15 @@
 
 };
 
+//
+// Strides for ranks outside the scope of the object are fixed at 0
+// E.g., a vector has rank 1, its stride for index<2> will be 0.
+//
 template< typename T, typename Index >
 struct stride_impl< T, Index,
- typename boost::enable_if< typename mpl::and_<
- mpl::greater< Index, rank<T> >,
- is_same_at< T, tag::stride_type<1>, std::ptrdiff_t >
- >::type >::type > {
-
- typedef std::ptrdiff_t result_type;
-
- static result_type invoke( const T& t ) {
- return 0;
- }
-
-};
-
-template< typename T, typename Index >
-struct stride_impl< T, Index,
- typename boost::enable_if< typename mpl::and_<
- mpl::greater< Index, rank<T> >,
- mpl::not_< is_same_at< T, tag::stride_type<1>, std::ptrdiff_t > >
- >::type >::type > {
+ typename boost::enable_if<
+ mpl::greater< Index, rank<T> >
+ >::type > {
 
     typedef typename mpl::int_<0> result_type;
 
@@ -111,6 +99,8 @@
 
 BOOST_PP_REPEAT_FROM_TO(1,3,GENERATE_STRIDE_INDEX,~)
 
+GENERATE_FUNCTIONS( stride, _row, tag::index<1> )
+GENERATE_FUNCTIONS( stride, _column, tag::index<2> )
 GENERATE_FUNCTIONS( stride, _major, typename index_major<T>::type )
 GENERATE_FUNCTIONS( stride, _minor, typename index_minor<T>::type )
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/tag.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/tag.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/tag.hpp 2009-12-22 14:24:29 EST (Tue, 22 Dec 2009)
@@ -50,7 +50,6 @@
 struct is_tag< tag::tag_name >: \
     mpl::bool_< true > {};
 
-
 ADD_TAG( value_type )
 ADD_TAG( value )
 ADD_TAG( value_transform )
@@ -88,10 +87,24 @@
 ADD_TAG( unit_upper )
 ADD_TAG( unit_lower )
 
-ADD_TAG_ALIAS( scalar, tensor<0> )
-ADD_TAG_ALIAS( vector, tensor<1> )
-ADD_TAG_ALIAS( matrix, tensor<2> )
-ADD_TAG_ALIAS( contiguous, mpl::int_<1> )
+// BLAS Options
+ADD_TAG( no_transpose )
+ADD_TAG( transpose )
+ADD_TAG( conjugate )
+
+ADD_TAG( unit )
+ADD_TAG( non_unit )
+ADD_TAG( left )
+ADD_TAG( right )
+
+namespace tag {
+
+typedef tensor<0> scalar;
+typedef tensor<1> vector;
+typedef tensor<2> matrix;
+typedef mpl::int_<1> contiguous;
+
+}
 
 } // namespace bindings
 } // namespace numeric


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