Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58098 - in sandbox/numeric_bindings/boost/numeric/bindings: . detail eigen std tnt ublas
From: rutger_at_[hidden]
Date: 2009-12-02 10:42:48


Author: rutger
Date: 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
New Revision: 58098
URL: http://svn.boost.org/trac/boost/changeset/58098

Log:
Sync of new traits system for numeric_bindings

Added:
   sandbox/numeric_bindings/boost/numeric/bindings/is_mutable.hpp (contents, props changed)
   sandbox/numeric_bindings/boost/numeric/bindings/min_rank.hpp (contents, props changed)
   sandbox/numeric_bindings/boost/numeric/bindings/rank.hpp
      - copied, changed from r58094, /sandbox/numeric_bindings/boost/numeric/bindings/tensor_rank.hpp
   sandbox/numeric_bindings/boost/numeric/bindings/remove_imaginary.hpp (contents, props changed)
   sandbox/numeric_bindings/boost/numeric/bindings/ublas/unbounded_array.hpp (contents, props changed)
   sandbox/numeric_bindings/boost/numeric/bindings/value.hpp
      - copied, changed from r57956, /sandbox/numeric_bindings/boost/numeric/bindings/value_type.hpp
Removed:
   sandbox/numeric_bindings/boost/numeric/bindings/data.hpp
   sandbox/numeric_bindings/boost/numeric/bindings/tensor_rank.hpp
   sandbox/numeric_bindings/boost/numeric/bindings/value_type.hpp
Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/begin.hpp | 146 ++++++++++++++++++++++++++++++++++++---
   sandbox/numeric_bindings/boost/numeric/bindings/column.hpp | 18 ++--
   sandbox/numeric_bindings/boost/numeric/bindings/detail/adaptor.hpp | 5
   sandbox/numeric_bindings/boost/numeric/bindings/detail/copy_const.hpp | 10 +-
   sandbox/numeric_bindings/boost/numeric/bindings/detail/get.hpp | 10 +-
   sandbox/numeric_bindings/boost/numeric/bindings/detail/pod.hpp | 6
   sandbox/numeric_bindings/boost/numeric/bindings/detail/property_map.hpp | 2
   sandbox/numeric_bindings/boost/numeric/bindings/eigen/matrix.hpp | 10 +-
   sandbox/numeric_bindings/boost/numeric/bindings/end.hpp | 40 +++++++++-
   sandbox/numeric_bindings/boost/numeric/bindings/io.hpp | 4
   sandbox/numeric_bindings/boost/numeric/bindings/noop.hpp | 11 +-
   sandbox/numeric_bindings/boost/numeric/bindings/num_columns.hpp | 2
   sandbox/numeric_bindings/boost/numeric/bindings/num_rows.hpp | 2
   sandbox/numeric_bindings/boost/numeric/bindings/rank.hpp | 2
   sandbox/numeric_bindings/boost/numeric/bindings/row.hpp | 20 ++--
   sandbox/numeric_bindings/boost/numeric/bindings/size.hpp | 18 ++--
   sandbox/numeric_bindings/boost/numeric/bindings/std/valarray.hpp | 4
   sandbox/numeric_bindings/boost/numeric/bindings/std/vector.hpp | 4
   sandbox/numeric_bindings/boost/numeric/bindings/stride.hpp | 18 ++--
   sandbox/numeric_bindings/boost/numeric/bindings/tag.hpp | 3
   sandbox/numeric_bindings/boost/numeric/bindings/tnt/array1d.hpp | 4
   sandbox/numeric_bindings/boost/numeric/bindings/tnt/array2d.hpp | 8 +-
   sandbox/numeric_bindings/boost/numeric/bindings/tnt/fortran_array1d.hpp | 4
   sandbox/numeric_bindings/boost/numeric/bindings/tnt/fortran_array2d.hpp | 8 +-
   sandbox/numeric_bindings/boost/numeric/bindings/transpose.hpp | 12 +-
   sandbox/numeric_bindings/boost/numeric/bindings/ublas/compressed_matrix.hpp | 13 +-
   sandbox/numeric_bindings/boost/numeric/bindings/ublas/compressed_vector.hpp | 10 +-
   sandbox/numeric_bindings/boost/numeric/bindings/ublas/matrix.hpp | 14 ++-
   sandbox/numeric_bindings/boost/numeric/bindings/ublas/symmetric.hpp | 8 +
   sandbox/numeric_bindings/boost/numeric/bindings/ublas/triangular.hpp | 8 +
   sandbox/numeric_bindings/boost/numeric/bindings/ublas/vector.hpp | 6
   sandbox/numeric_bindings/boost/numeric/bindings/value.hpp | 6
   32 files changed, 302 insertions(+), 134 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/begin.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/begin.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/begin.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -9,37 +9,161 @@
 #ifndef BOOST_NUMERIC_BINDINGS_BEGIN_HPP
 #define BOOST_NUMERIC_BINDINGS_BEGIN_HPP
 
-#include <boost/numeric/bindings/data.hpp>
+#include <boost/numeric/bindings/rank.hpp>
 #include <boost/numeric/bindings/stride.hpp>
-#include <boost/numeric/bindings/value_type.hpp>
+#include <boost/numeric/bindings/value.hpp>
 #include <boost/numeric/bindings/detail/adaptor.hpp>
 #include <boost/numeric/bindings/detail/linear_iterator.hpp>
 
+
+#include <boost/preprocessor/repetition.hpp>
+#include <boost/preprocessor/cat.hpp>
+
+#include <iostream>
+
+
 namespace boost {
 namespace numeric {
 namespace bindings {
-namespace result_of {
+
+namespace detail {
+
+template< typename T, typename Tag >
+struct begin_impl {
+ typedef typename value<T>::type* result_type;
+
+ static result_type invoke( T& t ) {
+ return adaptor_access<T>::begin_value_array( t );
+ }
+
+};
 
 template< typename T >
+struct begin_impl< T, tag::value > {
+ typedef typename value<T>::type* result_type;
+
+ static result_type invoke( T& t ) {
+ return adaptor_access<T>::begin_value_array( t );
+ }
+
+};
+
+template< typename T, int Dimension >
+struct begin_impl<T, mpl::int_<Dimension> > {
+
+ typedef mpl::int_<Dimension> dim_type;
+
+ typedef linear_iterator<
+ typename value<T>::type,
+ typename result_of::stride<T,Dimension>::type
+ > result_type;
+
+ static result_type invoke( T& t ) {
+ return result_type( begin_value( t ), stride<Dimension>(t) );
+ }
+
+};
+
+} // namespace detail
+
+namespace result_of {
+
+template< typename T, typename Tag = mpl::int_<1> >
 struct begin {
- typedef detail::linear_iterator<
- typename value_type<T>::type,
- typename stride<T,1>::type
- > type;
+ typedef typename detail::begin_impl<T,Tag>::result_type type;
 };
 
 } // namespace result_of
 
+//
+// Free Functions
+//
+
+// Overloads like begin< tag::value, etc. >
+
+template< typename Tag, typename T >
+typename result_of::begin<T,Tag>::type begin( T& t ) {
+ return detail::begin_impl<T,Tag>::invoke( t );
+}
+
+template< typename Tag, typename T >
+typename result_of::begin<const T,Tag>::type begin( const T& t ) {
+ return detail::begin_impl<const T,Tag>::invoke( t );
+}
+
+// Overloads like begin<1>, begin<2>, etc..
+
+template< int Dimension, typename T >
+typename result_of::begin<T, mpl::int_<Dimension> >::type begin( T& t ) {
+ return begin< mpl::int_<Dimension> >( t );
+}
+
+template< int Dimension, typename T >
+typename result_of::begin<const T, mpl::int_<Dimension> >::type begin( const T& t ) {
+ return begin< mpl::int_<Dimension> >( t );
+}
+
+// Overloads for types with rank <= 1 (scalars, vectors)
+// In this case, just begin() will be equal to begin1
+
 template< typename T >
-typename result_of::begin<T>::type begin( T& t ) {
- return typename result_of::begin<T>::type( data( t ), stride<1>( t ) );
+typename boost::enable_if< mpl::less< rank<T>, mpl::int_<2> >,
+ typename result_of::begin< T, mpl::int_<1> >::type >::type
+begin( T& t ) {
+ return begin< mpl::int_<1> >( t );
 }
 
 template< typename T >
-typename result_of::begin<T const>::type begin( T const& t ) {
- return typename result_of::begin<T const>::type( data( t ), stride<1>( t ) );
+typename boost::enable_if< mpl::less< rank<T>, mpl::int_<2> >,
+ typename result_of::begin< const T, mpl::int_<1> >::type >::type
+begin( const T& t ) {
+ return begin< mpl::int_<1> >( t );
 }
 
+//
+// Convenience functions
+//
+
+// Begin of value array
+
+template< typename T >
+typename result_of::begin<T, tag::value>::type begin_value( T& t ) {
+ return detail::begin_impl<T, tag::value>::invoke( t );
+}
+
+template< typename T >
+typename result_of::begin<const T, tag::value>::type begin_value( const T& t ) {
+ return detail::begin_impl<const T, tag::value>::invoke( t );
+}
+
+#define GENERATE_BEGIN( z, which, unused ) \
+\
+namespace result_of {\
+\
+template< typename T > \
+struct BOOST_PP_CAT( begin, which ) { \
+ typedef typename detail::begin_impl<T,mpl::int_<which> >::result_type type;\
+}; \
+\
+}\
+\
+template< typename T >\
+typename BOOST_PP_CAT( result_of::begin, which )<T>::type \
+BOOST_PP_CAT( begin, which )( T& t ) {\
+ return detail::begin_impl<T, mpl::int_<which> >::\
+ invoke( t );\
+}\
+\
+template< typename T >\
+typename BOOST_PP_CAT( result_of::begin, which )<const T>::type \
+BOOST_PP_CAT( begin, which )( const T& t ) {\
+ return detail::begin_impl<const T, mpl::int_<which> >::\
+ invoke( t );\
+}
+
+BOOST_PP_REPEAT_FROM_TO(1,2,GENERATE_BEGIN,~)
+
+
 } // namespace bindings
 } // namespace numeric
 } // namespace boost

Modified: sandbox/numeric_bindings/boost/numeric/bindings/column.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/column.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/column.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -9,11 +9,11 @@
 #ifndef BOOST_NUMERIC_BINDINGS_COLUMN_HPP
 #define BOOST_NUMERIC_BINDINGS_COLUMN_HPP
 
-#include <boost/numeric/bindings/data.hpp>
+#include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/adaptable_type.hpp>
 #include <boost/numeric/bindings/size.hpp>
 #include <boost/numeric/bindings/stride.hpp>
-#include <boost/numeric/bindings/value_type.hpp>
+#include <boost/numeric/bindings/value.hpp>
 #include <boost/ref.hpp>
 
 namespace boost {
@@ -36,7 +36,7 @@
 template< typename T, typename Id, typename Enable >
 struct adaptor< column_wrapper<T>, Id, Enable > {
 
- typedef typename value_type<T>::type value_type;
+ typedef typename value<T>::type value_type;
     typedef mpl::map<
         mpl::pair< tag::value_type, value_type >,
         mpl::pair< tag::entity, tag::vector >,
@@ -45,15 +45,15 @@
         mpl::pair< tag::stride_type<1>, typename result_of::stride<T,1>::type >
> property_map;
 
- static typename result_of::size<T,1>::type size1( Id const& id ) {
+ static typename result_of::size<T,1>::type size1( const Id& id ) {
         return size<1>( id.get() );
     }
 
- static typename result_of::data<T>::type data( Id& id ) {
- return bindings::data( id.get() ) + id.m_index * stride<2>( id.get() );
+ static typename result_of::begin<T,tag::value>::type begin_value_array( Id& id ) {
+ return begin<tag::value>( id.get() ) + id.m_index * stride<2>( id.get() );
     }
 
- static typename result_of::stride<T,1>::type stride1( Id const& id ) {
+ static typename result_of::stride<T,1>::type stride1( const Id& id ) {
         return stride<1>( id.get() );
     }
 
@@ -77,8 +77,8 @@
 }
 
 template< typename T >
-detail::column_wrapper<T const> column( T const& underlying, std::size_t index ) {
- return detail::column_wrapper<T const>( underlying, index );
+detail::column_wrapper<const T> column( const T& underlying, std::size_t index ) {
+ return detail::column_wrapper<const T>( underlying, index );
 }
 
 } // namespace bindings

Deleted: sandbox/numeric_bindings/boost/numeric/bindings/data.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/data.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
+++ (empty file)
@@ -1,55 +0,0 @@
-//
-// Copyright (c) 2009 Rutger ter Borg
-//
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-//
-
-#ifndef BOOST_NUMERIC_BINDINGS_DATA_HPP
-#define BOOST_NUMERIC_BINDINGS_DATA_HPP
-
-#include <boost/numeric/bindings/detail/adaptor.hpp>
-
-namespace boost {
-namespace numeric {
-namespace bindings {
-namespace detail {
-
-template< typename T >
-struct data_impl {
-
- typedef typename property_at< T, tag::value_type >::type* result_type;
-
- static result_type data( T& t ) {
- return adaptor_access<T>::data( t );
- }
-
-};
-
-} // namespace detail
-
-namespace result_of {
-
-template< typename T >
-struct data {
- typedef typename detail::data_impl<T>::result_type type;
-};
-
-} // namespace result_of
-
-template< typename T >
-typename result_of::data<T>::type data( T& t ) {
- return detail::data_impl<T>::data( t );
-}
-
-template< typename T >
-typename result_of::data<T const>::type data( T const& t ) {
- return detail::data_impl<T const>::data( t );
-}
-
-} // bindings
-} // numeric
-} // boost
-
-#endif

Modified: sandbox/numeric_bindings/boost/numeric/bindings/detail/adaptor.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/detail/adaptor.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/detail/adaptor.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -9,12 +9,12 @@
 #ifndef BOOST_NUMERIC_BINDINGS_DETAIL_ADAPTOR_HPP
 #define BOOST_NUMERIC_BINDINGS_DETAIL_ADAPTOR_HPP
 
-#include <boost/utility/enable_if.hpp>
+#include <boost/mpl/map.hpp>
 #include <boost/numeric/bindings/detail/copy_const.hpp>
 #include <boost/numeric/bindings/is_numeric.hpp>
 #include <boost/numeric/bindings/tag.hpp>
 #include <boost/type_traits/remove_const.hpp>
-#include <boost/mpl/map.hpp>
+#include <boost/utility/enable_if.hpp>
 
 namespace boost {
 namespace numeric {
@@ -40,7 +40,6 @@
 struct adaptor_access< T, typename boost::enable_if< is_adaptable<T> >::type >:
     adaptor< typename boost::remove_const<T>::type, T > {};
 
-
 } // namespace detail
 } // namespace bindings
 } // namespace numeric

Modified: sandbox/numeric_bindings/boost/numeric/bindings/detail/copy_const.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/detail/copy_const.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/detail/copy_const.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -10,8 +10,8 @@
 #define BOOST_NUMERIC_BINDINGS_DETAIL_COPY_CONST_HPP
 
 #include <boost/mpl/if.hpp>
-#include <boost/type_traits/is_const.hpp>
 #include <boost/type_traits/add_const.hpp>
+#include <boost/type_traits/is_const.hpp>
 
 namespace boost {
 namespace numeric {
@@ -24,9 +24,9 @@
         typename add_const<Target>::type, Target >::type type;
 };
 
-} // detail
-} // bindings
-} // numeric
-} // boost
+} // namespace detail
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
 
 #endif

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-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -25,7 +25,7 @@
 template<> \
 struct get_dispatch< tag::size_type<which> > { \
     template< typename T > \
- static std::ptrdiff_t invoke( T const& t ) { \
+ static std::ptrdiff_t invoke( const T& t ) { \
         return detail::adaptor_access<T>:: \
         BOOST_PP_CAT( size, which )( t ); \
     } \
@@ -34,7 +34,7 @@
 template<> \
 struct get_dispatch< tag::stride_type<which> > { \
     template< typename T > \
- static std::ptrdiff_t invoke( T const& t ) { \
+ static std::ptrdiff_t invoke( const T& t ) { \
         return detail::adaptor_access<T>:: \
         BOOST_PP_CAT( stride, which )( t ); \
     } \
@@ -51,7 +51,7 @@
 
     typedef std::ptrdiff_t result_type;
 
- static std::ptrdiff_t invoke( T const& t ) {
+ static std::ptrdiff_t invoke( const T& t ) {
         return get_dispatch<Key>::invoke( t );
     }
 
@@ -63,7 +63,7 @@
 
     typedef typename property_at< T, Key >::type result_type;
 
- static result_type invoke( T const& t ) {
+ static result_type invoke( const T& t ) {
         return result_type();
     }
 
@@ -75,7 +75,7 @@
 };
 
 template< typename Key, typename T >
-typename result_of_get< T, Key >::type get( T const& t ) {
+typename result_of_get< T, Key >::type get( const T& t ) {
     return get_impl< T, Key >::invoke( t );
 }
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/detail/pod.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/detail/pod.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/detail/pod.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -28,7 +28,7 @@
         mpl::pair< tag::stride_type<1>, mpl::int_<0> >
> property_map;
 
- static value_type* data( Id& t ) {
+ static value_type* begin_value_array( Id& t ) {
         return &t;
     }
 
@@ -46,7 +46,7 @@
         mpl::pair< tag::stride_type<1>, tag::contiguous >
> property_map;
 
- static value_type* data( Id& t ) {
+ static value_type* begin_value_array( Id& t ) {
         return &t[0];
     }
 
@@ -68,7 +68,7 @@
         mpl::pair< tag::stride_type<2>, tag::contiguous >
> property_map;
 
- static value_type* data( Id& t ) {
+ static value_type* begin_value_array( Id& t ) {
         return &t[0][0];
     }
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/detail/property_map.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/detail/property_map.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/detail/property_map.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -9,9 +9,9 @@
 #ifndef BOOST_NUMERIC_BINDINGS_DETAIL_PROPERTY_MAP_HPP
 #define BOOST_NUMERIC_BINDINGS_DETAIL_PROPERTY_MAP_HPP
 
-#include <boost/type_traits/is_same.hpp>
 #include <boost/mpl/at.hpp>
 #include <boost/mpl/has_key.hpp>
+#include <boost/type_traits/is_same.hpp>
 
 namespace boost {
 namespace numeric {

Modified: sandbox/numeric_bindings/boost/numeric/bindings/eigen/matrix.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/eigen/matrix.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/eigen/matrix.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -58,23 +58,23 @@
             typename if_row_major< data_order, tag::contiguous, size_type1 >::type >
> property_map;
 
- static std::ptrdiff_t size1( Id const& t ) {
+ static std::ptrdiff_t size1( const Id& t ) {
         return t.rows();
     }
 
- static std::ptrdiff_t size2( Id const& t ) {
+ static std::ptrdiff_t size2( const Id& t ) {
         return t.cols();
     }
 
- static value_type* data( Id& t ) {
+ static value_type* begin_value_array( Id& t ) {
         return t.data();
     }
 
- static std::ptrdiff_t stride1( Id const& t ) {
+ static std::ptrdiff_t stride1( const Id& t ) {
         return t.cols();
     }
 
- static std::ptrdiff_t stride2( Id const& t ) {
+ static std::ptrdiff_t stride2( const Id& t ) {
         return t.rows();
     }
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/end.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/end.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/end.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -14,25 +14,55 @@
 namespace boost {
 namespace numeric {
 namespace bindings {
-namespace result_of {
+
+namespace detail {
+
+template< typename T, typename Tag = tag::value >
+struct end_impl {
+};
 
 template< typename T >
+struct end_impl< T, tag::value > {
+ typedef typename value<T>::type* result_type;
+
+ static result_type invoke( T& t ) {
+ return adaptor_access<T>::begin_value_array( t );
+ }
+
+};
+
+} // namespace detail
+
+namespace result_of {
+
+template< typename T, typename Tag = tag::value >
 struct end {
- typedef typename begin<T>::type type;
+ typedef typename detail::begin_impl<T,Tag>::result_type type;
 };
 
 } // namespace result_of
 
+template< typename Tag, typename T >
+typename result_of::end<T,Tag>::type end( T& t ) {
+ return detail::end_impl<T,Tag>::invoke( t );
+}
+
+template< typename Tag, typename T >
+typename result_of::end<const T,Tag>::type end( const T& t ) {
+ return detail::end_impl<const T,Tag>::invoke( t );
+}
+
 template< typename T >
 typename result_of::end<T>::type end( T& t ) {
- return typename result_of::end<T>::type( data( t ), stride<1>( t ) ) + size<1>( t );
+ return detail::end_impl<T>::invoke( t );
 }
 
 template< typename T >
-typename result_of::end<T const>::type end( T const& t ) {
- return typename result_of::end<T const>::type( data( t ), stride<1>( t ) ) + size<1>( t );
+typename result_of::end<const T>::type end( const T& t ) {
+ return detail::end_impl<const T>::invoke( t );
 }
 
+
 } // namespace bindings
 } // namespace numeric
 } // namespace boost

Modified: sandbox/numeric_bindings/boost/numeric/bindings/io.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/io.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/io.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -22,9 +22,9 @@
 namespace detail {
 
 template< typename Stream, typename T >
-Stream& pretty_print( Stream& os, T const& t ) {
+Stream& pretty_print( Stream& os, const T& t ) {
     os << "[" << size<1>(t) << "] ";
- for( typename result_of::begin<T const>::type i = begin(t); i != end(t); ++i ) {
+ for( typename result_of::begin< const T >::type i = begin(t); i != end(t); ++i ) {
         os << *i << " ";
     }
     return os;

Added: sandbox/numeric_bindings/boost/numeric/bindings/is_mutable.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/is_mutable.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -0,0 +1,32 @@
+//
+// Copyright (c) 2009 by Rutger ter Borg
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_NUMERIC_BINDINGS_IS_MUTABLE_HPP
+#define BOOST_NUMERIC_BINDINGS_IS_MUTABLE_HPP
+
+#include <boost/type_traits/value.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+
+//
+// TODO things like index arrays should be mutable, too
+//
+template< typename T >
+struct is_mutable:
+ mpl::and_<
+ is_reference< typename value<T>::type >,
+ mpl::not_< is_const< typename value<T>::type > >
+ >::type {};
+
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif

Added: sandbox/numeric_bindings/boost/numeric/bindings/min_rank.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/min_rank.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -0,0 +1,26 @@
+//
+// Copyright (c) 2009 Rutger ter Borg
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_NUMERIC_BINDINGS_MIN_TENSOR_RANK_HPP
+#define BOOST_NUMERIC_BINDINGS_MIN_TENSOR_RANK_HPP
+
+#include <boost/numeric/bindings/detail/adaptor.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+
+template< typename T >
+int min_rank( T const& t ) {
+}
+
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif

Modified: sandbox/numeric_bindings/boost/numeric/bindings/noop.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/noop.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/noop.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -10,6 +10,7 @@
 #define BOOST_NUMERIC_BINDINGS_NOOP_HPP
 
 #include <boost/numeric/bindings/detail/adaptable_type.hpp>
+#include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/size.hpp>
 #include <boost/numeric/bindings/stride.hpp>
 #include <boost/ref.hpp>
@@ -32,12 +33,12 @@
     typedef adaptor< typename boost::remove_const<T>::type, T > underlying_adaptor;
     typedef typename underlying_adaptor::property_map property_map;
 
- static typename result_of::size<T,1>::type size1( Id const& id ) {
+ static typename result_of::size<T,1>::type size1( const Id& id ) {
         return size<1>( id.get() );
     }
 
- static typename mpl::at< property_map, tag::value_type >::type* data( Id& id ) {
- return underlying_adaptor::data( id.get() );
+ static typename result_of::begin< T, tag::value >::type begin_value_array( Id& id ) {
+ return begin< tag::value >( id.get() );
     }
 
 };
@@ -59,8 +60,8 @@
 }
 
 template< typename T >
-detail::noop_wrapper<T const> noop( T const& underlying ) {
- return detail::noop_wrapper<T const>( underlying );
+detail::noop_wrapper<const T> noop( const T& underlying ) {
+ return detail::noop_wrapper<const T>( underlying );
 }
 
 } // namespace bindings

Modified: sandbox/numeric_bindings/boost/numeric/bindings/num_columns.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/num_columns.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/num_columns.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -24,7 +24,7 @@
 } // namespace result_of
 
 template< typename T >
-inline typename result_of::num_columns<T>::type num_columns( T const& t ) {
+inline typename result_of::num_columns<T>::type num_columns( const T& t ) {
     return size<2>( t );
 }
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/num_rows.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/num_rows.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/num_rows.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -24,7 +24,7 @@
 } // namespace result_of
 
 template< typename T >
-inline typename result_of::num_rows<T>::type num_rows( T const& t ) {
+inline typename result_of::num_rows<T>::type num_rows( const T& t ) {
     return size<1>( t );
 }
 

Copied: sandbox/numeric_bindings/boost/numeric/bindings/rank.hpp (from r58094, /sandbox/numeric_bindings/boost/numeric/bindings/tensor_rank.hpp)
==============================================================================
--- /sandbox/numeric_bindings/boost/numeric/bindings/tensor_rank.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/rank.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -16,7 +16,7 @@
 namespace bindings {
 
 template< typename T >
-struct tensor_rank: mpl::int_< detail::property_at< T, tag::entity >::type::value > {};
+struct rank: mpl::int_< detail::property_at< T, tag::entity >::type::value > {};
 
 } // namespace bindings
 } // namespace numeric

Added: sandbox/numeric_bindings/boost/numeric/bindings/remove_imaginary.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/remove_imaginary.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -0,0 +1,30 @@
+//
+// Copyright (c) 2009 by Rutger ter Borg
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_NUMERIC_BINDINGS_REMOVE_IMAGINARY_HPP
+#define BOOST_NUMERIC_BINDINGS_REMOVE_IMAGINARY_HPP
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+
+template< typename T >
+struct remove_imaginary {
+ typedef T type;
+};
+
+template< typename T >
+struct remove_imaginary< std::complex<T> > {
+ typedef T type;
+};
+
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif

Modified: sandbox/numeric_bindings/boost/numeric/bindings/row.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/row.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/row.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -9,11 +9,11 @@
 #ifndef BOOST_NUMERIC_BINDINGS_ROW_HPP
 #define BOOST_NUMERIC_BINDINGS_ROW_HPP
 
-#include <boost/numeric/bindings/data.hpp>
+#include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/adaptable_type.hpp>
 #include <boost/numeric/bindings/size.hpp>
 #include <boost/numeric/bindings/stride.hpp>
-#include <boost/numeric/bindings/value_type.hpp>
+#include <boost/numeric/bindings/value.hpp>
 #include <boost/ref.hpp>
 
 namespace boost {
@@ -36,7 +36,7 @@
 template< typename T, typename Id, typename Enable >
 struct adaptor< row_wrapper<T>, Id, Enable > {
 
- typedef typename value_type<T>::type value_type;
+ typedef typename value<T>::type value_type;
     typedef mpl::map<
         mpl::pair< tag::value_type, value_type >,
         mpl::pair< tag::entity, tag::vector >,
@@ -45,15 +45,15 @@
         mpl::pair< tag::stride_type<1>, typename result_of::stride<T,2>::type >
> property_map;
 
- static typename result_of::size<T,2>::type size1( Id const& id ) {
+ static typename result_of::size<T,2>::type size1( const Id& id ) {
         return size<2>( id.get() );
     }
 
- static typename result_of::data<T>::type data( Id& id ) {
- return bindings::data( id.get() ) + id.m_index * stride<1>( id.get() );
+ static typename result_of::begin<T,tag::value>::type begin_value_array( Id& id ) {
+ return begin< tag::value >( id.get() ) + id.m_index * stride<1>( id.get() );
     }
 
- static typename result_of::stride<T,2>::type stride1( Id const& id ) {
+ static typename result_of::stride<T,2>::type stride1( const Id& id ) {
         return stride<2>( id.get() );
     }
 
@@ -76,12 +76,12 @@
 }
 
 template< typename T >
-detail::row_wrapper<T const> row( T const& underlying, std::size_t index ) {
- return detail::row_wrapper<T const>( underlying, index );
+detail::row_wrapper<const T> row( const T& underlying, std::size_t index ) {
+ return detail::row_wrapper<const T>( underlying, index );
 }
 
 template< int N, typename T >
-void row( T const& underlying ) {
+void row( const T& underlying ) {
 
 }
 

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-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -10,7 +10,7 @@
 #define BOOST_NUMERIC_BINDINGS_SIZE_HPP
 
 #include <boost/numeric/bindings/detail/get.hpp>
-#include <boost/numeric/bindings/tensor_rank.hpp>
+#include <boost/numeric/bindings/rank.hpp>
 #include <boost/mpl/min.hpp>
 #include <boost/mpl/and.hpp>
 #include <boost/mpl/less_equal.hpp>
@@ -26,7 +26,7 @@
 
     typedef typename result_of_get< T, Key >::type result_type;
 
- static result_type size( T const& t ) {
+ static result_type size( const T& t ) {
         return get< Key >( t );
     }
 
@@ -35,13 +35,13 @@
 template< typename T, typename Key >
 struct size_impl< T, Key,
         typename boost::enable_if< typename mpl::and_<
- mpl::greater< Key, tensor_rank<T> >,
+ mpl::greater< Key, rank<T> >,
             is_same_at< T, tag::size_type<1>, std::ptrdiff_t >
>::type >::type > {
 
     typedef std::ptrdiff_t result_type;
 
- static result_type size( T const& t ) {
+ static result_type size( const T& t ) {
         return std::min< std::ptrdiff_t >( size_impl<T, tag::size_type<1> >::size(t), 1 );
     }
 
@@ -50,7 +50,7 @@
 template< typename T, typename Key >
 struct size_impl< T, Key,
         typename boost::enable_if< typename mpl::and_<
- mpl::greater< Key, tensor_rank<T> >,
+ mpl::greater< Key, rank<T> >,
             mpl::not_< is_same_at< T, tag::size_type<1>, std::ptrdiff_t > >
>::type >::type > {
 
@@ -59,7 +59,7 @@
         mpl::int_<1>
>::type result_type;
 
- static result_type size( T const& t ) {
+ static result_type size( const T& t ) {
         return result_type();
     }
 
@@ -78,12 +78,12 @@
 } // namespace result_of
 
 template< int Dimension, typename T >
-inline typename result_of::size< T const, Dimension >::type size( T const& t ) {
- return detail::size_impl< T const, tag::size_type<Dimension> >::size( t );
+inline typename result_of::size< const T, Dimension >::type size( const T& t ) {
+ return detail::size_impl< const T, tag::size_type<Dimension> >::size( t );
 }
 
 template< typename T >
-inline std::ptrdiff_t size( T const& t, std::size_t dimension ) {
+inline std::ptrdiff_t size( const T& t, std::size_t dimension ) {
     switch( dimension ) {
         case 1: return size<1>(t);
         case 2: return size<2>(t);

Modified: sandbox/numeric_bindings/boost/numeric/bindings/std/valarray.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/std/valarray.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/std/valarray.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -28,11 +28,11 @@
         mpl::pair< tag::data_structure, tag::linear_array >
> property_map;
 
- static std::ptrdiff_t size1( Id const& t ) {
+ static std::ptrdiff_t size1( const Id& t ) {
         return t.size();
     }
 
- static value_type* data( Id& t ) {
+ static value_type* begin_value_array( Id& t ) {
         return &t.front();
     }
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/std/vector.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/std/vector.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/std/vector.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -29,11 +29,11 @@
         mpl::pair< tag::stride_type<1>, tag::contiguous >
> property_map;
 
- static std::ptrdiff_t size1( Id const& t ) {
+ static std::ptrdiff_t size1( const Id& t ) {
         return t.size();
     }
 
- static value_type* data( Id& t ) {
+ static value_type* begin_value_array( Id& t ) {
         return &t.front();
     }
 

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-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -11,7 +11,7 @@
 
 #include <boost/numeric/bindings/detail/adaptor.hpp>
 #include <boost/numeric/bindings/detail/get.hpp>
-#include <boost/numeric/bindings/tensor_rank.hpp>
+#include <boost/numeric/bindings/rank.hpp>
 #include <boost/mpl/min.hpp>
 #include <boost/mpl/and.hpp>
 #include <boost/mpl/less_equal.hpp>
@@ -27,7 +27,7 @@
 
     typedef typename result_of_get< T, Key >::type result_type;
 
- static result_type stride( T const& t ) {
+ static result_type stride( const T& t ) {
         return get< Key >( t );
     }
 
@@ -36,13 +36,13 @@
 template< typename T, typename Key >
 struct stride_impl< T, Key,
         typename boost::enable_if< typename mpl::and_<
- mpl::greater< Key, tensor_rank<T> >,
+ mpl::greater< Key, rank<T> >,
             is_same_at< T, tag::stride_type<1>, std::ptrdiff_t >
>::type >::type > {
 
     typedef std::ptrdiff_t result_type;
 
- static result_type stride( T const& t ) {
+ static result_type stride( const T& t ) {
         return 0;
     }
 
@@ -51,13 +51,13 @@
 template< typename T, typename Key >
 struct stride_impl< T, Key,
         typename boost::enable_if< typename mpl::and_<
- mpl::greater< Key, tensor_rank<T> >,
+ mpl::greater< Key, rank<T> >,
             mpl::not_< is_same_at< T, tag::stride_type<1>, std::ptrdiff_t > >
>::type >::type > {
 
     typedef typename mpl::int_<0> result_type;
 
- static result_type stride( T const& t ) {
+ static result_type stride( const T& t ) {
         return result_type();
     }
 
@@ -75,12 +75,12 @@
 } // namespace result_of
 
 template< int Dimension, typename T >
-inline typename result_of::stride< T const, Dimension >::type stride( T const& t ) {
- return detail::stride_impl< T const, tag::stride_type<Dimension> >::stride( t );
+inline typename result_of::stride< const T, Dimension >::type stride( const T& t ) {
+ return detail::stride_impl< const T, tag::stride_type<Dimension> >::stride( t );
 }
 
 template< typename T >
-inline std::ptrdiff_t stride( T const& t, std::size_t dimension ) {
+inline std::ptrdiff_t stride( const T& t, std::size_t dimension ) {
     switch( dimension ) {
         case 1: return stride<1>(t);
         case 2: return stride<2>(t);

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-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -16,8 +16,9 @@
 
 // key: entity
 struct value_type {};
-struct entity {};
+struct value {};
 
+struct entity {};
 struct matrix_type {};
 struct matrix_side {};
 

Deleted: sandbox/numeric_bindings/boost/numeric/bindings/tensor_rank.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/tensor_rank.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
+++ (empty file)
@@ -1,25 +0,0 @@
-//
-// Copyright (c) 2009 Rutger ter Borg
-//
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-//
-
-#ifndef BOOST_NUMERIC_BINDINGS_TENSOR_RANK_HPP
-#define BOOST_NUMERIC_BINDINGS_TENSOR_RANK_HPP
-
-#include <boost/numeric/bindings/detail/adaptor.hpp>
-
-namespace boost {
-namespace numeric {
-namespace bindings {
-
-template< typename T >
-struct tensor_rank: mpl::int_< detail::property_at< T, tag::entity >::type::value > {};
-
-} // namespace bindings
-} // namespace numeric
-} // namespace boost
-
-#endif

Modified: sandbox/numeric_bindings/boost/numeric/bindings/tnt/array1d.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/tnt/array1d.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/tnt/array1d.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -29,11 +29,11 @@
         mpl::pair< tag::stride_type<1>, tag::contiguous >
> property_map;
 
- static std::ptrdiff_t size1( Id const& t ) {
+ static std::ptrdiff_t size1( const Id& t ) {
         return t.dim();
     }
 
- static value_type* data( Id& t ) {
+ static value_type* begin_value_array( Id& t ) {
         return &t[0];
     }
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/tnt/array2d.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/tnt/array2d.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/tnt/array2d.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -32,19 +32,19 @@
         mpl::pair< tag::stride_type<2>, tag::contiguous >
> property_map;
 
- static std::ptrdiff_t size1( Id const& t ) {
+ static std::ptrdiff_t size1( const Id& t ) {
         return t.dim1();
     }
 
- static std::ptrdiff_t size2( Id const& t ) {
+ static std::ptrdiff_t size2( const Id& t ) {
         return t.dim2();
     }
 
- static value_type* data( Id& t ) {
+ static value_type* begin_value_array( Id& t ) {
         return &t[0];
     }
 
- static std::ptrdiff_t stride1( Id const& t ) {
+ static std::ptrdiff_t stride1( const Id& t ) {
         return t.dim2();
     }
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/tnt/fortran_array1d.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/tnt/fortran_array1d.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/tnt/fortran_array1d.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -29,11 +29,11 @@
         mpl::pair< tag::stride_type<1>, tag::contiguous >
> property_map;
 
- static std::ptrdiff_t size1( Id const& t ) {
+ static std::ptrdiff_t size1( const Id& t ) {
         return t.dim();
     }
 
- static value_type* data( Id& t ) {
+ static value_type* begin_value_array( Id& t ) {
         return &t(1);
     }
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/tnt/fortran_array2d.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/tnt/fortran_array2d.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/tnt/fortran_array2d.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -33,19 +33,19 @@
 
> property_map;
 
- static std::ptrdiff_t size1( Id const& t ) {
+ static std::ptrdiff_t size1( const Id& t ) {
         return t.dim1();
     }
 
- static std::ptrdiff_t size2( Id const& t ) {
+ static std::ptrdiff_t size2( const Id& t ) {
         return t.dim2();
     }
 
- static value_type* data( Id& t ) {
+ static value_type* begin_value_array( Id& t ) {
         return &t(1,1);
     }
 
- static std::ptrdiff_t stride2( Id const& t ) {
+ static std::ptrdiff_t stride2( const Id& t ) {
         return t.dim1();
     }
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/transpose.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/transpose.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/transpose.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -9,7 +9,7 @@
 #ifndef BOOST_NUMERIC_BINDINGS_TRANSPOSE_HPP
 #define BOOST_NUMERIC_BINDINGS_TRANSPOSE_HPP
 
-#include <boost/numeric/bindings/value_type.hpp>
+#include <boost/numeric/bindings/value.hpp>
 #include <boost/numeric/bindings/entity.hpp>
 #include <boost/mpl/max.hpp>
 
@@ -24,16 +24,16 @@
 template< typename T, typename Id, typename Enable >
 struct adaptor< transpose_wrapper<T>, Id, Enable > {
 
- typedef typename value_type<T>::type value_type;
+ typedef typename value<T>::type value_type;
     typedef typename boost::mpl::max<
             boost::mpl::int_<2>,
             typename entity<T>::type >::type entity;
 
- static std::ptrdiff_t size1( Id const& t ) {
+ static std::ptrdiff_t size1( const Id& t ) {
         return bindings::tensor_size2( t.get() );
     }
 
- static std::ptrdiff_t size2( Id const& t ) {
+ static std::ptrdiff_t size2( const Id& t ) {
         return bindings::tensor_size1( t.get() );
     }
 
@@ -48,8 +48,8 @@
 }
 
 template< typename T >
-detail::transpose_wrapper<T const> trans( T const& underlying ) {
- return detail::transpose_wrapper<T const>( underlying );
+detail::transpose_wrapper<const T> trans( const T& underlying ) {
+ return detail::transpose_wrapper<const T>( underlying );
 }
 
 } // namespace bindings

Modified: sandbox/numeric_bindings/boost/numeric/bindings/ublas/compressed_matrix.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/ublas/compressed_matrix.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/ublas/compressed_matrix.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -9,6 +9,7 @@
 #ifndef BOOST_NUMERIC_BINDINGS_UBLAS_COMPRESSED_MATRIX_HPP
 #define BOOST_NUMERIC_BINDINGS_UBLAS_COMPRESSED_MATRIX_HPP
 
+#include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/adaptor.hpp>
 #include <boost/numeric/bindings/ublas/detail/convert_to.hpp>
 #include <boost/numeric/ublas/matrix_sparse.hpp>
@@ -31,22 +32,22 @@
         mpl::pair< tag::data_order, data_order >
> property_map;
 
- static std::ptrdiff_t size1( Id const& t ) {
+ static std::ptrdiff_t size1( const Id& t ) {
         return t.size1();
     }
 
- static std::ptrdiff_t size2( Id const& t ) {
+ static std::ptrdiff_t size2( const Id& t ) {
         return t.size2();
     }
 /*
     static void index_data( Id& t ) {
         return t.index_data()
- }
-
- static void value_data( Id& t ) {
- return t.value_data();
     }*/
 
+ static value_type* begin_value_array( Id& t ) {
+ return begin< tag::value >( t.value_data() );
+ }
+
 };
 
 } // namespace detail

Modified: sandbox/numeric_bindings/boost/numeric/bindings/ublas/compressed_vector.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/ublas/compressed_vector.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/ublas/compressed_vector.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -9,6 +9,7 @@
 #ifndef BOOST_NUMERIC_BINDINGS_UBLAS_COMPRESSED_VECTOR_HPP
 #define BOOST_NUMERIC_BINDINGS_UBLAS_COMPRESSED_VECTOR_HPP
 
+#include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/adaptor.hpp>
 #include <boost/numeric/ublas/vector_sparse.hpp>
 
@@ -28,7 +29,7 @@
         mpl::pair< tag::data_structure, tag::yale_sparse >
> property_map;
 
- static std::ptrdiff_t size1( Id const& t ) {
+ static std::ptrdiff_t size1( const Id& t ) {
         return t.size();
     }
 
@@ -36,9 +37,10 @@
 // // t.index_data();
 // }
 //
-// static void value_data( Id& t ) {
-// //t.value_data();
-// }
+
+ static value_type* begin_value_array( Id& t ) {
+ return begin< tag::value >( t.value_data() );
+ }
 
 };
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/ublas/matrix.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/ublas/matrix.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/ublas/matrix.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -9,9 +9,11 @@
 #ifndef BOOST_NUMERIC_BINDINGS_UBLAS_MATRIX_HPP
 #define BOOST_NUMERIC_BINDINGS_UBLAS_MATRIX_HPP
 
+#include <boost/numeric/bindings/begin.hpp>
 #include <boost/numeric/bindings/detail/adaptor.hpp>
 #include <boost/numeric/bindings/detail/if_row_major.hpp>
 #include <boost/numeric/bindings/ublas/detail/convert_to.hpp>
+#include <boost/numeric/bindings/ublas/unbounded_array.hpp>
 #include <boost/numeric/ublas/matrix.hpp>
 
 namespace boost {
@@ -37,23 +39,23 @@
             typename if_row_major< data_order, tag::contiguous, std::ptrdiff_t >::type >
> property_map;
 
- static std::ptrdiff_t size1( Id const& t ) {
+ static std::ptrdiff_t size1( const Id& t ) {
         return t.size1();
     }
 
- static std::ptrdiff_t size2( Id const& t ) {
+ static std::ptrdiff_t size2( const Id& t ) {
         return t.size2();
     }
 
- static value_type* data( Id& t ) {
- return &t.data()[0];
+ static value_type* begin_value_array( Id& t ) {
+ return begin< tag::value >( t.data() );
     }
 
- static std::ptrdiff_t stride1( Id const& t ) {
+ static std::ptrdiff_t stride1( const Id& t ) {
         return t.size2();
     }
 
- static std::ptrdiff_t stride2( Id const& t ) {
+ static std::ptrdiff_t stride2( const Id& t ) {
         return t.size1();
     }
 

Modified: sandbox/numeric_bindings/boost/numeric/bindings/ublas/symmetric.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/ublas/symmetric.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/ublas/symmetric.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -33,14 +33,18 @@
         mpl::pair< tag::data_order, typename convert_to< tag::data_order, F2 >::type >
> property_map;
 
- static std::ptrdiff_t size1( Id const& t ) {
+ static std::ptrdiff_t size1( const Id& t ) {
         return t.size1();
     }
 
- static std::ptrdiff_t size2( Id const& t ) {
+ static std::ptrdiff_t size2( const Id& t ) {
         return t.size2();
     }
 
+ static value_type* begin_value_array( Id& t ) {
+ return begin< tag::value >( t.data() );
+ }
+
 };
 
 } // namespace detail

Modified: sandbox/numeric_bindings/boost/numeric/bindings/ublas/triangular.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/ublas/triangular.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/ublas/triangular.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -34,14 +34,18 @@
         mpl::pair< tag::data_order, typename convert_to< tag::data_order, F2 >::type >
> property_map;
 
- static std::ptrdiff_t size1( Id const& t ) {
+ static std::ptrdiff_t size1( const Id& t ) {
         return t.size1();
     }
 
- static std::ptrdiff_t size2( Id const& t ) {
+ static std::ptrdiff_t size2( const Id& t ) {
         return t.size2();
     }
 
+ static value_type* begin_value_array( Id& t ) {
+ return begin< tag::value >( t.data() );
+ }
+
 };
 
 } // detail

Added: sandbox/numeric_bindings/boost/numeric/bindings/ublas/unbounded_array.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/ublas/unbounded_array.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -0,0 +1,47 @@
+//
+// Copyright (c) 2009 Rutger ter Borg
+//
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+
+#ifndef BOOST_NUMERIC_BINDINGS_UNBOUNDED_ARRAY_HPP
+#define BOOST_NUMERIC_BINDINGS_UNBOUNDED_ARRAY_HPP
+
+#include <boost/numeric/bindings/detail/adaptor.hpp>
+#include <boost/numeric/ublas/storage.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace detail {
+
+template< typename T, typename Alloc, typename Id, typename Enable >
+struct adaptor< ublas::unbounded_array< T, Alloc >, Id, Enable > {
+
+ typedef typename copy_const< Id, T >::type value_type;
+ typedef mpl::map<
+ mpl::pair< tag::value_type, value_type >,
+ mpl::pair< tag::entity, tag::vector >,
+ mpl::pair< tag::size_type<1>, std::ptrdiff_t >,
+ mpl::pair< tag::data_structure, tag::linear_array >,
+ mpl::pair< tag::stride_type<1>, tag::contiguous >
+ > property_map;
+
+ static std::ptrdiff_t size1( const Id& t ) {
+ return t.size();
+ }
+
+ static value_type* begin_value_array( Id& t ) {
+ return t.begin();
+ }
+
+};
+
+} // namespace detail
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif

Modified: sandbox/numeric_bindings/boost/numeric/bindings/ublas/vector.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/ublas/vector.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/ublas/vector.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -29,12 +29,12 @@
         mpl::pair< tag::stride_type<1>, tag::contiguous >
> property_map;
 
- static std::ptrdiff_t size1( Id const& t ) {
+ static std::ptrdiff_t size1( const Id& t ) {
         return t.size();
     }
 
- static value_type* data( Id& t ) {
- return &t.data()[0];
+ static value_type* begin_value_array( Id& t ) {
+ return begin< tag::value >( t.data() );
     }
 
 };

Copied: sandbox/numeric_bindings/boost/numeric/bindings/value.hpp (from r57956, /sandbox/numeric_bindings/boost/numeric/bindings/value_type.hpp)
==============================================================================
--- /sandbox/numeric_bindings/boost/numeric/bindings/value_type.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/value.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
@@ -6,8 +6,8 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 //
 
-#ifndef BOOST_NUMERIC_BINDINGS_VALUE_TYPE_HPP
-#define BOOST_NUMERIC_BINDINGS_VALUE_TYPE_HPP
+#ifndef BOOST_NUMERIC_BINDINGS_VALUE_HPP
+#define BOOST_NUMERIC_BINDINGS_VALUE_HPP
 
 #include <boost/numeric/bindings/detail/adaptor.hpp>
 
@@ -16,7 +16,7 @@
 namespace bindings {
 
 template< typename T >
-struct value_type {
+struct value {
     typedef typename detail::property_at< T, tag::value_type >::type type;
 };
 

Deleted: sandbox/numeric_bindings/boost/numeric/bindings/value_type.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/value_type.hpp 2009-12-02 10:42:42 EST (Wed, 02 Dec 2009)
+++ (empty file)
@@ -1,27 +0,0 @@
-//
-// Copyright (c) 2009 Rutger ter Borg
-//
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-//
-
-#ifndef BOOST_NUMERIC_BINDINGS_VALUE_TYPE_HPP
-#define BOOST_NUMERIC_BINDINGS_VALUE_TYPE_HPP
-
-#include <boost/numeric/bindings/detail/adaptor.hpp>
-
-namespace boost {
-namespace numeric {
-namespace bindings {
-
-template< typename T >
-struct value_type {
- typedef typename detail::property_at< T, tag::value_type >::type type;
-};
-
-} // namespace bindings
-} // namespace numeric
-} // namespace boost
-
-#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