2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-22 15:52:18 +00:00

- fix and close #2275

- added missing changes of triangular_adaptor (see rev. 48466)
- fixed order of arguments in functional basic_strict_lower::global_restrict1(...)
This commit is contained in:
Gunter Winkler
2008-09-01 21:32:55 +00:00
parent 395cb9b743
commit b0e109cdeb
2 changed files with 18 additions and 10 deletions

View File

@@ -2020,13 +2020,13 @@ namespace boost { namespace numeric { namespace ublas {
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);
}
};

View File

@@ -1153,26 +1153,34 @@ namespace boost { namespace numeric { namespace ublas {
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.