|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58752 - sandbox/numeric_bindings/boost/numeric/bindings/ublas
From: rutger_at_[hidden]
Date: 2010-01-06 05:06:37
Author: rutger
Date: 2010-01-06 05:06:36 EST (Wed, 06 Jan 2010)
New Revision: 58752
URL: http://svn.boost.org/trac/boost/changeset/58752
Log:
fixed matrix_range, vector_range begin_value pointers
Text files modified:
sandbox/numeric_bindings/boost/numeric/bindings/ublas/hermitian.hpp | 16 ++++++++--------
sandbox/numeric_bindings/boost/numeric/bindings/ublas/matrix.hpp | 24 ++++++++++++------------
sandbox/numeric_bindings/boost/numeric/bindings/ublas/matrix_proxy.hpp | 8 +++++---
sandbox/numeric_bindings/boost/numeric/bindings/ublas/vector_proxy.hpp | 5 +++--
4 files changed, 28 insertions(+), 25 deletions(-)
Modified: sandbox/numeric_bindings/boost/numeric/bindings/ublas/hermitian.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/ublas/hermitian.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/ublas/hermitian.hpp 2010-01-06 05:06:36 EST (Wed, 06 Jan 2010)
@@ -37,20 +37,20 @@
mpl::pair< tag::data_order, typename convert_to< tag::data_order, F2 >::type >
> property_map;
- static std::ptrdiff_t size1( const Id& t ) {
- return t.size1();
+ static std::ptrdiff_t size1( const Id& id ) {
+ return id.size1();
}
- static std::ptrdiff_t size2( const Id& t ) {
- return t.size2();
+ static std::ptrdiff_t size2( const Id& id ) {
+ return id.size2();
}
- static value_type* begin_value( Id& t ) {
- return bindings::begin_value( t.data() );
+ static value_type* begin_value( Id& id ) {
+ return bindings::begin_value( id.data() );
}
- static value_type* end_value( Id& t ) {
- return bindings::end_value( t.data() );
+ static value_type* end_value( Id& id ) {
+ return bindings::end_value( id.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 2010-01-06 05:06:36 EST (Wed, 06 Jan 2010)
@@ -41,28 +41,28 @@
typename if_row_major< data_order, tag::contiguous, std::ptrdiff_t >::type >
> property_map;
- static std::ptrdiff_t size1( const Id& t ) {
- return t.size1();
+ static std::ptrdiff_t size1( const Id& id ) {
+ return id.size1();
}
- static std::ptrdiff_t size2( const Id& t ) {
- return t.size2();
+ static std::ptrdiff_t size2( const Id& id ) {
+ return id.size2();
}
- static value_type* begin_value( Id& t ) {
- return bindings::begin_value( t.data() );
+ static value_type* begin_value( Id& id ) {
+ return bindings::begin_value( id.data() );
}
- static value_type* end_value( Id& t ) {
- return bindings::end_value( t.data() );
+ static value_type* end_value( Id& id ) {
+ return bindings::end_value( id.data() );
}
- static std::ptrdiff_t stride1( const Id& t ) {
- return t.size2();
+ static std::ptrdiff_t stride1( const Id& id ) {
+ return id.size2();
}
- static std::ptrdiff_t stride2( const Id& t ) {
- return t.size1();
+ static std::ptrdiff_t stride2( const Id& id ) {
+ return id.size1();
}
};
Modified: sandbox/numeric_bindings/boost/numeric/bindings/ublas/matrix_proxy.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/ublas/matrix_proxy.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/ublas/matrix_proxy.hpp 2010-01-06 05:06:36 EST (Wed, 06 Jan 2010)
@@ -32,15 +32,17 @@
>::type property_map;
static std::ptrdiff_t size1( const Id& id ) {
- return bindings::size1( id.data() );
+ return id.size1();
}
static std::ptrdiff_t size2( const Id& id ) {
- return bindings::size2( id.data() );
+ return id.size2();
}
static value_type* begin_value( Id& id ) {
- return bindings::begin_value( id.data() );
+ return bindings::begin_value( id.data() ) +
+ id.start1() * stride1( id ) +
+ id.start2() * stride2( id );
}
static value_type* end_value( Id& id ) {
Modified: sandbox/numeric_bindings/boost/numeric/bindings/ublas/vector_proxy.hpp
==============================================================================
--- sandbox/numeric_bindings/boost/numeric/bindings/ublas/vector_proxy.hpp (original)
+++ sandbox/numeric_bindings/boost/numeric/bindings/ublas/vector_proxy.hpp 2010-01-06 05:06:36 EST (Wed, 06 Jan 2010)
@@ -32,11 +32,12 @@
>::type property_map;
static std::ptrdiff_t size1( const Id& id ) {
- return bindings::size1( id.data() );
+ return id.size();
}
static value_type* begin_value( Id& id ) {
- return bindings::begin_value( id.data() );
+ return bindings::begin_value( id.data() ) +
+ id.start() * stride1( id );
}
static value_type* end_value( Id& id ) {
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