SDSL: Succinct Data Structure Library
A C++ template library for succinct data structures
 All Classes Namespaces Files Functions Variables Typedefs Friends
Classes | Public Types | Public Member Functions | Static Public Member Functions
sdsl::lcp_dac< b, rank_support_type > Class Template Reference

A class for the compressed version of lcp information of an suffix array. More...

#include <lcp_dac.hpp>

List of all members.

Classes

class  type

Public Types

enum  { fast_access = 0, text_order = 0, sa_order = 1 }
typedef int_vector::value_type value_type
typedef
random_access_const_iterator
< lcp_dac
const_iterator
typedef const_iterator iterator
typedef const value_type const_reference
typedef const_reference reference
typedef const_reference * pointer
typedef const pointer const_pointer
typedef int_vector::size_type size_type
typedef ptrdiff_t difference_type
typedef lcp_plain_tag lcp_category

Public Member Functions

 lcp_dac ()
 Default Constructor.
 ~lcp_dac ()
 Default Destructor.
 lcp_dac (const lcp_dac &lcp_c)
 Copy constructor.
template<uint8_t int_width, class size_type_class >
 lcp_dac (int_vector_file_buffer< int_width, size_type_class > &lcp_buf)
 Construct the lcp array from an int_vector_file_buffer.
template<uint8_t int_width, class size_type_class >
void construct (int_vector_file_buffer< int_width, size_type_class > &lcp_buf)
size_type size () const
 Number of elements in the instance.
bool empty () const
 Returns if the data strucutre is empty.
void swap (lcp_dac &lcp_c)
 Swap method for lcp_dac.
const_iterator begin () const
 Returns a const_iterator to the first element.
const_iterator end () const
 Returns a const_iterator to the element after the last element.
value_type operator[] (size_type i) const
 []-operator
lcp_dacoperator= (const lcp_dac &lcp_c)
 Assignment Operator.
bool operator== (const lcp_dac &lcp_c) const
 Equality Operator.
bool operator!= (const lcp_dac &lcp_c) const
 Unequality Operator.
size_type serialize (std::ostream &out, structure_tree_node *v=NULL, std::string name="") const
 Serialize to a stream.
void load (std::istream &in)
 Load from a stream.

Static Public Member Functions

static size_type max_size ()
 Returns the largest size that lcp_dac can ever have.

Detailed Description

template<uint8_t b = 4, class rank_support_type = rank_support_v5<>>
class sdsl::lcp_dac< b, rank_support_type >

A class for the compressed version of lcp information of an suffix array.

We use a technique called ,,escaping'' to encode the values. This is defined as follows (see [1]): A k-bit integer is split into $K=\lceil k/(b-1)\rceil$ bits each and encoded into $K$ blocks of $ b $ bits each. All but the last block are marked with by a 1 in the most significant bit. Escaping with b=8 is also known as vbyte-coding (see [2]). A experimental study of using escaping for the LCP array is given in [3].

Time complexity
  • $\Order{\log n/b}$ worst case, where b is the number of bits in a block
References
[1] F. Transier and P. Sanders: ,,Engineering Basic Search Algorithms of an In-Memory Text Search Engine'', ACM Transactions on Information Systems, Vol. 29, No.1, Article 2, 2010 [2] H.E. Williams and J. Zobel: ,,Compressing integers for fast file access'', Computing Journal Vol 43, No.3, 1999 [3] N. Brisboa, S. Ladra, G. Navarro: ,,Directly addressable variable- length codes'', Proceedings of SPIRE 2009.

Member Function Documentation

template<uint8_t b, class rank_support_type >
lcp_dac< b, rank_support_type >::const_iterator sdsl::lcp_dac< b, rank_support_type >::begin ( ) const

Returns a const_iterator to the first element.

Required for the STL Container Concept.

See also:
end
template<uint8_t b = 4, class rank_support_type = rank_support_v5<>>
bool sdsl::lcp_dac< b, rank_support_type >::empty ( ) const [inline]

Returns if the data strucutre is empty.

Required for the Container Concept of the STL.A

See also:
size
template<uint8_t b, class rank_support_type >
lcp_dac< b, rank_support_type >::const_iterator sdsl::lcp_dac< b, rank_support_type >::end ( ) const

Returns a const_iterator to the element after the last element.

Required for the STL Container Concept.

See also:
begin.
template<uint8_t b, class rank_support_type >
void sdsl::lcp_dac< b, rank_support_type >::load ( std::istream &  in)

Load from a stream.

Parameters:
inInputstream to load the data structure from.
template<uint8_t b = 4, class rank_support_type = rank_support_v5<>>
static size_type sdsl::lcp_dac< b, rank_support_type >::max_size ( ) [inline, static]

Returns the largest size that lcp_dac can ever have.

Required for the Container Concept of the STL.

See also:
size
template<uint8_t b, class rank_support_type >
bool sdsl::lcp_dac< b, rank_support_type >::operator!= ( const lcp_dac< b, rank_support_type > &  lcp_c) const

Unequality Operator.

Two Instances of lcp_dac are equal if not all their members are equal.

Required for the Equality Comparable Concept of the STL.
See also:
operator==
template<uint8_t b, class rank_support_type >
lcp_dac< b, rank_support_type > & sdsl::lcp_dac< b, rank_support_type >::operator= ( const lcp_dac< b, rank_support_type > &  lcp_c)

Assignment Operator.

Required for the Assignable Concept of the STL.

template<uint8_t b, class rank_support_type >
bool sdsl::lcp_dac< b, rank_support_type >::operator== ( const lcp_dac< b, rank_support_type > &  lcp_c) const

Equality Operator.

Two Instances of lcp_dac are equal if all their members are equal.

Required for the Equality Comparable Concept of the STL.
See also:
operator!=
template<uint8_t b, class rank_support_type >
lcp_dac< b, rank_support_type >::value_type sdsl::lcp_dac< b, rank_support_type >::operator[] ( size_type  i) const [inline]

[]-operator

Parameters:
iIndex of the value. $ i \in [0..size()-1]$. Time complexity: O(suffix array access) Required for the STL Random Access Container Concept.
template<uint8_t b, class rank_support_type >
lcp_dac< b, rank_support_type >::size_type sdsl::lcp_dac< b, rank_support_type >::serialize ( std::ostream &  out,
structure_tree_node v = NULL,
std::string  name = "" 
) const

Serialize to a stream.

Parameters:
outOutstream to write the data structure.
Returns:
The number of written bytes.
template<uint8_t b = 4, class rank_support_type = rank_support_v5<>>
size_type sdsl::lcp_dac< b, rank_support_type >::size ( ) const [inline]

Number of elements in the instance.

Required for the Container Concept of the STL.

See also:
max_size, empty
template<uint8_t b, class rank_support_type >
void sdsl::lcp_dac< b, rank_support_type >::swap ( lcp_dac< b, rank_support_type > &  lcp_c)

Swap method for lcp_dac.

The swap method can be defined in terms of assignment. This requires three assignments, each of which, for a container type, is linear in the container's size. In a sense, then, a.swap(b) is redundant. This implementation guaranties a run-time complexity that is constant rather than linear.

Parameters:
lcp_clcp_dac to swap.

Required for the Assignable Conecpt of the STL.


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