Pixie
Loading...
Searching...
No Matches
pixie::MonotoneIntegerVectorBase< Impl, Value > Class Template Reference

CRTP refinement for duplicate-preserving monotone integer vectors. More...

#include <integer_vector.h>

Inheritance diagram for pixie::MonotoneIntegerVectorBase< Impl, Value >:
pixie::IntegerVectorBase< Impl, std::uint64_t > pixie::MonotoneIntegerVector< PackedIntegerVector< Value > > pixie::MonotoneIntegerVector< PackedIntegerVectorView< Value > >

Public Member Functions

size_type lower_bound_index (value_type x) const
 Return the first index whose value is greater than or equal to x.
 
size_type upper_bound_index (value_type x) const
 Return the first index whose value is greater than x.
 
bool contains (value_type x) const
 Return whether at least one element equals x.
 
size_type count (value_type x) const
 Return the number of elements equal to x.
 
- Public Member Functions inherited from pixie::IntegerVectorBase< Impl, std::uint64_t >
size_type size () const
 Return the logical number of elements.
 
bool empty () const
 Return whether the vector has no elements.
 
value_type operator[] (size_type position) const
 Read the element at zero-based position without bounds checking.
 
value_type at (size_type position) const
 Read the element at zero-based position with bounds checking.
 
void copy_to (size_type begin, std::span< value_type > output) const
 Copy a checked contiguous source range into output.
 
size_type memory_usage_bytes () const
 Return total memory owned by this vector when supported.
 

Additional Inherited Members

- Public Types inherited from pixie::IntegerVectorBase< Impl, std::uint64_t >
using value_type
 Stored integer type.
 
using size_type
 Type used for element counts and zero-based positions.
 

Detailed Description

template<class Impl, IntegerVectorValue Value = std::uint64_t>
class pixie::MonotoneIntegerVectorBase< Impl, Value >

CRTP refinement for duplicate-preserving monotone integer vectors.

Template Parameters
ImplConcrete implementation providing the integer-vector extension points plus lower_bound_index_impl() and upper_bound_index_impl().
ValueUnsigned element type other than bool, no wider than 64 bits.

Monotone means nondecreasing; equal adjacent values are retained. This contract does not prescribe representation-independent query complexity.

Member Function Documentation

◆ lower_bound_index()

template<class Impl, IntegerVectorValue Value = std::uint64_t>
size_type pixie::MonotoneIntegerVectorBase< Impl, Value >::lower_bound_index ( value_type x) const
inline

Return the first index whose value is greater than or equal to x.

Returns
An index in [0, size()]; size() means no such element exists.

◆ upper_bound_index()

template<class Impl, IntegerVectorValue Value = std::uint64_t>
size_type pixie::MonotoneIntegerVectorBase< Impl, Value >::upper_bound_index ( value_type x) const
inline

Return the first index whose value is greater than x.

Returns
An index in [0, size()]; size() means no such element exists.

The documentation for this class was generated from the following file: