1 Range<SizeType,DistanceType>
1.1 Description
The class range
specifies a range of indicies. The range is a sequence of indices from a start value to stop value. The indices increase by one and exlude the stop value.range
can therefore be used to specify ranges of elements from vectors and matrices.
1.2 Example
#include <boost/numeric/ublas/storage.hpp> //range可以确定一组下标的范围,其步长为1,没有办法人为改变。 int main () { using namespace boost::numeric::ublas; range r (0, 3); for (unsigned i = 0; i < r.size (); ++ i) { std::cout << r (i) << std::endl; } }
1.3 Definition
Defined in the header storage.hpp.
1.4 Model of
Reversible Container.
1.5 Type requirements
None, except for those imposed by the requirements of ReversibleContainer.
1.6 Public base classes
None.
1.7 Members
Member | Description |
---|---|
range (size_type start, size_type sto |