Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r52340 - in sandbox/numeric_bindings-v1/boost/numeric/bindings: lapack traits traits/detail
From: thomas.klimpel_at_[hidden]
Date: 2009-04-11 17:06:32


Author: klimpel
Date: 2009-04-11 17:06:31 EDT (Sat, 11 Apr 2009)
New Revision: 52340
URL: http://svn.boost.org/trac/boost/changeset/52340

Log:
Report the ublas row_major_type banded format as column_major, because that's what it really is.

Added:
   sandbox/numeric_bindings-v1/boost/numeric/bindings/traits/detail/ublas_banded_ordering.hpp (contents, props changed)
Text files modified:
   sandbox/numeric_bindings-v1/boost/numeric/bindings/lapack/gbsv.hpp | 2
   sandbox/numeric_bindings-v1/boost/numeric/bindings/traits/detail/ublas_ordering.hpp | 41 ----------------------------------------
   sandbox/numeric_bindings-v1/boost/numeric/bindings/traits/ublas_banded.hpp | 4 +-
   3 files changed, 3 insertions(+), 44 deletions(-)

Modified: sandbox/numeric_bindings-v1/boost/numeric/bindings/lapack/gbsv.hpp
==============================================================================
--- sandbox/numeric_bindings-v1/boost/numeric/bindings/lapack/gbsv.hpp (original)
+++ sandbox/numeric_bindings-v1/boost/numeric/bindings/lapack/gbsv.hpp 2009-04-11 17:06:31 EDT (Sat, 11 Apr 2009)
@@ -62,7 +62,7 @@
>::value));
       BOOST_STATIC_ASSERT((boost::is_same<
         typename traits::matrix_traits<MatrA>::ordering_type,
- traits::row_major_t
+ traits::column_major_t
>::value));
 #endif
 

Added: sandbox/numeric_bindings-v1/boost/numeric/bindings/traits/detail/ublas_banded_ordering.hpp
==============================================================================
--- (empty file)
+++ sandbox/numeric_bindings-v1/boost/numeric/bindings/traits/detail/ublas_banded_ordering.hpp 2009-04-11 17:06:31 EDT (Sat, 11 Apr 2009)
@@ -0,0 +1,72 @@
+/*
+ *
+ * Copyright (c) Kresimir Fresl 2002
+ *
+ * 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)
+ *
+ * Author acknowledges the support of the Faculty of Civil Engineering,
+ * University of Zagreb, Croatia.
+ *
+ */
+
+#ifndef BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_UBLAS_BANDED_ORDERING_H
+#define BOOST_NUMERIC_BINDINGS_TRAITS_DETAIL_UBLAS_BANDED_ORDERING_H
+
+#include <boost/numeric/ublas/fwd.hpp>
+
+namespace boost { namespace numeric { namespace bindings { namespace traits {
+
+ namespace detail {
+
+ template <typename StOrdTag>
+ struct ublas_banded_ordering {};
+
+ template<>
+ struct ublas_banded_ordering<boost::numeric::ublas::row_major_tag> {
+ // When orientation_category==row_major_tag then the ublas banded format corresponds to
+ // the LAPACK band format, which really is a column_major format.
+ typedef column_major_t type;
+
+ template <typename M>
+ static typename M::size_type leading_dimension( M const& m ) {
+ return m.lower() + m.upper() + 1 ;
+ }
+
+ template <typename M>
+ static typename M::size_type stride1( M const& m ) {
+ return 1 ;
+ }
+
+ template <typename M>
+ static typename M::size_type stride2( M const& m ) {
+ return leading_dimension(m)-1 ;
+ }
+ };
+
+ template<>
+ struct ublas_banded_ordering<boost::numeric::ublas::column_major_tag> {
+ // The type row_major_t is just used to indicate that this is not a column_major format.
+ typedef row_major_t type;
+
+ template <typename M>
+ static typename M::size_type leading_dimension( M const& m ) {
+ return m.size2() ;
+ }
+
+ template <typename M>
+ static typename M::size_type stride1( M const& m ) {
+ return leading_dimension(m) ;
+ }
+
+ template <typename M>
+ static typename M::size_type stride2( M const& m ) {
+ return 1-leading_dimension(m) ;
+ }
+ };
+ }
+
+}}}}
+
+#endif

Modified: sandbox/numeric_bindings-v1/boost/numeric/bindings/traits/detail/ublas_ordering.hpp
==============================================================================
--- sandbox/numeric_bindings-v1/boost/numeric/bindings/traits/detail/ublas_ordering.hpp (original)
+++ sandbox/numeric_bindings-v1/boost/numeric/bindings/traits/detail/ublas_ordering.hpp 2009-04-11 17:06:31 EDT (Sat, 11 Apr 2009)
@@ -64,47 +64,6 @@
         return m.size1() ;
       }
     };
-
- template <typename StOrdTag>
- struct ublas_banded_ordering {};
-
- template<>
- struct ublas_banded_ordering<boost::numeric::ublas::row_major_tag> {
-
- template <typename M>
- static typename M::size_type leading_dimension( M const& m ) {
- return m.lower() + m.upper() + 1 ;
- }
-
- template <typename M>
- static typename M::size_type stride1( M const& m ) {
- return 1 ;
- }
-
- template <typename M>
- static typename M::size_type stride2( M const& m ) {
- return leading_dimension(m)-1 ;
- }
- };
-
- template<>
- struct ublas_banded_ordering<boost::numeric::ublas::column_major_tag> {
-
- template <typename M>
- static typename M::size_type leading_dimension( M const& m ) {
- return m.size2() ;
- }
-
- template <typename M>
- static typename M::size_type stride1( M const& m ) {
- return leading_dimension(m) ;
- }
-
- template <typename M>
- static typename M::size_type stride2( M const& m ) {
- return 1-leading_dimension(m) ;
- }
- };
   }
 
 }}}}

Modified: sandbox/numeric_bindings-v1/boost/numeric/bindings/traits/ublas_banded.hpp
==============================================================================
--- sandbox/numeric_bindings-v1/boost/numeric/bindings/traits/ublas_banded.hpp (original)
+++ sandbox/numeric_bindings-v1/boost/numeric/bindings/traits/ublas_banded.hpp 2009-04-11 17:06:31 EDT (Sat, 11 Apr 2009)
@@ -21,7 +21,7 @@
 #ifndef BOOST_UBLAS_HAVE_BINDINGS
 # include <boost/numeric/ublas/banded.hpp>
 #endif
-#include <boost/numeric/bindings/traits/detail/ublas_ordering.hpp>
+#include <boost/numeric/bindings/traits/detail/ublas_banded_ordering.hpp>
 
 #if defined (BOOST_NUMERIC_BINDINGS_FORTRAN) || !defined (BOOST_NUMERIC_BINDINGS_NO_STRUCTURE_CHECK)
 # include <boost/static_assert.hpp>
@@ -54,7 +54,7 @@
     typedef boost::numeric::ublas::banded_matrix<T, F, ArrT> identifier_type ;
     typedef M matrix_type;
     typedef banded_t matrix_structure;
- typedef typename detail::ublas_ordering<
+ typedef typename detail::ublas_banded_ordering<
       typename F::orientation_category
>::type ordering_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