Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57874 - in sandbox/numeric_bindings/boost/numeric/bindings: . tnt
From: rutger_at_[hidden]
Date: 2009-11-23 15:19:16


Author: rutger
Date: 2009-11-23 15:19:13 EST (Mon, 23 Nov 2009)
New Revision: 57874
URL: http://svn.boost.org/trac/boost/changeset/57874

Log:
added other tnt matrix/vector bindings

Added:
   sandbox/numeric_bindings/boost/numeric/bindings/tnt/tnt_array2d.hpp (contents, props changed)
   sandbox/numeric_bindings/boost/numeric/bindings/tnt/tnt_fortran_array1d.hpp (contents, props changed)
   sandbox/numeric_bindings/boost/numeric/bindings/tnt/tnt_fortran_array2d.hpp (contents, props changed)
Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/begin.hpp | 9 ++++-----
   sandbox/numeric_bindings/boost/numeric/bindings/end.hpp | 9 ++++-----
   sandbox/numeric_bindings/boost/numeric/bindings/is_complex.hpp | 6 +++---
   sandbox/numeric_bindings/boost/numeric/bindings/is_numeric.hpp | 6 +++---
   sandbox/numeric_bindings/boost/numeric/bindings/is_real.hpp | 6 +++---
   5 files changed, 17 insertions(+), 19 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-11-23 15:19:13 EST (Mon, 23 Nov 2009)
@@ -15,7 +15,6 @@
 namespace boost {
 namespace numeric {
 namespace bindings {
-
 namespace result_of {
 
 template< typename T >
@@ -23,7 +22,7 @@
     typedef detail::dense_iterator< typename value_type<T>::type > type;
 };
 
-}
+} // namespace result_of
 
 template< typename T >
 detail::dense_iterator< typename value_type<T>::type > begin( T& t ) {
@@ -37,8 +36,8 @@
         detail::adaptor_access<T const>::data( t ) );
 }
 
-} // bindings
-} // numeric
-} // boost
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
 
 #endif

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-11-23 15:19:13 EST (Mon, 23 Nov 2009)
@@ -15,7 +15,6 @@
 namespace boost {
 namespace numeric {
 namespace bindings {
-
 namespace result_of {
 
 template< typename T >
@@ -23,7 +22,7 @@
     typedef detail::dense_iterator< typename value_type<T>::type > type;
 };
 
-}
+} // namespace result_of
 
 template< typename T >
 detail::dense_iterator< typename value_type<T>::type > end( T& t ) {
@@ -37,8 +36,8 @@
         detail::adaptor_access<T const>::data( t ) ) + tensor_size1( t );
 }
 
-} // bindings
-} // numeric
-} // boost
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
 
 #endif

Modified: sandbox/numeric_bindings/boost/numeric/bindings/is_complex.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/is_complex.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/is_complex.hpp 2009-11-23 15:19:13 EST (Mon, 23 Nov 2009)
@@ -18,8 +18,8 @@
 template< typename T >
 struct is_complex: boost::is_complex<T> {};
 
-} // bindings
-} // numeric
-} // boost
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
 
 #endif

Modified: sandbox/numeric_bindings/boost/numeric/bindings/is_numeric.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/is_numeric.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/is_numeric.hpp 2009-11-23 15:19:13 EST (Mon, 23 Nov 2009)
@@ -21,8 +21,8 @@
 template< typename T >
 struct is_numeric: mpl::or_< is_real<T>, is_complex<T>, is_integral<T> > {};
 
-} // bindings
-} // numeric
-} // boost
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
 
 #endif

Modified: sandbox/numeric_bindings/boost/numeric/bindings/is_real.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/is_real.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/is_real.hpp 2009-11-23 15:19:13 EST (Mon, 23 Nov 2009)
@@ -18,8 +18,8 @@
 template< typename T >
 struct is_real: boost::is_floating_point<T> {};
 
-} // bindings
-} // numeric
-} // boost
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
 
 #endif

Added: sandbox/numeric_bindings/boost/numeric/bindings/tnt/tnt_array2d.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/tnt/tnt_array2d.hpp 2009-11-23 15:19:13 EST (Mon, 23 Nov 2009)
@@ -0,0 +1,50 @@
+//
+// 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_TNT_ARRAY2D_HPP
+#define BOOST_NUMERIC_BINDINGS_TNT_ARRAY2D_HPP
+
+#include <boost/numeric/bindings/detail/adaptor.hpp>
+#include <tnt_array2d.h>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace detail {
+
+template< typename T, typename Id, typename Enable >
+struct adaptor< TNT::Array2D< T >, 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::matrix >,
+ mpl::pair< tag::data_structure, tag::linear_array >,
+ mpl::pair< tag::data_order, tag::row_major >
+ > property_map;
+
+ static std::ptrdiff_t size1( Id const& t ) {
+ return t.dim1();
+ }
+
+ static std::ptrdiff_t size2( Id const& t ) {
+ return t.dim2();
+ }
+
+ static value_type* data( Id& t ) {
+ return &t[0];
+ }
+
+};
+
+} // namespace detail
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif

Added: sandbox/numeric_bindings/boost/numeric/bindings/tnt/tnt_fortran_array1d.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/tnt/tnt_fortran_array1d.hpp 2009-11-23 15:19:13 EST (Mon, 23 Nov 2009)
@@ -0,0 +1,45 @@
+//
+// 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_TNT_FORTRAN_ARRAY1D_HPP
+#define BOOST_NUMERIC_BINDINGS_TNT_FORTRAN_ARRAY1D_HPP
+
+#include <boost/numeric/bindings/detail/adaptor.hpp>
+#include <tnt_fortran_array1d.h>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace detail {
+
+template< typename T, typename Id, typename Enable >
+struct adaptor< TNT::Fortran_Array1D< T >, 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::data_structure, tag::linear_array >
+ > property_map;
+
+ static std::ptrdiff_t size1( Id const& t ) {
+ return t.dim();
+ }
+
+ static value_type* data( Id& t ) {
+ return &t(1);
+ }
+
+};
+
+} // namespace detail
+} // namespace bindings
+} // namespace numeric
+} // namespace boost
+
+#endif

Added: sandbox/numeric_bindings/boost/numeric/bindings/tnt/tnt_fortran_array2d.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/tnt/tnt_fortran_array2d.hpp 2009-11-23 15:19:13 EST (Mon, 23 Nov 2009)
@@ -0,0 +1,50 @@
+//
+// 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_TNT_FORTRAN_ARRAY2D_HPP
+#define BOOST_NUMERIC_BINDINGS_TNT_FORTRAN_ARRAY2D_HPP
+
+#include <boost/numeric/bindings/detail/adaptor.hpp>
+#include <tnt_fortran_array2d.h>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace detail {
+
+template< typename T, typename Id, typename Enable >
+struct adaptor< TNT::Fortran_Array2D< T >, 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::matrix >,
+ mpl::pair< tag::data_structure, tag::linear_array >,
+ mpl::pair< tag::data_order, tag::column_major >
+ > property_map;
+
+ static std::ptrdiff_t size1( Id const& t ) {
+ return t.dim1();
+ }
+
+ static std::ptrdiff_t size2( Id const& t ) {
+ return t.dim2();
+ }
+
+ static value_type* data( Id& t ) {
+ return &t(1,1);
+ }
+
+};
+
+} // namespace detail
+} // 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