Logo MTL4

mtl::irange Class Reference

Class to define a half open index ranges. More...

#include <irange.hpp>

List of all members.

Public Member Functions

 irange (size_type start, size_type finish)
 Create an index range of [start, finish).
 irange (size_type finish)
 Create an index range of [0, finish).
 irange ()
 Create an index range of [0, imax), i.e. all indices.
irangeset (size_type start, size_type finish)
 Set the index range to [start, finish).
irangeset (size_type finish)
 Set the index range of [0, finish).
irangeoperator-- ()
 Decrease finish, i.e. [start, finish) -> [start, finish-1).
size_type start () const
 First index in range.
size_type finish () const
 Past-end index in range.
size_type size () const
 Number of indices.
bool empty () const
 Whether the range is empty.
size_type to_range (size_type i) const
 Maps integers [0, size()) to [start(), finish()).
size_type from_range (size_type i) const
 Maps integers [start(), finish()) to [0, size()).


Detailed Description

Class to define a half open index ranges.

Member Function Documentation

size_type mtl::irange::from_range ( size_type  i  )  const [inline]

Maps integers [start(), finish()) to [0, size()).

Checks index in debug mode.

size_type mtl::irange::to_range ( size_type  i  )  const [inline]

Maps integers [0, size()) to [start(), finish()).

Checks index in debug mode. Inverse of from_range.


The documentation for this class was generated from the following file:


mtl::irange Class Reference -- MTL 4 -- Peter Gottschling and Andrew Lumsdaine -- Gen. with rev. 7542 on 7 Apr 2011 by doxygen 1.5.9 -- © 2010 by SimuNova UG.