Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51764 - trunk/boost/numeric/ublas
From: guwi17_at_[hidden]
Date: 2009-03-13 17:07:16


Author: guwi17
Date: 2009-03-13 17:07:16 EDT (Fri, 13 Mar 2009)
New Revision: 51764
URL: http://svn.boost.org/trac/boost/changeset/51764

Log:
functional.hpp:
* added triangular_type definitions
* added transposed_layout to basic_row_major and basic_column_major
* fix #2800 : transposed_structure has to switch row major and column major

Text files modified:
   trunk/boost/numeric/ublas/functional.hpp | 22 ++++++++++++++++++----
   1 files changed, 18 insertions(+), 4 deletions(-)

Modified: trunk/boost/numeric/ublas/functional.hpp
==============================================================================
--- trunk/boost/numeric/ublas/functional.hpp (original)
+++ trunk/boost/numeric/ublas/functional.hpp 2009-03-13 17:07:16 EDT (Fri, 13 Mar 2009)
@@ -1343,6 +1343,9 @@
         }
     };
 
+ // forward declaration
+ template <class Z, class D> struct basic_column_major;
+
     // This functor defines storage layout and it's properties
     // matrix (i,j) -> storage [i * size_i + j]
     template <class Z, class D>
@@ -1350,6 +1353,7 @@
         typedef Z size_type;
         typedef D difference_type;
         typedef row_major_tag orientation_category;
+ typedef basic_column_major<Z,D> transposed_layout;
 
         static
         BOOST_UBLAS_INLINE
@@ -1527,6 +1531,7 @@
         typedef Z size_type;
         typedef D difference_type;
         typedef column_major_tag orientation_category;
+ typedef basic_row_major<Z,D> transposed_layout;
 
         static
         BOOST_UBLAS_INLINE
@@ -1776,7 +1781,7 @@
             static
             BOOST_UBLAS_INLINE
             size_type element (LAYOUT l, size_type i, size_type size_i, size_type j, size_type size_j) {
- return L::element(l, j, size_j, i, size_i);
+ return L::element(typename LAYOUT::transposed_layout(), j, size_j, i, size_i);
             }
 
             static
@@ -1826,6 +1831,7 @@
     template <class Z>
     struct basic_lower {
         typedef Z size_type;
+ typedef lower_tag triangular_type;
 
         template<class L>
         static
@@ -1912,6 +1918,7 @@
     template <class Z>
     struct basic_unit_lower : public basic_lower<Z> {
         typedef Z size_type;
+ typedef unit_lower_tag triangular_type;
 
         template<class L>
         static
@@ -1971,6 +1978,7 @@
     template <class Z>
     struct basic_strict_lower : public basic_unit_lower<Z> {
         typedef Z size_type;
+ typedef strict_lower_tag triangular_type;
 
         template<class L>
         static
@@ -2033,15 +2041,21 @@
 
     template <class Z>
     struct basic_upper : public detail::transposed_structure<basic_lower<Z> >
- { };
+ {
+ typedef upper_tag triangular_type;
+ };
 
     template <class Z>
     struct basic_unit_upper : public detail::transposed_structure<basic_unit_lower<Z> >
- { };
+ {
+ typedef unit_upper_tag triangular_type;
+ };
 
     template <class Z>
     struct basic_strict_upper : public detail::transposed_structure<basic_strict_lower<Z> >
- { };
+ {
+ typedef strict_upper_tag triangular_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