The class Inverse_index<IC> constructs an inverse index for a given range [) of two iterators or circulators of type IC. The first element in the range [) has the index 0. Consecutive elements are numbered incrementally. The inverse index provides a query for a given iterator or circulator to retrieve its index number. Precondition: The iterator or circulator must be either of the random access category or the dereference operator must return stable and distinguishable addresses for the values, e.g. proxies or non-modifiable iterator with opaque values will not work.
#include <CGAL/Inverse_index.h>
| |
invalid index.
| |
| |
empty inverse index initialized to start at .
| |
| |
inverse index initialized with range [).
|
|
|
returns inverse index of . Precondition: has been stored in the inverse index. |
|
| |
adds at the end of the indices. |
For random access iterators or circulators, it is done in constant time by subtracting . For other iterator categories, an STL map is used, which results in a log query time. The comparisons are done using the operator operator< on pointers.
Random_access_adaptor and Random_access_value_adaptor.