From 98f731355748df085572bb6105ddf1e155d78b71 Mon Sep 17 00:00:00 2001 From: Gunter Winkler Date: Fri, 13 Mar 2009 21:07:16 +0000 Subject: [PATCH] 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 svn path=/trunk/boost/numeric/ublas/; revision=51764 --- include/boost/numeric/ublas/functional.hpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/include/boost/numeric/ublas/functional.hpp b/include/boost/numeric/ublas/functional.hpp index 2d420d41..6f02b845 100644 --- a/include/boost/numeric/ublas/functional.hpp +++ b/include/boost/numeric/ublas/functional.hpp @@ -1343,6 +1343,9 @@ namespace boost { namespace numeric { namespace ublas { } }; + // forward declaration + template struct basic_column_major; + // This functor defines storage layout and it's properties // matrix (i,j) -> storage [i * size_i + j] template @@ -1350,6 +1353,7 @@ namespace boost { namespace numeric { namespace ublas { typedef Z size_type; typedef D difference_type; typedef row_major_tag orientation_category; + typedef basic_column_major transposed_layout; static BOOST_UBLAS_INLINE @@ -1527,6 +1531,7 @@ namespace boost { namespace numeric { namespace ublas { typedef Z size_type; typedef D difference_type; typedef column_major_tag orientation_category; + typedef basic_row_major transposed_layout; static BOOST_UBLAS_INLINE @@ -1776,7 +1781,7 @@ namespace boost { namespace numeric { namespace ublas { 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 @@ namespace boost { namespace numeric { namespace ublas { template struct basic_lower { typedef Z size_type; + typedef lower_tag triangular_type; template static @@ -1912,6 +1918,7 @@ namespace boost { namespace numeric { namespace ublas { template struct basic_unit_lower : public basic_lower { typedef Z size_type; + typedef unit_lower_tag triangular_type; template static @@ -1971,6 +1978,7 @@ namespace boost { namespace numeric { namespace ublas { template struct basic_strict_lower : public basic_unit_lower { typedef Z size_type; + typedef strict_lower_tag triangular_type; template static @@ -2033,15 +2041,21 @@ namespace boost { namespace numeric { namespace ublas { template struct basic_upper : public detail::transposed_structure > - { }; + { + typedef upper_tag triangular_type; + }; template struct basic_unit_upper : public detail::transposed_structure > - { }; + { + typedef unit_upper_tag triangular_type; + }; template struct basic_strict_upper : public detail::transposed_structure > - { }; + { + typedef strict_upper_tag triangular_type; + }; }}}