IndexSet

class dolfin.cpp.common.IndexSet

Bases: object

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.

Create index set of given size.

Parameters:size (std::size_t) –
clear()

Clear set.

Return type:void
empty()

Return true if set is empty.

Return type:bool
fill()

Fill index set with indices 0, 1, 2, …, size - 1.

Return type:void
find()

Return position (if any) for given index.

Parameters:index (std::size_t) –
Return type:std::size_t
has_index()

Check whether index is in set.

Parameters:index (std::size_t) –
Return type:bool
insert()

Insert index into set.

Parameters:index (std::size_t) –
Return type:void
size()

Return size of set.

Return type:std::size_t
thisown

The membership flag