Skip to content

Commit

Permalink
Futher reduced the complexity.
Browse files Browse the repository at this point in the history
  *  removed select_support_dummy as it can be replaced by select_support_scan.
  *  removed all include of the testutils header
  *  replaced the _dummy-supports by _scan-supports.
  • Loading branch information
simongog committed Mar 13, 2013
1 parent bfdc8a6 commit 8692d01
Show file tree
Hide file tree
Showing 32 changed files with 60 additions and 196 deletions.
1 change: 0 additions & 1 deletion examples/hugepages.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <sdsl/int_vector.hpp>
#include <sdsl/suffix_trees.hpp>
#include <sdsl/wt_rlmn.hpp>
#include <sdsl/testutils.hpp>
#include <sdsl/bit_vector_interleaved.hpp>
#include <iostream>
#include <string>
Expand Down
60 changes: 39 additions & 21 deletions extras/cheatsheet/sdsl-cheatsheet.tex
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ \subsection{Static Vector}
delta and self-delimiting encoded.. \\
\end{tabular}

\subsection{Bitvectors (BV)}
\subsection{Bitvector (BV)}
Representations for a bitvector of length $n$ with $m$ set bits.
\begin{tabular}{@{}lll@{}}
\textit{Class} & \textit{Description} & \textit{Space in bits} \\
Expand All @@ -203,12 +203,12 @@ \subsection{Bitvectors (BV)}
& $\approx\ 2 m\cdot log\frac{n}{m}$ \\
\end{tabular}

\subsection{Rank Supports (RS)}
Support structure adding rank functionality to BV. Method
\code{rank(i)} or \code{operator(i)} for \code{i}$\in [0,n]$ returns the number
\subsection{Rank Support (RS)}
RS adds rank functionality to BV. Method
\code{rank($i$)} or \code{operator($i$)} returns the number
of set bits\footnote{It is also possible to rank \code{0} or
the patterns \code{10} and \code{01}.} in the prefix $[0..i)$ of the
supported BV.
supported BV for $i \in [0,n]$.
\begin{tabular}{@{}llll@{}}
\textit{Class} & \textit{Compatible BV} & \textit{Space (bits)} & \textit{Time} \\
\href{\sdslgit/include/sdsl/rank_support_v.hpp}{\sdslranksupportv} &
Expand All @@ -218,17 +218,23 @@ \subsection{Rank Supports (RS)}
\href{\sdslgit/include/sdsl/rank_support_scan.hpp}{\sdslranksupportscan} &
\sdslbitvector & 64 & \Order{n} \\
\href{\sdslgit/include/sdsl/rank_support_il.hpp}{\sdslranksupportil} &
\sdslbitvector & 128 & \Order{1} \\
\sdslbitvectoril & 128 & \Order{1} \\
\href{\sdslgit/include/sdsl/rrr_vector.hpp}{\sdslrrrranksupport} &
\sdslrrrvector & 80 & \Order{k} \\
\href{\sdslgit/include/sdsl/sd_vector.hpp}{\sdslsdranksupport} &
\sdslsdvector & 64 & \Order{1} \\
\end{tabular}
Call \code{util::init\_support(rs, bv)} to initialize rank
structure \code{rs} to bitvector \code{bv}. Call \code{rs(i)}
to get $\code{rank(i)}=\sum_{k=0}^{k<i}\code{bv[}k\code{]}$

\subsection{Select Supports (SS)}
Call~\code{util::init\_support(rs, bv)}~to initialize rank
structure \code{rs} to bitvector \code{bv}. Call \code{rs($i$)}
to get $\code{rank(}i\code{)}=\sum_{k=0}^{k<i}\code{bv[}k\code{]}$

\subsection{Select Support (SS)}\label{sec-SS}
SS adds select functionality to BV. Let $m$ be the number of set bits
in BV. Method \code{select($i$)} or \code{operator($i$)} return the
position of the $i$-th set bit%
\footnote{It is also possible to select \code{0} or
the patterns \code{10} and \code{01}.}
in BV for \code{i}$\in [1..m]$.
\begin{tabular}{@{}lll@{}}
\textit{Class} & \textit{Compatible BV} & \textit{Space in bits} \\
\href{\sdslgit/include/sdsl/select_support_mcl.hpp}{\sdslselectsupportmcl} &
Expand All @@ -242,6 +248,9 @@ \subsection{Select Supports (SS)}
\href{\sdslgit/include/sdsl/sd_select_support.hpp}{\sdslsdselectsupport} &
\sdslsdvector & $64$ \\
\end{tabular}
Call~\code{util::init\_support(ss, bv)}~to initialize \code{ss}
to bitvector \code{bv}. Call \code{ss($i$)} to get
$\code{select(}i\code{)}=\min\{j\mid \code{rank(}j+1\code{)}=i\}$.

\subsection{Wavelet Trees (WT)}
\begin{tabular}{@{}ll@{}}
Expand Down Expand Up @@ -294,6 +303,8 @@ \subsection{Longest Common Prefix (LCP) Arrays}
\end{tabular}

\subsection{Balanced Parentheses Support (BPS)}
An opening (closing) parenthesis is represented as
\code{1} (\code{0}) in a \code{bit\_vector}.\\
\begin{tabular}{@{}ll@{}}
\href{\sdslgit/include/sdsl/bp_support_g.hpp}{\sdslbpsupportg} &
2 level pioneer structure.\\
Expand All @@ -302,6 +313,11 @@ \subsection{Balanced Parentheses Support (BPS)}
\href{\sdslgit/include/sdsl/bp_support_sada.hpp}{\sdslbpsupportsada} &
min-max-tree.\\
\end{tabular}
\textit{Public~methods:} \code{find\_open($i$)}, \code{find\_close($i$)},
\code{enclode($i$)}, \code{double\_enclose($i$,$j$)}, \code{excess($i$)},
\code{rr\_enclose($i$,$j$)}, \code{rank($i$)}\footnote{For PBS the
bits are counted in the prefix $[0..i]$.}, \code{select($i$)}.
\\

\subsection{Compressed Suffix Trees (CST)}
\settowidth{\MyLen}{\sdslcstsada\quad}
Expand All @@ -313,17 +329,17 @@ \subsection{Compressed Suffix Trees (CST)}
Represents the nodes as intervals.\\
\end{tabular}
\textit{Public~types:} \code{node\_type}.
In the following let \code{v}, \code{w} be nodes
and \code{i}, \code{d}, \code{lb}, \code{rb} integers.\\
In the following let $v$, $w$ be nodes
and $i$, $d$, $lb$, $rb$ integers.\\
\textit{Public~methods:}
\code{root()}, \code{is\_leaf(v)}, \code{select\_leaf(i)},
\code{size(v)}, \code{leftmost\_leaf(v)}, \code{rightmost\_leaf(v)},
\code{lb(v)}, \code{rb(v)}, \code{parent(v)}, \code{sibling(v)},
\code{select\_child(v, i)}, \code{degree(v)},
\code{child(v,c)}, \code{edge(v, d)}, \code{lca(v,w)},
\code{depth(v)}, \code{node\_depth}, \code{sl(v)},
\code{wl(v,c)}, \code{sn(v)}, \code{id(v)}, \code{inv\_id(i)},
\code{node(lb, rb)}, \code{nodes()}, \code{size()},
\code{root()}, \code{is\_leaf($v$)}, \code{select\_leaf($i$)},
\code{size($v$)}, \code{leftmost\_leaf($v$)}, \code{rightmost\_leaf($v$)},
\code{lb($v$)}, \code{rb($v$)}, \code{parent($v$)}, \code{sibling($v$)},
\code{select\_child($v$, $i$)}, \code{degree($v$)},
\code{child($v$,$c$)}, \code{edge($v$, $d$)}, \code{lca($v$,w)},
\code{depth($v$)}, \code{node\_depth}, \code{sl($v$)},
\code{wl($v$,$c$)}, \code{sn($v$)}, \code{id($v$)}, \code{inv\_id($i$)},
\code{node($lb$, $rb$)}, \code{nodes()}, \code{size()},
\code{begin()}, \code{end()}, \code{begin\_bottom\_up()},
\code{end\_bottom\_up}.\\
\textit{Public~members:} \code{csa}, \code{lcp}.
Expand Down Expand Up @@ -449,6 +465,8 @@ \section{Acknowledgements}
\rule{0.3\linewidth}{0.25pt}
\scriptsize

\copyright\ Simon Gog

Cheatsheet template provided by Winston Chang
http://www.stdout.org/$\sim$winston/latex/

Expand Down
5 changes: 1 addition & 4 deletions include/sdsl/algorithms_for_compressed_suffix_arrays.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@
#define INCLUDED_SDSL_ALGORITHMS_FOR_COMPRESSED_SUFFIX_ARRAYS

#include "int_vector.hpp" // for bit_vector
#include "util.hpp"
#include <stack> // for calculate_supercartesian_tree_bp

#ifdef SDSL_DEBUG_ALGORITHMS_FOR_COMPRESSED_SUFFIX_ARRAYS
#include "testutils.hpp"
#endif

namespace sdsl
{

Expand Down
3 changes: 2 additions & 1 deletion include/sdsl/bp_support.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
* - find_open
* - find_close
* - enclose
* - double_enclose
* - rank
* - select
* - excess
* - (rr_enclose)
* - rr_enclose
*/

#include "bp_support_j.hpp"
Expand Down
1 change: 0 additions & 1 deletion include/sdsl/bp_support_gg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "select_support.hpp"
#include "algorithms.hpp"
#include "util.hpp"
#include "testutils.hpp"
#include <stack>
#include <map>
#include <set>
Expand Down
1 change: 0 additions & 1 deletion include/sdsl/construct_bwt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "typedefs.hpp"
#include "int_vector.hpp"
#include "util.hpp"
#include "testutils.hpp"
#include "config.hpp" // for cache_config

#include <iostream>
Expand Down
1 change: 0 additions & 1 deletion include/sdsl/construct_isa.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#include "int_vector.hpp"
#include "util.hpp"
#include "testutils.hpp"

#include <iostream>
#include <stdexcept>
Expand Down
4 changes: 2 additions & 2 deletions include/sdsl/construct_lcp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
#include "typedefs.hpp" // includes definition of tMSS
#include "config.hpp"
#include "int_vector.hpp"
#include "rank_support_v.hpp"
#include "rank_support.hpp"
#include "select_support.hpp"
#include "util.hpp"
#include "testutils.hpp"
#include "construct_isa.hpp"
#include "construct_bwt.hpp"
#include "wt_huff.hpp"
Expand Down
1 change: 0 additions & 1 deletion include/sdsl/csa_bitcompressed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "algorithms.hpp"
#include "iterators.hpp"
#include "util.hpp"
#include "testutils.hpp"
#include "csa_sampling_strategy.hpp"
#include "csa_alphabet_strategy.hpp"
#include <iostream>
Expand Down
1 change: 0 additions & 1 deletion include/sdsl/csa_sada.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "iterators.hpp"
#include "suffix_array_helper.hpp"
#include "util.hpp"
#include "testutils.hpp"
#include "csa_sampling_strategy.hpp"
#include "csa_alphabet_strategy.hpp"
#include <iostream>
Expand Down
1 change: 0 additions & 1 deletion include/sdsl/cst_sct3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "cst_iterators.hpp"
#include "rank_support.hpp"
#include "select_support.hpp"
#include "testutils.hpp"
#include "util.hpp"
#include <iostream>
#include <algorithm>
Expand Down
1 change: 0 additions & 1 deletion include/sdsl/int_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "bit_magic.hpp"
#include "structure_tree.hpp"
#include "util.hpp"
#include "testutils.hpp"
#include "config.hpp"
#include "uintx_t.hpp"

Expand Down
1 change: 0 additions & 1 deletion include/sdsl/lcp_dac.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "algorithms.hpp"
#include "iterators.hpp"
#include "util.hpp"
#include "testutils.hpp"
#include "rank_support_v.hpp"
#include "rank_support_v5.hpp"
#include <iostream>
Expand Down
7 changes: 3 additions & 4 deletions include/sdsl/lcp_support_tree2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "util.hpp"
#include "algorithms_for_compressed_suffix_trees.hpp"
#include "rank_support_v.hpp"
#include "select_support_dummy.hpp"
#include "wt_huff.hpp"
#include <iostream>
#include <string>
Expand Down Expand Up @@ -35,11 +34,11 @@ class _lcp_support_tree2
typedef int_vector<>::size_type size_type; // STL Container requirement
typedef int_vector<>::difference_type difference_type; // STL Container requirement
typedef Cst cst_type;
typedef select_support_dummy tDummySS;
typedef wt_huff<bit_vector, rank_support_v5<>,
tDummySS, tDummySS> small_lcp_type;
select_support_scan<1>,
select_support_scan<0> > small_lcp_type;

typedef lcp_tree_and_lf_compressed_tag lcp_category;
typedef lcp_tree_and_lf_compressed_tag lcp_category;

enum { fast_access = 0,
text_order = 0,
Expand Down
1 change: 0 additions & 1 deletion include/sdsl/lcp_wt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "iterators.hpp"
#include "select_support_bs.hpp" // dummy select support for wavelet tree, as we don't use select in this application
#include "util.hpp"
#include "testutils.hpp"
#include <iostream>
#include <algorithm> // for lower_bound
#include <cassert>
Expand Down
8 changes: 4 additions & 4 deletions include/sdsl/rmq_succinct_sada.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#include "int_vector.hpp"
#include "algorithms_for_compressed_suffix_trees.hpp"
#include "bp_support_sada.hpp"
#include "rank_support_v.hpp"
#include "select_support_mcl.hpp"
#include "rank_support.hpp"
#include "select_support.hpp"
#include "util.hpp"
#include <utility> // for pair
#include <stack>
Expand All @@ -37,11 +37,11 @@ namespace sdsl


template<bool Minimum = true,
class Bp_support = bp_support_sada<256, 32, rank_support_v5<>, select_support_dummy>,
class Bp_support = bp_support_sada<256, 32, rank_support_v5<1>, select_support_scan<1> >,
class Rank_support10 = rank_support_v<10,2>, class Select_support10 = select_support_mcl<10,2> >
class rmq_succinct_sada;

template<class Bp_support = bp_support_sada<256, 32, rank_support_v5<>, select_support_dummy>,
template<class Bp_support = bp_support_sada<256, 32, rank_support_v5<>, select_support_scan<1> >,
class Rank_support10 = rank_support_v<10,2>, class Select_support10 = select_support_mcl<10,2> >
struct range_maximum_support_sada {
typedef rmq_succinct_sada<false, Bp_support, Rank_support10, Select_support10> type;
Expand Down
1 change: 0 additions & 1 deletion include/sdsl/select_support.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,5 @@ struct select_support_trait<01,2> {
#include "select_support_bs.hpp"
#include "select_support_mcl.hpp"
#include "select_support_scan.hpp"
#include "select_support_dummy.hpp"

#endif
66 changes: 0 additions & 66 deletions include/sdsl/select_support_dummy.hpp

This file was deleted.

7 changes: 1 addition & 6 deletions include/sdsl/select_support_mcl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,9 @@
#define INCLUDED_SDSL_SELECT_SUPPORT_JMC

#include "int_vector.hpp"
#include "util.hpp"
#include "select_support.hpp"

//#define SDSL_DEBUG_SELECT_SUPPORT_JMC

#ifdef SDSL_DEBUG_SELECT_SUPPORT_JMC
#include "testutils.hpp"
#endif

//! Namespace for the succinct data structure library.
namespace sdsl {

Expand Down
Loading

0 comments on commit 8692d01

Please sign in to comment.