SDSL 3.0.3
Succinct Data Structure Library
Loading...
Searching...
No Matches
sdsl::sorted_multi_stack_support Class Reference

Stack which contains elements from [0..n] in sorted order. Duplicates are possible. More...

#include <sorted_multi_stack_support.hpp>

Public Types

typedef int_vector< 64 >::size_type size_type

Public Member Functions

 sorted_multi_stack_support (size_type n)
 Constructor.
 sorted_multi_stack_support (sorted_multi_stack_support const &)=default
 sorted_multi_stack_support (sorted_multi_stack_support &&)=default
sorted_multi_stack_supportoperator= (sorted_multi_stack_support const &)=default
sorted_multi_stack_supportoperator= (sorted_multi_stack_support &&)=default
bool empty () const
 Returns if the stack is empty.
size_type top () const
 Returns the topmost index on the stack.
bool pop ()
 Pop the topmost index of the stack.
bool push (size_type x)
 Push the index x of vector vec onto the stack.
size_type size () const
 Returns the number of element is the stack.
size_type serialize (std::ostream &out, structure_tree_node *v=nullptr, std::string name="") const
void load (std::istream &in)
template<typename archive_t>
void CEREAL_SAVE_FUNCTION_NAME (archive_t &ar) const
template<typename archive_t>
void CEREAL_LOAD_FUNCTION_NAME (archive_t &ar)

Detailed Description

Stack which contains elements from [0..n] in sorted order. Duplicates are possible.

Space complexity
$2n$ bits

Definition at line 31 of file sorted_multi_stack_support.hpp.

Member Typedef Documentation

◆ size_type

Constructor & Destructor Documentation

◆ sorted_multi_stack_support() [1/3]

sdsl::sorted_multi_stack_support::sorted_multi_stack_support ( size_type n)
inline

Constructor.

Parameters
nMaximum that can be pushed onto the stack

Definition at line 102 of file sorted_multi_stack_support.hpp.

◆ sorted_multi_stack_support() [2/3]

sdsl::sorted_multi_stack_support::sorted_multi_stack_support ( sorted_multi_stack_support const & )
default

◆ sorted_multi_stack_support() [3/3]

sdsl::sorted_multi_stack_support::sorted_multi_stack_support ( sorted_multi_stack_support && )
default

Member Function Documentation

◆ CEREAL_LOAD_FUNCTION_NAME()

template<typename archive_t>
void sdsl::sorted_multi_stack_support::CEREAL_LOAD_FUNCTION_NAME ( archive_t & ar)

Definition at line 221 of file sorted_multi_stack_support.hpp.

◆ CEREAL_SAVE_FUNCTION_NAME()

template<typename archive_t>
void sdsl::sorted_multi_stack_support::CEREAL_SAVE_FUNCTION_NAME ( archive_t & ar) const

Definition at line 211 of file sorted_multi_stack_support.hpp.

◆ empty()

bool sdsl::sorted_multi_stack_support::empty ( ) const
inline

Returns if the stack is empty.

Definition at line 64 of file sorted_multi_stack_support.hpp.

◆ load()

void sdsl::sorted_multi_stack_support::load ( std::istream & in)
inline

Definition at line 201 of file sorted_multi_stack_support.hpp.

◆ operator=() [1/2]

sorted_multi_stack_support & sdsl::sorted_multi_stack_support::operator= ( sorted_multi_stack_support && )
default

◆ operator=() [2/2]

sorted_multi_stack_support & sdsl::sorted_multi_stack_support::operator= ( sorted_multi_stack_support const & )
default

◆ pop()

bool sdsl::sorted_multi_stack_support::pop ( )
inline

Pop the topmost index of the stack.

Returns
True if there the value of the top element after the execution of pop() is not equal to the value of the top element before the execution of pop(). False otherwise.

Definition at line 145 of file sorted_multi_stack_support.hpp.

◆ push()

bool sdsl::sorted_multi_stack_support::push ( size_type x)
inline

Push the index x of vector vec onto the stack.

x value which should be pushed onto the stack.
Returns
True if the value on the top of the stack is smaller than x. False if the value is equal.
Precondition
top() <= x

Definition at line 119 of file sorted_multi_stack_support.hpp.

◆ serialize()

sorted_multi_stack_support::size_type sdsl::sorted_multi_stack_support::serialize ( std::ostream & out,
structure_tree_node * v = nullptr,
std::string name = "" ) const
inline

Definition at line 188 of file sorted_multi_stack_support.hpp.

◆ size()

size_type sdsl::sorted_multi_stack_support::size ( ) const
inline

Returns the number of element is the stack.

Definition at line 89 of file sorted_multi_stack_support.hpp.

◆ top()

sorted_multi_stack_support::size_type sdsl::sorted_multi_stack_support::top ( ) const
inline

Returns the topmost index on the stack.

Precondition
empty()==false

Definition at line 114 of file sorted_multi_stack_support.hpp.


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