10 namespace libdivsufsort {
13 template<
typename buffer_t>
24 inline Accessor(buffer_t& buffer, saidx_t i) : m_buffer(buffer), m_index(i) {}
25 inline operator saidx_t() {
return saidx_t(m_buffer[m_index]); }
26 inline Accessor&
operator=(saidx_t v) { m_buffer[m_index] = v;
return *
this; }
28 inline Accessor&
operator=(
const Accessor& other) {
29 m_buffer[m_index] = other.m_buffer[other.m_index];
35 BufferWrapper(buffer_t& buffer) : m_buffer(buffer) {}
36 inline Accessor operator[](saidx_t i) {
return Accessor(m_buffer, i); }
48 inline saidx_t to_signed(uint64_t v,
int p = 0) {
54 inline uint64_t to_unsigned(saidx_t v,
int p = 0) {
55 return (uint64_t(int64_t(v)) << m_shift) >> m_shift;
58 std::string pm(uint64_t v) {
60 for(
size_t i = 0; i < 64; i++) {
61 ss << int((v & (1ull << (64 - i - 1))) != 0);
70 m_shift(64 - buffer.width())
74 inline operator saidx_t() {
return to_signed(m_buffer[m_index]); }
75 inline Accessor&
operator=(saidx_t v) { m_buffer[m_index] = to_unsigned(v);
return *
this; }
77 inline Accessor&
operator=(
const Accessor& other) {
78 m_buffer[m_index] = other.m_buffer[other.m_index];
Contains the text compression and encoding framework.
uint_impl_t & operator=(const uint_impl_t &b)
constexpr T shift_by(T value, int amount) noexcept
IntVector< dynamic_t > DynamicIntVector
Represents an integer vector with unspecified (dynamic) bit width.