Boost logo

Boost-Commit :

From: guwi17_at_[hidden]
Date: 2008-09-01 17:32:55


Author: guwi17
Date: 2008-09-01 17:32:55 EDT (Mon, 01 Sep 2008)
New Revision: 48523
URL: http://svn.boost.org/trac/boost/changeset/48523

Log:
- fix and close #2275
- added missing changes of triangular_adaptor (see rev. 48466)
- fixed order of arguments in functional basic_strict_lower::global_restrict1(...)

Text files modified:
   trunk/boost/numeric/ublas/functional.hpp | 4 ++--
   trunk/boost/numeric/ublas/triangular.hpp | 24 ++++++++++++++++--------
   2 files changed, 18 insertions(+), 10 deletions(-)

Modified: trunk/boost/numeric/ublas/functional.hpp
==============================================================================
--- trunk/boost/numeric/ublas/functional.hpp (original)
+++ trunk/boost/numeric/ublas/functional.hpp 2008-09-01 17:32:55 EDT (Mon, 01 Sep 2008)
@@ -2020,13 +2020,13 @@
         static
         BOOST_UBLAS_INLINE
         size_type global_restrict1 (size_type index1, size_type size1, size_type index2, size_type size2) {
- return global_mutable_restrict1(index1, index2, size1, size2);
+ return global_mutable_restrict1(index1, size1, index2, size2);
         }
         // return an index between the first and (1+last) filled column
         static
         BOOST_UBLAS_INLINE
         size_type global_restrict2 (size_type index1, size_type size1, size_type index2, size_type size2) {
- return global_mutable_restrict2(index1, index2, size1, size2);
+ return global_mutable_restrict2(index1, size1, index2, size2);
         }
     };
 

Modified: trunk/boost/numeric/ublas/triangular.hpp
==============================================================================
--- trunk/boost/numeric/ublas/triangular.hpp (original)
+++ trunk/boost/numeric/ublas/triangular.hpp 2008-09-01 17:32:55 EDT (Mon, 01 Sep 2008)
@@ -1153,26 +1153,34 @@
         BOOST_UBLAS_INLINE
         const_iterator1 find1 (int rank, size_type i, size_type j) const {
             if (rank == 1)
- i = triangular_type::restrict1 (i, j);
- return const_iterator1 (*this, data ().find1 (rank, i, j));
+ i = triangular_type::restrict1 (i, j, size1(), size2());
+ if (rank == 0)
+ i = triangular_type::global_restrict1 (i, size1(), j, size2());
+ return const_iterator1 (*this, data ().find1 (rank, i, j));
         }
         BOOST_UBLAS_INLINE
         iterator1 find1 (int rank, size_type i, size_type j) {
             if (rank == 1)
- i = triangular_type::mutable_restrict1 (i, j);
- return iterator1 (*this, data ().find1 (rank, i, j));
+ i = triangular_type::mutable_restrict1 (i, j, size1(), size2());
+ if (rank == 0)
+ i = triangular_type::global_mutable_restrict1 (i, size1(), j, size2());
+ return iterator1 (*this, data ().find1 (rank, i, j));
         }
         BOOST_UBLAS_INLINE
         const_iterator2 find2 (int rank, size_type i, size_type j) const {
             if (rank == 1)
- j = triangular_type::restrict2 (i, j);
- return const_iterator2 (*this, data ().find2 (rank, i, j));
+ j = triangular_type::restrict2 (i, j, size1(), size2());
+ if (rank == 0)
+ j = triangular_type::global_restrict2 (i, size1(), j, size2());
+ return const_iterator2 (*this, data ().find2 (rank, i, j));
         }
         BOOST_UBLAS_INLINE
         iterator2 find2 (int rank, size_type i, size_type j) {
             if (rank == 1)
- j = triangular_type::mutable_restrict2 (i, j);
- return iterator2 (*this, data ().find2 (rank, i, j));
+ j = triangular_type::mutable_restrict2 (i, j, size1(), size2());
+ if (rank == 0)
+ j = triangular_type::global_mutable_restrict2 (i, size1(), j, size2());
+ return iterator2 (*this, data ().find2 (rank, i, j));
         }
 
         // Iterators simply are indices.


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