Handle for inserting indices into the current index set of a SequencedSparseIndexRangeBuilder.
More...
#include <dune/istl/experimental/sparseindexranges.hh>
template<class A = std::allocator<void>>
class Dune::Experimental::SequencedSparseIndexRangeBuilder< A >::IndexRangeBuilder
Handle for inserting indices into the current index set of a SequencedSparseIndexRangeBuilder.
Obtained from SequencedSparseIndexRangeBuilder::begin(). Use operator++() to commit the current index set and advance to the next one. The iterator pattern enables driving the builder via a range-based for loop.
Advancing past the last index set marks the builder as finished, enabling detection via comparison with EndSentinel{}. After finishing, construct a SparseIndexRanges or CompressedSparseIndexRanges using their constructors. The IndexRangeBuilder must not be used after the enclosing SequencedSparseIndexRangeBuilder is destroyed.
◆ IndexRangeBuilder() [1/2]
template<class A = std::allocator<void>>
◆ IndexRangeBuilder() [2/2]
◆ ~IndexRangeBuilder()
template<class A = std::allocator<void>>
◆ contains()
Returns true if index j has already been inserted into the current index set.
◆ index()
Returns the zero-based number of the index set currently being filled.
◆ insert()
Insert index j into the current index set. Duplicate insertions are silently ignored.
◆ operator*()
Dereference — returns a reference to this IndexRangeBuilder itself (enables range-for).
◆ operator++()
Commit the current index set and advance to the next one. After advancing past the last set, comparing with EndSentinel{} returns true.
◆ operator=() [1/2]
template<class A = std::allocator<void>>
◆ operator=() [2/2]
◆ overrideIndices()
template<class A >
template<std::forward_iterator It, std::sentinel_for< It > End>
Replace the current index set with the indices in [begin, end).
This overwrites any indices previously inserted into the current index set. The provided range is copied into the active storage of the current row and the remainder of that row buffer is reset to the invalid sentinel value, so old entries do not remain observable through contains(), lower_bound(), or later compression.
If the current row buffer is too small, it is grown before the new indices are copied. When do_sort is true, the copied prefix is sorted in ascending order. When do_unique is true, duplicate values are removed from that sorted prefix. The final logical size of the current row is the size after optional sorting and deduplication.
- Parameters
-
| begin | Iterator to the first replacement index. |
| end | Sentinel one past the last replacement index. |
| do_sort | Whether to sort the copied indices before storing them. |
| do_unique | Whether to remove duplicate indices after the optional sort. This assumes equal elements become adjacent. |
◆ size()
Returns the number of distinct indices inserted into the current index set so far.
◆ operator==
template<class A = std::allocator<void>>
Returns true when all index sets have been filled (used to detect the end sentinel).
◆ SequencedSparseIndexRangeBuilder
template<class A = std::allocator<void>>
The documentation for this class was generated from the following file: