Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include CSA++ into SDSL version 3 #32

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6fb6ac0
Added csa_alphabet_strategy which allows use of context lengths large…
simongog Apr 28, 2016
0aacc98
Added new strategy
simongog Apr 28, 2016
22e6223
Simplified rank_bwt
simongog Apr 29, 2016
53452cc
added double_rank
simongog Apr 30, 2016
5baab8c
Random access partitioned Elias-Fano impl.
simongog May 3, 2016
4ebfdb5
csa_sada2 realizes the CSA concept now
simongog May 4, 2016
91d332d
With combined rank
simongog May 4, 2016
341e2ec
Added RL block type; restructering of code will follow
simongog May 5, 2016
b536740
Combined rank calculation for EF
simongog May 6, 2016
23bfeeb
Handling rare characters
simongog May 8, 2016
ec27504
Removed unnecessary select in WT
simongog May 8, 2016
163c672
Fixed case where i>m_size
simongog May 13, 2016
4fb60d3
fixed alignment error
simongog May 14, 2016
d13f8c1
don't use double_rank
simongog May 15, 2016
1e2b627
Fixed error in construction
simongog Jul 30, 2016
cdf75a0
Move global debug variable from header to source file
niklasb Aug 29, 2016
ba86929
Merge pull request #337 from niklasb/hyb_sd_vector_slow
simongog Aug 29, 2016
3bc750f
Fix and debug information
simongog Nov 15, 2016
e0145d9
Merge branch 'hyb_sd_vector_slow' of github.com:simongog/sdsl-lite in…
simongog Nov 15, 2016
459a16e
Merging the hyb_sd_vector_slow branch
simongog Dec 13, 2017
c158125
csa_sada2
simongog Dec 14, 2017
99d6ecf
removed sdsl library flag
simongog Dec 14, 2017
d3ccdd3
Adjsuted licence information
simongog Dec 15, 2017
32415ab
Address compiler warnings
simongog Dec 24, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/sdsl/bit_vectors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
#include "rrr_vector.hpp"
#include "sd_vector.hpp"
#include "hyb_vector.hpp"
#include "hyb_sd_vector.hpp"

#endif
25 changes: 18 additions & 7 deletions include/sdsl/bits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
#include <stdint.h> // for uint64_t uint32_t declaration
#include <iostream> // for cerr
#include <cassert>
#ifdef __SSE4_2__

// clang-format off
#if 1
#include <xmmintrin.h>
#endif
#ifdef __BMI2__
#if 0
#include <x86intrin.h>
#endif
// clang-format on

#ifdef WIN32
#include "iso646.h"
Expand Down Expand Up @@ -490,9 +493,11 @@ struct bits_impl {
template <typename T>
inline uint64_t bits_impl<T>::cnt(uint64_t x)
{
#ifdef __SSE4_2__
// clang-format off
#if 1
return __builtin_popcountll(x);
#else
// clang-format on
#ifdef POPCOUNT_TL
return lt_cnt[x & 0xFFULL] + lt_cnt[(x >> 8) & 0xFFULL] + lt_cnt[(x >> 16) & 0xFFULL] +
lt_cnt[(x >> 24) & 0xFFULL] + lt_cnt[(x >> 32) & 0xFFULL] + lt_cnt[(x >> 40) & 0xFFULL] +
Expand Down Expand Up @@ -579,11 +584,13 @@ inline uint64_t bits_impl<T>::map01(uint64_t x, uint64_t c)
template <typename T>
inline uint32_t bits_impl<T>::sel(uint64_t x, uint32_t i)
{
#ifdef __BMI2__
// clang-format off
#if 0
// taken from folly
return _tzcnt_u64(_pdep_u64(1ULL << (i - 1), x));
#endif
#ifdef __SSE4_2__
#if 1
// clang-format on
uint64_t s = x, b;
s = s - ((s >> 1) & 0x5555555555555555ULL);
s = (s & 0x3333333333333333ULL) + ((s >> 2) & 0x3333333333333333ULL);
Expand Down Expand Up @@ -653,10 +660,12 @@ inline uint32_t bits_impl<T>::_sel(uint64_t x, uint32_t i)
template <typename T>
inline uint32_t bits_impl<T>::hi(uint64_t x)
{
#ifdef __SSE4_2__
// clang-format off
#if 1
if (x == 0) return 0;
return 63 - __builtin_clzll(x);
#else
// clang-format on
uint64_t t, tt; // temporaries
if ((tt = x >> 32)) { // hi >= 32
if ((t = tt >> 16)) { // hi >= 48
Expand All @@ -679,10 +688,12 @@ inline uint32_t bits_impl<T>::hi(uint64_t x)
template <typename T>
inline uint32_t bits_impl<T>::lo(uint64_t x)
{
#ifdef __SSE4_2__
// clang-format off
#if 1
if (x == 0) return 0;
return __builtin_ctzll(x);
#else
// clang-format on
if (x & 1) return 0;
if (x & 3) return 1;
if (x & 7) return 2;
Expand Down
12 changes: 12 additions & 0 deletions include/sdsl/coder_elias_delta.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ class elias_delta {
{
return v.m_data;
}

static uint64_t decode(const uint64_t*& z, uint8_t& offset)
{
size_type len_1_len;
len_1_len = bits::read_unary_and_move(z, offset); // read length of length of x
if (!len_1_len) {
return 1ULL;
}
size_type len = bits::read_int_and_move(z, offset, len_1_len) + (1ULL << len_1_len);
return bits::read_int_and_move(z, offset, len-1) + (len-1<64) * (1ULL << (len-1));
}

};

// \sa coder::elias_delta::encoding_length
Expand Down
25 changes: 25 additions & 0 deletions include/sdsl/config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,31 @@ using key_text_trait = key_text_trait_impl<width,void>;
template<uint8_t width>
using key_bwt_trait = key_bwt_trait_impl<width,void>;

template<uint8_t int_width>
constexpr const char* key_text()
{
return conf::KEY_TEXT_INT;
}

template<uint8_t int_width>
constexpr const char* key_bwt()
{
return conf::KEY_BWT_INT;
}


template<>
inline constexpr const char* key_text<8>()
{
return conf::KEY_TEXT;
}

template<>
inline constexpr const char* key_bwt<8>()
{
return conf::KEY_BWT;
}

}

#endif
1 change: 1 addition & 0 deletions include/sdsl/construct_sa.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "config.hpp"
#include "int_vector.hpp"
#include "bits.hpp"

#include "divsufsort.h"
#include "divsufsort64.h"
Expand Down
Loading