gatb.core-API-0.0.0
dag_vector Class Reference

#include <dag_vector.hpp>

Public Member Functions

 dag_vector ()
 
 ~dag_vector ()
 
void push_back (uint64_t val)
 
uint64_t operator[] (uint64_t ind) const
 
uint64_t prefix_sum (uint64_t ind) const
 
std::pair< uint64_t, uint64_t > prefix_sum_val (uint64_t ind) const
 
uint64_t size () const
 
uint64_t sum () const
 
void swap (dag_vector &dagv)
 
void clear ()
 
uint64_t get_alloc_byte_num () const
 

Detailed Description

Direct Accessible Gamma code Vector

Constructor & Destructor Documentation

dag_vector ( )
inline

Constructor

~dag_vector ( )
inline

Destructor

Member Function Documentation

void clear ( )
inline

Clear the content

uint64_t get_alloc_byte_num ( ) const
inline

Get the number of allocated bytes

uint64_t operator[] ( uint64_t  ind) const
inline

Lookup the ind-th element

Parameters
indthe index
Returns
the ind-th element
uint64_t prefix_sum ( uint64_t  ind) const
inline

Compute the prefix sum: the sum of [0...ind-1] values. O(log max_val) time.

Parameters
indthe index
Returns
the sum of v[0] v[1] ... v[ind-1]
std::pair<uint64_t, uint64_t> prefix_sum_val ( uint64_t  ind) const
inline

Compute the prefix sum and the value in O(log max_val) time.

Parameters
indthe index
Returns
the pair of the prefix sum (sum of v[0] v[1] ... v[ind-1]) and v[ind]
void push_back ( uint64_t  val)
inline

Add element in a gamma code

Parameters
valan element to be added
uint64_t size ( ) const
inline

Return the number of elements

Returns
the number of elements
uint64_t sum ( ) const
inline

Return the sum of values

Returns
the sum of values
void swap ( dag_vector dagv)
inline

Swap the content

Parameters
dagvthe dag_vector to be swapped

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