|
DOLFIN
DOLFIN C++ interface
|
#include <IndexSet.h>
Public Member Functions | |
| IndexSet (std::size_t size) | |
| Create index set of given size. | |
| ~IndexSet () | |
| Destructor. | |
| bool | empty () const |
| Return true if set is empty. | |
| std::size_t | size () const |
| Return size of set. | |
| bool | has_index (std::size_t index) const |
| Check whether index is in set. | |
| std::size_t | find (std::size_t index) const |
| Return position (if any) for given index. | |
| std::size_t & | operator[] (std::size_t i) |
| Return given index. | |
| const std::size_t & | operator[] (std::size_t i) const |
| Return given index (const version) | |
| void | insert (std::size_t index) |
| Insert index into set. | |
| void | fill () |
| Fill index set with indices 0, 1, 2, ..., size - 1. | |
| void | clear () |
| Clear set. | |
This class provides an efficient data structure for index sets. The cost of checking whether a given index is in the set is O(1) and very very fast (optimal) at the cost of extra storage.
1.8.11