Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59218 - sandbox/numeric_bindings/boost/numeric/bindings/ublas
From: rutger_at_[hidden]
Date: 2010-01-22 03:32:35


Author: rutger
Date: 2010-01-22 03:32:35 EST (Fri, 22 Jan 2010)
New Revision: 59218
URL: http://svn.boost.org/trac/boost/changeset/59218

Log:
added support for ublas bounded_vector

Text files modified:
   sandbox/numeric_bindings/boost/numeric/bindings/ublas/vector.hpp | 26 ++++++++++++++++++++++++++
   1 files changed, 26 insertions(+), 0 deletions(-)

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 2010-01-22 03:32:35 EST (Fri, 22 Jan 2010)
@@ -48,6 +48,32 @@
 };
 
 template< typename T, std::size_t N, typename Id, typename Enable >
+struct adaptor< ublas::bounded_vector< T, N >, 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& id ) {
+ return id.size();
+ }
+
+ static value_type* begin_value( Id& id ) {
+ return id.begin();
+ }
+
+ static value_type* end_value( Id& id ) {
+ return id.end();
+ }
+
+};
+
+template< typename T, std::size_t N, typename Id, typename Enable >
 struct adaptor< ublas::c_vector< T, N >, Id, Enable > {
 
     typedef typename copy_const< Id, T >::type value_type;


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