template<size_t BOUND, AllocType AT = MALLOC>
class sux::util::FenwickFixedL< BOUND, AT >
A standard (fixed-size) Fenwick tree in level-order layout.
- Template Parameters
-
BOUND | maximum representable value (at most the maximum value of a uint64_t ). |
AT | a type of memory allocation out of AllocType. |
template<size_t BOUND, AllocType AT = MALLOC>
Search the length of the longest prefix whose complemented sum is less than or equal to a given bound.
- Parameters
-
val | bound for the complemented prefix sum. |
If val
is an l-value reference its value will be replaced with the excess, that is, the difference between val
and the complemented longest prefix sum described above.
This method returns zero if there are no prefixes whose complemented sum is greater or equal to val
.
Implements sux::util::SearchablePrefixSums.
template<size_t BOUND, AllocType AT = MALLOC>
virtual size_t sux::util::SearchablePrefixSums::compFind |
Search the length of the longest prefix whose complemented sum is less than or equal to a given bound.
- Parameters
-
val | bound for the complemented prefix sum. |
If val
is an l-value reference its value will be replaced with the excess, that is, the difference between val
and the complemented longest prefix sum described above.
This method returns zero if there are no prefixes whose complemented sum is greater or equal to val
.
template<size_t BOUND, AllocType AT = MALLOC>
Search the length of the longest prefix whose sum is less than or equal to a given bound.
- Parameters
-
val | bound for the prefix sum. |
If val
is an l-value reference its value will be replaced with the excess, that is, the difference between val
and the longest prefix sum described above.
This method returns zero if there are no prefixes whose sum is greater or equal to val
.
Implements sux::util::SearchablePrefixSums.
template<size_t BOUND, AllocType AT = MALLOC>
virtual size_t sux::util::SearchablePrefixSums::find |
Search the length of the longest prefix whose sum is less than or equal to a given bound.
- Parameters
-
val | bound for the prefix sum. |
If val
is an l-value reference its value will be replaced with the excess, that is, the difference between val
and the longest prefix sum described above.
This method returns zero if there are no prefixes whose sum is greater or equal to val
.
template<size_t BOUND, AllocType AT = MALLOC>
Enlarges this expandable so that it can contain a given number of elements, plus possibly extra space.
If the current capacity is sufficient, nothing happens. Otherwise, the expandable is enlarged, usually to the maximum between the provided capacity and 50% more than the current capacity.
- Parameters
-
capacity | the desired new capacity. |
Implements sux::util::Expandable.
template<size_t BOUND, AllocType AT = MALLOC>
Enlarges this expandable so that it can contain a given number of elements without memory reallocation.
If the current capacity is sufficient, nothing happens. Otherwise, the expandable is enlarged to the provided capacity.
- Parameters
-
capacity | the desired new capacity. |
Implements sux::util::Expandable.
template<size_t BOUND, AllocType AT = MALLOC>
Changes the expandable size to the given value.
If the argument is smaller than or equal to the current size, there is no memory reallocation. Otherwise, reallocation happens with grow().
- Parameters
-
size | the desired new size. |
Implements sux::util::Expandable.