54 stamp = std::make_unique<gen_t[]>(
n);
55 std::fill_n(
stamp.get(),
n, 0);
83 std::fill_n(
stamp.get(),
n, 0);
90 std::fill_n(
stamp.get(),
n, 0);
Owning result for one computed scalar attribute layout and buffer.
Efficient visited-set implementation based on generation stamps.
void clearAll()
Performs an O(N) physical clear of the whole stamp buffer.
void mark(size_t idx) noexcept
Marks idx in the current generation.
bool isMarked(size_t idx) const noexcept
Returns true when idx is marked in the current generation.
void resize(size_t newN)
Resizes the stamp buffer and physically clears all marks.
uint32_t gen_t
Integer type used for individual generation stamps.
void resetAll()
Performs an O(1) logical reset by advancing the generation counter.
std::unique_ptr< gen_t[]> stamp
Stamp buffer with one entry per logical index.
gen_t generation() const noexcept
Returns the current generation counter.
GenerationStampSet(size_t n)
Creates a stamp set with n logical entries.
void unmark(size_t idx) noexcept
Removes one mark from the current logical generation.
gen_t cur
Current generation; zero is reserved for physically cleared slots.
size_t n
Number of logical entries in stamp.