2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-02-23 16:12:09 +00:00

MAJOR use boost::concept_check

FIX missing Random Access Container functions and missing operator [] in Random Access Iterator

svn path=/trunk/boost/boost/numeric/ublas/; revision=31213
This commit is contained in:
Michael Stevens
2005-10-06 19:56:35 +00:00
parent daff77ca4a
commit ee45ad5cc8
15 changed files with 1112 additions and 845 deletions

View File

@@ -411,6 +411,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return (*this) () (it1_, it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -546,6 +550,10 @@ namespace boost { namespace numeric { namespace ublas {
reference operator * () const {
return (*this) ().at_element (it1_, it2_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -686,6 +694,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return (*this) () (it1_, it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -821,6 +833,10 @@ namespace boost { namespace numeric { namespace ublas {
reference operator * () const {
return (*this) ().at_element (it1_, it2_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1363,6 +1379,10 @@ namespace boost { namespace numeric { namespace ublas {
#endif
return (*this) () (i, j);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1511,6 +1531,10 @@ namespace boost { namespace numeric { namespace ublas {
#endif
return (*this) () (i, j);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1665,6 +1689,10 @@ namespace boost { namespace numeric { namespace ublas {
#endif
return (*this) () (i, j);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1813,6 +1841,10 @@ namespace boost { namespace numeric { namespace ublas {
#endif
return (*this) () (i, j);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE

File diff suppressed because it is too large Load Diff

View File

@@ -20,10 +20,10 @@
#include <cassert>
#include <cstddef>
#include <algorithm>
#include <limits>
#include <boost/config.hpp>
#include <boost/static_assert.hpp>
#include <boost/limits.hpp>
#include <boost/noncopyable.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/and.hpp>

View File

@@ -64,22 +64,28 @@ namespace boost { namespace numeric { namespace ublas {
template<class E>
class matrix_reference;
template<class E>
template<class V>
class vector_range;
template<class E>
template<class V>
class vector_slice;
template<class E, class IA = indirect_array<> >
template<class V, class IA = indirect_array<> >
class vector_indirect;
template<class E>
template<class M>
class matrix_row;
template<class E>
template<class M>
class matrix_column;
template<class E>
template<class M>
class matrix_vector_range;
template<class M>
class matrix_vector_slice;
template<class M, class IA = indirect_array<> >
class matrix_vector_indirect;
template<class M>
class matrix_range;
template<class E>
template<class M>
class matrix_slice;
template<class E, class IA = indirect_array<> >
template<class M, class IA = indirect_array<> >
class matrix_indirect;
template<class T, class A = unbounded_array<T> >

View File

@@ -580,6 +580,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return (*this) () (it1_, it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -715,6 +719,10 @@ namespace boost { namespace numeric { namespace ublas {
reference operator * () const {
return (*this) ().at_element (it1_, it2_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -855,6 +863,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return (*this) () (it1_, it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -990,6 +1002,10 @@ namespace boost { namespace numeric { namespace ublas {
reference operator * () const {
return (*this) ().at_element (it1_, it2_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1647,6 +1663,10 @@ namespace boost { namespace numeric { namespace ublas {
return type_traits<value_type>::conj (*it2_);
}
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1812,6 +1832,10 @@ namespace boost { namespace numeric { namespace ublas {
reference operator * () const {
return *it1_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -2093,6 +2117,10 @@ namespace boost { namespace numeric { namespace ublas {
return type_traits<value_type>::conj (*it2_);
}
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -2258,6 +2286,10 @@ namespace boost { namespace numeric { namespace ublas {
reference operator * () const {
return *it2_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE

View File

@@ -386,6 +386,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -524,6 +528,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -665,6 +673,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -803,6 +815,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1336,6 +1352,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1491,6 +1511,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1649,6 +1673,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1804,6 +1832,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -2846,6 +2878,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ());
return (*this) () (index1 (), index2 ());
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -2987,6 +3023,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ());
return (*this) () (index1 (), index2 ());
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -3440,6 +3480,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -3579,6 +3623,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -3720,6 +3768,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -3858,6 +3910,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index2 () < (*this) ().size2 (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE

View File

@@ -478,6 +478,10 @@ namespace boost { namespace numeric { namespace ublas {
return functor_type::apply (*it1_, *it2_);
#endif
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -639,6 +643,10 @@ namespace boost { namespace numeric { namespace ublas {
return functor_type::apply (*it1_, *it2_);
#endif
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -934,6 +942,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return functor_type::apply (*it_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1065,6 +1077,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return functor_type::apply (*it_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1389,6 +1405,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return functor_type::apply (*it_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1520,6 +1540,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return functor_type::apply (*it_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -2005,6 +2029,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return dereference (iterator_category ());
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -2316,6 +2344,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return dereference (iterator_category ());
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -2645,6 +2677,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return functor_type::apply (it1_, *it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -2784,6 +2820,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return functor_type::apply (it1_, *it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -3070,6 +3110,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return functor_type::apply (*it1_, it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -3209,6 +3253,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return functor_type::apply (*it1_, it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -3565,6 +3613,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return dereference (iterator_category ());
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -3951,6 +4003,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return dereference (iterator_category ());
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -4379,6 +4435,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return dereference (iterator_category ());
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -4601,6 +4661,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return dereference (iterator_category ());
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE

View File

@@ -293,6 +293,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -386,6 +390,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -742,6 +750,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -835,6 +847,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -1190,6 +1206,10 @@ namespace boost { namespace numeric { namespace ublas {
// FIXME replace find with at_element
return (*this) ().data_ (*it1_, *it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -1291,6 +1311,10 @@ namespace boost { namespace numeric { namespace ublas {
// FIXME replace find with at_element
return (*this) ().data_ (*it1_, *it2_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -1647,6 +1671,10 @@ namespace boost { namespace numeric { namespace ublas {
// FIXME replace find with at_element
return (*this) ().data_ (*it1_, *it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -1748,6 +1776,10 @@ namespace boost { namespace numeric { namespace ublas {
// FIXME replace find with at_element
return (*this) ().data_ (*it1_, *it2_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -2103,6 +2135,10 @@ namespace boost { namespace numeric { namespace ublas {
// FIXME replace find with at_element
return (*this) ().data_ (*it1_, *it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -2204,6 +2240,10 @@ namespace boost { namespace numeric { namespace ublas {
// FIXME replace find with at_element
return (*this) ().data_ (*it1_, *it2_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -2596,6 +2636,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return *it_;
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -2727,6 +2771,10 @@ namespace boost { namespace numeric { namespace ublas {
reference operator * () const {
return *it_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -2863,6 +2911,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return *it_;
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -2994,6 +3046,10 @@ namespace boost { namespace numeric { namespace ublas {
reference operator * () const {
return *it_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -3492,6 +3548,10 @@ namespace boost { namespace numeric { namespace ublas {
// FIXME replace find with at_element
return (*this) ().data_ (*it1_, *it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -3627,6 +3687,10 @@ namespace boost { namespace numeric { namespace ublas {
// FIXME replace find with at_element
return (*this) ().data_ (*it1_, *it2_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -3767,6 +3831,10 @@ namespace boost { namespace numeric { namespace ublas {
// FIXME replace find with at_element
return (*this) ().data_ (*it1_, *it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -3902,6 +3970,10 @@ namespace boost { namespace numeric { namespace ublas {
// FIXME replace find with at_element
return (*this) ().data_ (*it1_, *it2_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -4410,6 +4482,10 @@ namespace boost { namespace numeric { namespace ublas {
// FIXME replace find with at_element
return (*this) ().data_ (*it1_, *it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -4545,6 +4621,10 @@ namespace boost { namespace numeric { namespace ublas {
// FIXME replace find with at_element
return (*this) ().data_ (*it1_, *it2_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -4685,6 +4765,10 @@ namespace boost { namespace numeric { namespace ublas {
// FIXME replace find with at_element
return (*this) ().data_ (*it1_, *it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -4820,6 +4904,10 @@ namespace boost { namespace numeric { namespace ublas {
// FIXME replace find with at_element
return (*this) ().data_ (*it1_, *it2_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE

View File

@@ -177,6 +177,17 @@ namespace boost { namespace numeric { namespace ublas {
resize_internal (size, init, true);
}
// Random Access Container
BOOST_UBLAS_INLINE
size_type max_size () const {
return ALLOC ().max_size();
}
BOOST_UBLAS_INLINE
bool empty () const {
return size_ == 0;
}
BOOST_UBLAS_INLINE
size_type size () const {
return size_;
@@ -335,6 +346,17 @@ namespace boost { namespace numeric { namespace ublas {
size_ = size;
}
// Random Access Container
BOOST_UBLAS_INLINE
size_type max_size () const {
return ALLOC ().max_size();
}
BOOST_UBLAS_INLINE
bool empty () const {
return size_ == 0;
}
BOOST_UBLAS_INLINE
size_type size () const {
return size_;
@@ -486,6 +508,17 @@ namespace boost { namespace numeric { namespace ublas {
data_ = data;
}
// Random Access Container
BOOST_UBLAS_INLINE
size_type max_size () const {
return std::numeric_limits<size_type>::max ();
}
BOOST_UBLAS_INLINE
bool empty () const {
return size_ == 0;
}
BOOST_UBLAS_INLINE
size_type size () const {
return size_;
@@ -614,13 +647,17 @@ namespace boost { namespace numeric { namespace ublas {
return size_;
}
// Assignment
basic_range operator=( basic_range const& r ) {
start_ = r.start_ ;
size_ = r.size_ ;
return *this ;
// Random Access Container
BOOST_UBLAS_INLINE
size_type max_size () const {
return size_;
}
BOOST_UBLAS_INLINE
bool empty () const {
return size_ == 0;
}
// Element access
BOOST_UBLAS_INLINE
const_reference operator () (size_type i) const {
@@ -708,6 +745,11 @@ namespace boost { namespace numeric { namespace ublas {
return it_;
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
size_type index () const {
@@ -819,6 +861,17 @@ namespace boost { namespace numeric { namespace ublas {
return size_;
}
// Random Access Container
BOOST_UBLAS_INLINE
size_type max_size () const {
return size_;
}
BOOST_UBLAS_INLINE
bool empty () const {
return size_ == 0;
}
// Element access
BOOST_UBLAS_INLINE
const_reference operator () (size_type i) const {
@@ -912,6 +965,11 @@ namespace boost { namespace numeric { namespace ublas {
return (*this) ().start () + it_* (*this) ().stride ();
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
size_type index () const {
@@ -1033,6 +1091,17 @@ namespace boost { namespace numeric { namespace ublas {
return data_;
}
// Random Access Container
BOOST_UBLAS_INLINE
size_type max_size () const {
return size_;
}
BOOST_UBLAS_INLINE
bool empty () const {
return data_.size () == 0;
}
// Element access
BOOST_UBLAS_INLINE
const_reference operator () (size_type i) const {
@@ -1157,6 +1226,11 @@ namespace boost { namespace numeric { namespace ublas {
return (*this) () (it_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
size_type index () const {

View File

@@ -299,6 +299,7 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (size_ <= capacity_, internal_logic ());
}
// Random Access Container
BOOST_UBLAS_INLINE
size_type size () const {
return size_;
@@ -307,7 +308,16 @@ namespace boost { namespace numeric { namespace ublas {
size_type capacity () const {
return capacity_;
}
BOOST_UBLAS_INLINE
size_type max_size () const {
return 0; //TODO
}
BOOST_UBLAS_INLINE
bool empty () const {
return size_ == 0;
}
// Element access
BOOST_UBLAS_INLINE
data_reference operator [] (key_type i) {

View File

@@ -358,6 +358,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return (*this) () (it1_, it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -492,6 +496,10 @@ namespace boost { namespace numeric { namespace ublas {
reference operator * () const {
return (*this) () (it1_, it2_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -632,6 +640,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return (*this) () (it1_, it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -767,6 +779,10 @@ namespace boost { namespace numeric { namespace ublas {
reference operator * () const {
return (*this) () (it1_, it2_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1356,6 +1372,10 @@ namespace boost { namespace numeric { namespace ublas {
return *it2_;
}
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1521,6 +1541,10 @@ namespace boost { namespace numeric { namespace ublas {
reference operator * () const {
return *it1_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1794,6 +1818,10 @@ namespace boost { namespace numeric { namespace ublas {
return *it2_;
}
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1959,6 +1987,10 @@ namespace boost { namespace numeric { namespace ublas {
reference operator * () const {
return *it2_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE

View File

@@ -347,6 +347,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return (*this) () (it1_, it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -482,6 +486,10 @@ namespace boost { namespace numeric { namespace ublas {
reference operator * () const {
return (*this) () (it1_, it2_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -622,6 +630,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return (*this) () (it1_, it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -757,6 +769,10 @@ namespace boost { namespace numeric { namespace ublas {
reference operator * () const {
return (*this) () (it1_, it2_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1200,6 +1216,10 @@ namespace boost { namespace numeric { namespace ublas {
else
return (*this) () (i, j);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1338,6 +1358,10 @@ namespace boost { namespace numeric { namespace ublas {
else
return (*this) () (i, j);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1481,6 +1505,10 @@ namespace boost { namespace numeric { namespace ublas {
else
return (*this) () (i, j);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE
@@ -1619,6 +1647,10 @@ namespace boost { namespace numeric { namespace ublas {
else
return (*this) () (i, j);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
#ifndef BOOST_UBLAS_NO_NESTED_CLASS_RELATION
BOOST_UBLAS_INLINE

View File

@@ -30,8 +30,6 @@ namespace boost { namespace numeric { namespace ublas {
class vector:
public vector_container<vector<T, A> > {
typedef T *pointer;
typedef const T *const_pointer;
typedef vector<T, A> self_type;
public:
#ifdef BOOST_UBLAS_ENABLE_PROXY_SHORTCUTS
@@ -42,6 +40,8 @@ namespace boost { namespace numeric { namespace ublas {
typedef T value_type;
typedef typename type_traits<T>::const_reference const_reference;
typedef T &reference;
typedef T *pointer;
typedef const T *const_pointer;
typedef A array_type;
typedef const vector_reference<const self_type> const_closure_type;
typedef vector_reference<self_type> closure_type;
@@ -74,6 +74,16 @@ namespace boost { namespace numeric { namespace ublas {
vector_assign<scalar_assign> (*this, ae);
}
// Random Access Container
BOOST_UBLAS_INLINE
size_type max_size () const {
return data_.max_size ();
}
BOOST_UBLAS_INLINE
bool empty () const {
return data_.size () == 0;
}
// Accessors
BOOST_UBLAS_INLINE
size_type size () const {
@@ -325,6 +335,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (it_ >= (*this) ().begin ().it_ && it_ < (*this) ().end ().it_, bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(it_ + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -422,6 +436,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (it_ >= (*this) ().begin ().it_ && it_ < (*this) ().end ().it_ , bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(it_ + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -1112,6 +1130,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (it_ < (*this) ().size (), bad_index ());
return (*this) () (index ());
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -1478,6 +1500,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (it_ >= (*this) ().begin ().it_ && it_ < (*this) ().end ().it_, bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(it_ + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -1575,6 +1601,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (it_ >= (*this) ().begin ().it_ && it_ < (*this) ().end ().it_, bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(it_ + n);
}
// Index
BOOST_UBLAS_INLINE

View File

@@ -385,6 +385,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return functor_type::apply (*it_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -822,6 +826,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return dereference (iterator_category ());
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -1085,6 +1093,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return functor_type::apply (it1_, *it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -1306,6 +1318,10 @@ namespace boost { namespace numeric { namespace ublas {
const_reference operator * () const {
return functor_type::apply (*it1_, it2_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE

View File

@@ -310,6 +310,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -403,6 +407,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ());
return *it_;
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -810,6 +818,10 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ());
return (*this) ().data_ (*it_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -904,6 +916,11 @@ namespace boost { namespace numeric { namespace ublas {
BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ());
return (*this) ().data_ (*it_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -1326,6 +1343,10 @@ return true;
BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ());
return (*this) ().data_ (*it_);
}
BOOST_UBLAS_INLINE
const_reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE
@@ -1420,6 +1441,10 @@ return true;
BOOST_UBLAS_CHECK (index () < (*this) ().size (), bad_index ());
return (*this) ().data_ (*it_);
}
BOOST_UBLAS_INLINE
reference operator [] (difference_type n) const {
return *(*this + n);
}
// Index
BOOST_UBLAS_INLINE