Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58241 - in sandbox/numeric_bindings/boost/numeric/bindings: blas/detail detail std ublas
From: rutger_at_[hidden]
Date: 2009-12-08 14:49:02


Author: rutger
Date: 2009-12-08 14:49:01 EST (Tue, 08 Dec 2009)
New Revision: 58241
URL: http://svn.boost.org/trac/boost/changeset/58241

Log:
sync of numeric_bindings

Added:
   sandbox/numeric_bindings/boost/numeric/bindings/detail/generate_iter_funcs.hpp (contents, props changed)
Removed:
   sandbox/numeric_bindings/boost/numeric/bindings/detail/void_ptr.hpp
Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/cublas.h | 4 +++-
   sandbox/numeric_bindings/boost/numeric/bindings/detail/pod.hpp | 8 ++++++++
   sandbox/numeric_bindings/boost/numeric/bindings/detail/property_map.hpp | 1 +
   sandbox/numeric_bindings/boost/numeric/bindings/std/vector.hpp | 4 ++++
   sandbox/numeric_bindings/boost/numeric/bindings/ublas/matrix.hpp | 4 ++++
   sandbox/numeric_bindings/boost/numeric/bindings/ublas/unbounded_array.hpp | 4 ++++
   6 files changed, 24 insertions(+), 1 deletions(-)

Modified: sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/cublas.h
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/cublas.h (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/blas/detail/cublas.h 2009-12-08 14:49:01 EST (Tue, 08 Dec 2009)
@@ -9,6 +9,8 @@
 #ifndef BOOST_NUMERIC_BINDINGS_BLAS_DETAIL_CUBLAS_H
 #define BOOST_NUMERIC_BINDINGS_BLAS_DETAIL_CUBLAS_H
 
-#include <cublas.h>
+extern "C" {
+#include <cublas.h>
+}
 
 #endif

Added: sandbox/numeric_bindings/boost/numeric/bindings/detail/generate_iter_funcs.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/detail/generate_iter_funcs.hpp 2009-12-08 14:49:01 EST (Tue, 08 Dec 2009)
@@ -0,0 +1,49 @@
+//
+// 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_DETAIL_GENERATE_ITER_FUNCS_HPP
+#define BOOST_NUMERIC_BINDINGS_DETAIL_GENERATE_ITER_FUNCS_HPP
+
+#include <boost/preprocessor/repetition.hpp>
+#include <boost/preprocessor/cat.hpp>
+
+
+//
+// Convenience functions
+//
+
+#define GENERATE_ITER_FUNCS( function_name, suffix, tag ) \
+\
+namespace result_of {\
+\
+template< typename T > \
+struct BOOST_PP_CAT( function_name, suffix ) { \
+ typedef typename detail::\
+ BOOST_PP_CAT( function_name, _impl ) \
+ <T,tag>::result_type type; \
+}; \
+\
+}\
+\
+template< typename T >\
+typename result_of:: BOOST_PP_CAT( function_name, suffix )<T>::type \
+BOOST_PP_CAT( function_name, suffix )( T& t ) {\
+ return detail:: \
+ BOOST_PP_CAT( function_name, _impl ) \
+ <T, tag >::invoke( t );\
+}\
+\
+template< typename T >\
+typename result_of:: BOOST_PP_CAT( function_name, suffix )<const T>::type \
+BOOST_PP_CAT( function_name, suffix )( const T& t ) {\
+ return detail:: \
+ BOOST_PP_CAT( function_name, _impl ) \
+ <const T, tag >::invoke( t );\
+}
+
+#endif

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-08 14:49:01 EST (Tue, 08 Dec 2009)
@@ -50,6 +50,10 @@
         return &t[0];
     }
 
+ static value_type* end_value( Id& t ) {
+ return &t[N];
+ }
+
 };
 
 template< typename T, std::size_t N, std::size_t M, typename Id >
@@ -72,6 +76,10 @@
         return &t[0][0];
     }
 
+ static value_type* end_value( Id& t ) {
+ return &t[N][M];
+ }
+
 };
 
 } // namespace detail

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-08 14:49:01 EST (Tue, 08 Dec 2009)
@@ -9,6 +9,7 @@
 #ifndef BOOST_NUMERIC_BINDINGS_DETAIL_PROPERTY_MAP_HPP
 #define BOOST_NUMERIC_BINDINGS_DETAIL_PROPERTY_MAP_HPP
 
+#include <boost/numeric/bindings/detail/adaptor.hpp>
 #include <boost/mpl/at.hpp>
 #include <boost/mpl/has_key.hpp>
 #include <boost/type_traits/is_same.hpp>

Deleted: sandbox/numeric_bindings/boost/numeric/bindings/detail/void_ptr.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/detail/void_ptr.hpp 2009-12-08 14:49:01 EST (Tue, 08 Dec 2009)
+++ (empty file)
@@ -1,32 +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_DETAIL_VOID_PTR_HPP
-#define BOOST_NUMERIC_BINDINGS_DETAIL_VOID_PTR_HPP
-
-namespace boost {
-namespace numeric {
-namespace bindings {
-namespace detail {
-
-template< typename T >
-inline void* void_ptr( T* p) {
- return static_cast< void*>( p );
-}
-
-template< typename T >
-inline const void* void_ptr( const T* p ) {
- return static_cast< const void* >( p );
-}
-
-} // namespace detail
-} // namespace bindings
-} // namespace numeric
-} // namespace boost
-
-#endif

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-08 14:49:01 EST (Tue, 08 Dec 2009)
@@ -37,6 +37,10 @@
         return &t.front();
     }
 
+ static value_type* end_value( Id& t ) {
+ return &t.front() + t.size();
+ }
+
 };
 
 } // namespace detail

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-08 14:49:01 EST (Tue, 08 Dec 2009)
@@ -51,6 +51,10 @@
         return bindings::begin_value( t.data() );
     }
 
+ static value_type* end_value( Id& t ) {
+ return bindings::end_value( t.data() );
+ }
+
     static std::ptrdiff_t stride1( const Id& t ) {
         return t.size2();
     }

Modified: sandbox/numeric_bindings/boost/numeric/bindings/ublas/unbounded_array.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/ublas/unbounded_array.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/ublas/unbounded_array.hpp 2009-12-08 14:49:01 EST (Tue, 08 Dec 2009)
@@ -37,6 +37,10 @@
         return t.begin();
     }
 
+ static value_type* end_value( Id& t ) {
+ return t.end();
+ }
+
 };
 
 } // 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