Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57741 - in sandbox/numeric_bindings/boost/numeric/bindings: std ublas
From: rutger_at_[hidden]
Date: 2009-11-18 07:47:29


Author: rutger
Date: 2009-11-18 07:47:28 EST (Wed, 18 Nov 2009)
New Revision: 57741
URL: http://svn.boost.org/trac/boost/changeset/57741

Log:
Starting to merge work on new traits structure

Added:
   sandbox/numeric_bindings/boost/numeric/bindings/std/
   sandbox/numeric_bindings/boost/numeric/bindings/std/valarray.hpp (contents, props changed)
   sandbox/numeric_bindings/boost/numeric/bindings/std/vector.hpp (contents, props changed)
   sandbox/numeric_bindings/boost/numeric/bindings/ublas/
   sandbox/numeric_bindings/boost/numeric/bindings/ublas/matrix.hpp (contents, props changed)
   sandbox/numeric_bindings/boost/numeric/bindings/ublas/vector.hpp (contents, props changed)

Added: sandbox/numeric_bindings/boost/numeric/bindings/std/valarray.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/std/valarray.hpp 2009-11-18 07:47:28 EST (Wed, 18 Nov 2009)
@@ -0,0 +1,39 @@
+//
+// 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_STD_VALARRAY_HPP
+#define BOOST_NUMERIC_BINDINGS_STD_VALARRAY_HPP
+
+#include <boost/numeric/bindings/detail/adaptor.hpp>
+#include <boost/numeric/bindings/detail/dense.hpp>
+#include <valarray>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace detail {
+
+template< typename T, typename Id, typename Enable >
+struct adaptor< std::valarray< T >, Id, Enable > {
+
+ // Generic information
+ typedef typename Id::value_type value_type;
+ typedef boost::mpl::int_<1> tensor_rank;
+
+ static std::ptrdiff_t size1( Id const& t ) {
+ return t.size();
+ }
+
+};
+
+} // detail
+} // bindings
+} // numeric
+} // boost
+
+#endif

Added: sandbox/numeric_bindings/boost/numeric/bindings/std/vector.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/std/vector.hpp 2009-11-18 07:47:28 EST (Wed, 18 Nov 2009)
@@ -0,0 +1,39 @@
+//
+// 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_STD_VECTOR_HPP
+#define BOOST_NUMERIC_BINDINGS_STD_VECTOR_HPP
+
+#include <boost/numeric/bindings/detail/adaptor.hpp>
+#include <boost/numeric/bindings/detail/dense.hpp>
+#include <vector>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace detail {
+
+template< typename T, typename Alloc, typename Id, typename Enable >
+struct adaptor< std::vector< T, Alloc >, Id, Enable > {
+
+ // Generic information
+ typedef typename Id::value_type value_type;
+ typedef boost::mpl::int_<1> tensor_rank;
+
+ static std::ptrdiff_t size1( std::vector< T, Alloc > const& t ) {
+ return t.size();
+ }
+
+};
+
+} // detail
+} // bindings
+} // numeric
+} // boost
+
+#endif

Added: sandbox/numeric_bindings/boost/numeric/bindings/ublas/matrix.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/ublas/matrix.hpp 2009-11-18 07:47:28 EST (Wed, 18 Nov 2009)
@@ -0,0 +1,43 @@
+//
+// 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_UBLAS_MATRIX_HPP
+#define BOOST_NUMERIC_BINDINGS_UBLAS_MATRIX_HPP
+
+#include <boost/numeric/bindings/detail/adaptor.hpp>
+#include <boost/numeric/bindings/detail/dense.hpp>
+#include <boost/numeric/ublas/matrix.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace detail {
+
+template< typename T, typename Alloc, typename Id, typename Enable >
+struct adaptor< boost::numeric::ublas::matrix< T, Alloc >, Id, Enable > {
+
+ // Generic information
+ typedef typename Id::value_type value_type;
+ typedef boost::mpl::int_<2> tensor_rank;
+
+ static std::ptrdiff_t size1( Id const& t ) {
+ return t.size1();
+ }
+
+ static std::ptrdiff_t size2( Id const& t ) {
+ return t.size2();
+ }
+
+};
+
+} // detail
+} // bindings
+} // numeric
+} // boost
+
+#endif

Added: sandbox/numeric_bindings/boost/numeric/bindings/ublas/vector.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings/boost/numeric/bindings/ublas/vector.hpp 2009-11-18 07:47:28 EST (Wed, 18 Nov 2009)
@@ -0,0 +1,39 @@
+//
+// 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_UBLAS_VECTOR_HPP
+#define BOOST_NUMERIC_BINDINGS_UBLAS_VECTOR_HPP
+
+#include <boost/numeric/bindings/detail/adaptor.hpp>
+#include <boost/numeric/bindings/detail/dense.hpp>
+#include <boost/numeric/ublas/vector.hpp>
+
+namespace boost {
+namespace numeric {
+namespace bindings {
+namespace detail {
+
+template< typename T, typename Alloc, typename Id, typename Enable >
+struct adaptor< boost::numeric::ublas::vector< T, Alloc >, Id, Enable > {
+
+ // Generic information
+ typedef typename Id::value_type value_type;
+ typedef boost::mpl::int_<1> tensor_rank;
+
+ static std::ptrdiff_t size1( Id const& t ) {
+ return t.size();
+ }
+
+};
+
+} // detail
+} // bindings
+} // numeric
+} // 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