diff --git a/include/boost/numeric/ublas/hermitian.hpp b/include/boost/numeric/ublas/hermitian.hpp index 7104d557..b6001e9a 100644 --- a/include/boost/numeric/ublas/hermitian.hpp +++ b/include/boost/numeric/ublas/hermitian.hpp @@ -498,7 +498,9 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_INLINE iterator1 find1 (int rank, size_type i, size_type j) { if (rank == 1) - i = triangular_type::mutable_restrict1 (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, i, j); } BOOST_UBLAS_INLINE @@ -508,7 +510,9 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_INLINE iterator2 find2 (int rank, size_type i, size_type j) { if (rank == 1) - j = triangular_type::mutable_restrict2 (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, i, j); } @@ -1416,7 +1420,9 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_INLINE iterator1 find1 (int rank, size_type i, size_type j) { if (rank == 1) - i = triangular_type::mutable_restrict1 (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 @@ -1446,7 +1452,9 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_INLINE iterator2 find2 (int rank, size_type i, size_type j) { if (rank == 1) - j = triangular_type::mutable_restrict2 (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)); } diff --git a/include/boost/numeric/ublas/symmetric.hpp b/include/boost/numeric/ublas/symmetric.hpp index 0ebbe639..8aede25a 100644 --- a/include/boost/numeric/ublas/symmetric.hpp +++ b/include/boost/numeric/ublas/symmetric.hpp @@ -281,7 +281,9 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_INLINE iterator1 find1 (int rank, size_type i, size_type j) { if (rank == 1) - i = triangular_type::mutable_restrict1 (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, i, j); } BOOST_UBLAS_INLINE @@ -291,7 +293,9 @@ namespace boost { namespace numeric { namespace ublas { BOOST_UBLAS_INLINE iterator2 find2 (int rank, size_type i, size_type j) { if (rank == 1) - j = triangular_type::mutable_restrict2 (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, i, j); }